Setting default layout product detail page
-
20-10-2020 - |
Question
I'm customizing the layout in CE-1.9.2.2. After selecting a product in the grid, I get to the productdetails. This page is shown in 1column-layout. I want to use the 3column-layout in this view.
I know I can change the view for each product seperately, but I wan't it to be changed for all and as default.
Where do I look?
Solution
the fastest way is redifine the root template for those routes in a local.xml:
[root]/app/design/frontend/{your_package}/{your_theme}/layout/local.xml
Then apply this:
<reference name="root">
<action method="setTemplate"><template>page/{your_template}.phtml</template></action>
</reference>
to all "product-list" related routes, these are:
<catalog_category_default/>
<catalog_category_layered/>
<catalogsearch_result_index/>
<catalogsearch_advanced_result/>
for "product-view"
<catalog_product_view/>
So for the catalog_product_view route the complete code would be:
<?xml version="1.0"?>
<layout>
<catalog_product_view>
<reference name="root">
<action method="setTemplate"><template>page/{your_template}.phtml</template></action>
</reference>
</catalog_product_view>
... other routes ...
</layout>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange