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?

2 Answers 2

6

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.

5
  • Hi thanks, I create the layout I add the code, but the product.info block is still display on simple products
    – Robert
    Commented Nov 7, 2017 at 11:26
  • product.info is call in all product type so its display Commented Nov 7, 2017 at 11:27
  • what I want to do is to move that swatches at the bottom of the page
    – Robert
    Commented Nov 7, 2017 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
    Commented Nov 7, 2017 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. Commented Nov 7, 2017 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 and acknowledge you have read our privacy policy.

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