Display Product Code with Variant Changes

  • Posts: 3
  • Thank you received: 0
10 years 3 months ago #202194

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.4.37
-- Browser(s) name and version -- : Chrome 42.0

I am trying to 'stabilize' the display of the product_code. I have set Display-Display Product Code to YES. I have modified the Front-End CSS, as well as, the Display-View-show_default file. The product_code displays correctly when you open the page, but, if you choose an alternate characteristic, the page partially refreshes and reverts my changes.

I am betting I am missing something fairly simple, as I have spent several hours searching for an answer.

Thanks in advance for your help.

Scott

Attachments:

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
10 years 3 months ago #202220

Hi,

When you change the variant, there is some javascript which replace some elements in the page with the content of the variant.
The span with id "hikashop_product_name_main" will receive the variant product name.
The span with id "hikashop_product_code_main" will receive the variant product code.

If you have customize the view "show_default", you might need to also override the "show" view to generate the same kind of HTML code for the variants.

		if(!empty($variant->product_name)) {
?>
	<div id="hikashop_product_name_<?php echo $variant_name;?>" style="display:none;"><?php
		echo $variant->product_name;
	?></div>
<?php
		}

		if($this->config->get('show_code') && !empty($variant->product_code)) {
?>
	<div id="hikashop_product_code_<?php echo $variant_name;?>" style="display:none;"><?php
		echo $variant->product_code;
	?></div>
<?php
		}

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 3
  • Thank you received: 0
10 years 3 months ago #202601

Thanks for your help. This shows where I needed to make the necessary changes.

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

Time to create page: 0.054 seconds
Powered by Kunena Forum