Show main Product Code on variant change

  • Posts: 91
  • Thank you received: 5
5 years 9 months ago #307044

-- HikaShop version -- : 4.0.2
-- Joomla version -- : 3.9.6
-- PHP version -- : 7.3.0
-- Browser(s) name and version -- : Chrome 74

On my site I display product code in product view. On variant select it changes,

E.g. the code is FD02
and than it changes to FD02_37_48

How can I show always the main code?

I changed the show_default.php part to

<?php if ($this->config->get('show_code')) { ?>
		<span id="hikashop_product_code_main" class="hikashop_product_code_main" itemprop="sku"><?php
			echo $this->element->main->product_code;//this line changed
		?></span>
<?php } ?>
but it still changes on variant select.

Thanks!

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

  • Posts: 83483
  • Thank you received: 13505
  • MODERATOR
5 years 9 months ago #307045

Hi,

Remove the piece:

id="hikashop_product_code_main" class="hikashop_product_code_main"
That way, the javascript won't change the product code when you change the variant selection.

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

  • Posts: 91
  • Thank you received: 5
5 years 9 months ago #307077

Thank you, it helped!

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

Time to create page: 0.056 seconds
Powered by Kunena Forum