product specific layout
Posted: Sat May 28, 2022 3:51 am
Hi,
I am reading in your documentation:
http://docs.opencart.com/en-gb/catalog/product/design/
It says, I could override the default layout for any product by creating a new layout and assign any product to this new layout if desired.
I did so. I created a modified product template and set it up in a new layout and selected this layout in the product data which creates an entry in table oc_product_to_layout assigning the product_id to the selected layout_id.
However, any modification of this kind does NOT show up in the shopping cart's product page. It continues to use the default layout.
This is because in controller/product/product.php you write:
means, you do not check whether a product specific template be defined but always load the default template. Of course, I can modify this line and have the script load a product specific template but his is not an elegant solution. As it is coded right now, the definition of specific templates in the product data sheet doesn't have any use.
Can you suggest a modification of the code in controller/product/product.php to the effect of loading the specific product template (if defined)?
Best regards
Wolfgang
I am reading in your documentation:
http://docs.opencart.com/en-gb/catalog/product/design/
It says, I could override the default layout for any product by creating a new layout and assign any product to this new layout if desired.
I did so. I created a modified product template and set it up in a new layout and selected this layout in the product data which creates an entry in table oc_product_to_layout assigning the product_id to the selected layout_id.
However, any modification of this kind does NOT show up in the shopping cart's product page. It continues to use the default layout.
This is because in controller/product/product.php you write:
Code: Select all
$this->response->setOutput($this->load->view('product/product', $data));
Can you suggest a modification of the code in controller/product/product.php to the effect of loading the specific product template (if defined)?
Best regards
Wolfgang