I'm having different type of products on my website with different layouts. So I've created a custom product type but don't know how to set a custom template for my custom product type. So when someone browse the product they will see different product layout and not the default one.

Thanks in advance!

  • You want to customize the whole page or some specific part , like media section , products info section or something else ? – Dinesh Saini Nov 7 '16 at 11:13

If you've created a custom product type called "test" you should create a new layout file at <vendor>/<module>/view/frontend/layout/catalog_product_view_type_test.xml and adjust your layout from there.

| improve this answer | |
  • thanks for your reply. Can I copy/paste the content from catalog_category_view_type_default.xml file? – Deeps Nov 7 '16 at 12:00
  • 1
    No, catalog_category_view_type_default.xml is for the category view. And I think your custom file catalog_product_view_type_test.xml should inherit it's layout from the default catalog_product_view.xml, so you only need to add your desired changes. – oscarpas Nov 7 '16 at 12:07
  • Oh yes, sorry that was by mistake. Yes, I've created a file catalog_product_view_type_rooms.xml and its working properly. Thanks. – Deeps Nov 7 '16 at 12:41
  • 1
    Glad I could help. Accept the answer, if you don't mind, so others can easily find the solution. – oscarpas Nov 7 '16 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.