Skip to main content

Show main Product Code on variant change

More
7 years 4 months ago #307044 by bolando
-- 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
Code:
<?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.

More
7 years 4 months ago #307045 by nicolas
Hi,

Remove the piece:
Code:
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.

More
7 years 4 months ago #307077 by bolando
Thank you, it helped!

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

Time to create page: 0.213 seconds
Powered by Kunena Forum