1

I create the layout for simple products. Magento_Catalog/layout/catalog_product_view.xml

Now I want to add this line:

 <move element="product.info" destination="content" before="-"/>

but only for configurable products.

How I can change the layout only for configurable products?

5

You need to create layout file for configurable product,

catalog_product_view_type_configurable.xml

Create above xml file inside layout folder and keep your code inside it.

Keep <move element="product.info" destination="content" before="-"/> content in above layout file.

  • Hi thanks, I create the layout I add the code, but the product.info block is still display on simple products – Robert Nov 7 '17 at 11:26
  • product.info is call in all product type so its display – Rakesh Jesadiya Nov 7 '17 at 11:27
  • what I want to do is to move that swatches at the bottom of the page – Robert Nov 7 '17 at 11:28
  • si if I move only product.info.options.wrapper the swatches is not work anymore. you have any idea? or how I can solve this? – Robert Nov 7 '17 at 12:08
  • you cant move only swatches to bottom of page because swatches coming inside form and after add to cart form data pass to controller so you have to keep it inside form. – Rakesh Jesadiya Nov 7 '17 at 12:12
0

You can create Product type Specific layout file using below name:

catalog_product_view_type_configurable.xml

Check more for this in Configurable Product Module:

vendor/magento/module-configurable-product/view/frontend/layout/catalog_product_view_type_configurable.xml

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.