Variant names in product title

  • Posts: 12
  • Thank you received: 0
7 years 2 months ago #34052

I managed to get it working with only changing:

echo $this->element->product_name;
to:
echo $this->element->main->product_name;

You mentioned to remove the lines:
<div id="hikashop_product_name_<?php echo $variant_name;?>" style="display:none;">
<?php echo $variant->product_name;?>
</div>
but I didn't find them, so I left them alone.

Seems to work OK, thank you Nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 1
  • Thank you received: 0
5 months 2 weeks ago #298893

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:

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

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 or Create an account to join the conversation.

  • Posts: 65163
  • Thank you received: 9467
  • MODERATOR
5 months 2 weeks ago #298925

Hi,

The variants data is handled in the "show.php" view file. There, you have the $variant->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 or Create an account to join the conversation.

Time to create page: 0.065 seconds
Powered by Kunena Forum