[Skip to main content](#vessel-content)

#   Variant names in product title

##

- **[steveman](/forum/user/5206-steveman "View steveman's Profile")**
- [![steveman's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/5206-steveman "View steveman's Profile")
- [ Offline](/forum/user/5206-steveman)

Less More

- Posts: 12
- Thank you received: 0
-
-

14 years 10 months ago [\#34052](#34052) by [steveman](/forum/user/5206-steveman "View steveman's Profile")  Replied by *[steveman](/forum/user/5206-steveman "View steveman's Profile")* on topic *[Re: Variant names in product title](/forum/4-how-to/2960-variant-names-in-product-title?start=20#34052 "I have a product that has two characteristics:  Product X Characteristics ----- Variants How many days hire?----1, 2 or 3 (in a drop down box) Which interface? ----- PS2, XBox (in a drop down box)  When I view product X in the first instance, the product title says &quot;Product X 1 PS2&quot;. I'm assuming it is picking up the first variants for each characteristic as the product title changes when different variants are selected.  It looks very confusing to the buyer when the product name shows a pre-selected variant. I have tried adding a variant called &quot;--&quot; to the characteristic. This sort of works, I now see a default product title as &quot;Product X -- --&quot; but it's starting to look very messy. Also, when the variants are numbers, the product title starts to look weird especially if you have a lot of characteristics. eg: Product X 1 PS2 3 5 7  Is there a way to: Show just the product name without the variant name? or Set a default variant that is blank and then force the user to choose a valid variant?  cheers!")*

I managed to get it working with only changing: Code:

echo $this-&gt;element-&gt;product_name;

to: Code:

echo $this-&gt;element-&gt;main-&gt;product_name;

You mentioned to remove the lines: Code:

&lt;div id="hikashop_product_name_&lt;?php echo $variant_name;?&gt;" style="display:none;"&gt; &lt;?php echo $variant-&gt;product_name;?&gt; &lt;/div&gt;

but I didn't find them, so I left them alone.

Seems to work OK, thank you Nicolas.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI5NjAtdmFyaWFudC1uYW1lcy1pbi1wcm9kdWN0LXRpdGxlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[vashmel](/forum/user/57594-vashmel "View vashmel's Profile")**
- [![vashmel's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/57594-vashmel "View vashmel's Profile")
- [ Offline](/forum/user/57594-vashmel)

Less More

- Posts: 1
- Thank you received: 0
-
-

8 years 1 month ago [\#298893](#298893) by [vashmel](/forum/user/57594-vashmel "View vashmel's Profile")  Replied by *[vashmel](/forum/user/57594-vashmel "View vashmel's Profile")* on topic *[Re: Variant names in product title](/forum/4-how-to/2960-variant-names-in-product-title?start=20#298893 "I have a product that has two characteristics:  Product X Characteristics ----- Variants How many days hire?----1, 2 or 3 (in a drop down box) Which interface? ----- PS2, XBox (in a drop down box)  When I view product X in the first instance, the product title says &quot;Product X 1 PS2&quot;. I'm assuming it is picking up the first variants for each characteristic as the product title changes when different variants are selected.  It looks very confusing to the buyer when the product name shows a pre-selected variant. I have tried adding a variant called &quot;--&quot; to the characteristic. This sort of works, I now see a default product title as &quot;Product X -- --&quot; but it's starting to look very messy. Also, when the variants are numbers, the product title starts to look weird especially if you have a lot of characteristics. eg: Product X 1 PS2 3 5 7  Is there a way to: Show just the product name without the variant name? or Set a default variant that is blank and then force the user to choose a valid variant?  cheers!")*

Hi Nicholas,

Sorry for reviving a post. I am using Hikashop 4 version and I would like to display the variant names that are appended to the Product title on the other part of the page, not just beside the Original title, like under the Prices maybe.

On the show_default.php file, the title only has these codes: Code:

&lt;span id="hikashop_product_name_main" class="hikashop_product_name_main" itemprop="name"&gt;&lt;?php if(hikashop_getCID('product_id') != $this-&gt;element-&gt;product_id &amp;&amp; isset($this-&gt;element-&gt;main-&gt;product_name)) echo $this-&gt;element-&gt;main-&gt;product_name; else echo $this-&gt;element-&gt;product_name; ?&gt;&lt;/span&gt;

What code do hold's these variant names that gets added to the original product names and where do I find it?

Any help is greatly appreciated.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI5NjAtdmFyaWFudC1uYW1lcy1pbi1wcm9kdWN0LXRpdGxlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

8 years 1 month ago [\#298925](#298925) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Variant names in product title](/forum/4-how-to/2960-variant-names-in-product-title?start=20#298925 "I have a product that has two characteristics:  Product X Characteristics ----- Variants How many days hire?----1, 2 or 3 (in a drop down box) Which interface? ----- PS2, XBox (in a drop down box)  When I view product X in the first instance, the product title says &quot;Product X 1 PS2&quot;. I'm assuming it is picking up the first variants for each characteristic as the product title changes when different variants are selected.  It looks very confusing to the buyer when the product name shows a pre-selected variant. I have tried adding a variant called &quot;--&quot; to the characteristic. This sort of works, I now see a default product title as &quot;Product X -- --&quot; but it's starting to look very messy. Also, when the variants are numbers, the product title starts to look weird especially if you have a lot of characteristics. eg: Product X 1 PS2 3 5 7  Is there a way to: Show just the product name without the variant name? or Set a default variant that is blank and then force the user to choose a valid variant?  cheers!")*

Hi,

The variants data is handled in the "show.php" view file. There, you have the $variant-&gt;product_name which contains the full name: main product name + the characteristic values of the current variant.
Note that there is some specific javascript code in administrator/components/com_hikashop/types/characteristic.php in order to dynamically copy the text from the selected variant to the main divs of the show_default view file when the customer changes the selection of the characteristics.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI5NjAtdmFyaWFudC1uYW1lcy1pbi1wcm9kdWN0LXRpdGxlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.051 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
