variants title not work properly

  • Posts: 221
  • Thank you received: 6
  • Hikashop Business
1 year 1 week ago #357391

If you create a product and add variants to it, a drop-down list will appear on the product page to select an variants.

When you select an variants, the title of the page changes, which consists of the product name and the name of the variants.

But when you first launch the page, although the default variants is selected, the selected variants is not displayed, but only the product name is displayed.

How to fix it ?

For example product name = good_product, varian 1 = 1, 2 = 2, 3 = 3

first launch of page is good_product, after selector good_product: 1, good_product: 2, good_product: 3

Last edit: 1 year 1 week ago by Bender.

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

  • Posts: 83007
  • Thank you received: 13399
  • MODERATOR
1 year 1 week ago #357402

Hi,

By default, when you install HikaShop, the setting "Characteristics dynamic display" setting is activated. With it, no variant is pre selected on the product page.
With that setting turned off, the default variant is indeed pre selected.
Now, even if some cases, merchants don't necessarily want to display the variant name next to the product name unless the user selects something else (for example, if you have a variant "please select" create and set as default.

So it's not really a bug, but a compromise we made for the name to display like that.
However, you can easily change the behavior.
Edit the file show_default via the menu Display>Views and change the line:

if(hikashop_getCID('product_id') != $this->element->product_id && isset($this->element->main->product_name))
to:
if(false)
and it should work like you want it to.

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

Time to create page: 0.058 seconds
Powered by Kunena Forum