variants title not work properly

  • Posts: 210
  • Thank you received: 4
  • Hikashop Business
4 months 3 weeks 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: 4 months 3 weeks ago by Bender.

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

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
4 months 3 weeks 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.057 seconds
Powered by Kunena Forum