Custom product layout is not applied to product variants

  • Posts: 1
  • Thank you received: 0
4 years 1 month ago #328843

-- url of the page with the problem -- : www.abibannerdrucken.de/
-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.24
-- PHP version -- : 7.4
-- Browser(s) name and version -- : Google Chrome 88.0.4324.104

Dear Hika-Shop-Team,

first of all: Thank you for your work and the great software you are developing in such a great way! Its working so fantastic, except one thing: I have created a custom product page layout called show_qm (mainly a copy of show_default but refers to a different listing_price-view, where I have inserted another name for the PER_UNIT-translation (now its PER_QM)). This view works fine on all main-products. But if I change the product to one of its child from the options menue, the view is not applied anymore (so in my case the PER_QM-translator changes back to PER_UNIT). I also have tried to insert the product-layout-name directly in the database.

Inside the DB-table hikashop_product there is a column named product_layout. But it seems like only the main-products are using this table to get their product-layout-information, because if i enter show_qm in a variant product there, nothing changes.

So my question is, where can I find the PHP-part that loads the Variants from database? I quess I have to add / change a few lines of code to get Hika-Shop read the database-column "product layout" when loading the product variants. Or is there any other way?

Thank you very much,
best regards
Niclas

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

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
4 years 1 month ago #328861

Hi,

The listing_price.php view file is also called from the show.php view file for the display of the prices of the variants.
So if you only change the call to listing_price.php in the show_default.php view file, it will only apply to products without variants.
So in your case, I would rather recommend to follow our FAQ on this :
www.hikashop.com/support/documentation/106-faq.html
( you need to read the answer to the question "I sell packed products, how can I change "each" text in the product page ?" )
That way, you can achieve what you want by create a custom field of the table "product" and only customizing the "listing_price.php view file, which will be taken into account by both the show_default.php and the show.php view files.

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

Time to create page: 0.053 seconds
Powered by Kunena Forum