0

How to move add to cart button after image in product listing (catalog_catagory_view) page in magento2 using xml file

1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Commented Apr 24, 2023 at 10:07

2 Answers 2

0

Create or open the catalog_category_view.xml layout file in your theme. This file should be located in app/design/frontend/[Vendor]/[Theme]/Magento_Catalog/layout/.

Add the following XML code to the layout file

<move element="product.info.addtocart" destination="product.info.media" after="product.media"/>

Save the file and clear your Magento 2 cache.

If the above XML code doesn't work, you may need to modify it according to your specific theme's layout structure.

3
  • I have already tried but this code doesn't work Commented Apr 24, 2023 at 10:19
  • <move element="product.info.addtocart" destination="product.info.main" after="product.info.media"/> Try this...
    – Harun
    Commented Apr 24, 2023 at 10:23
  • this code doesn't work Commented Apr 24, 2023 at 10:38
0

Create or open the catalog_category_view.xml layout file in your theme. This file should be located in app/design/frontend/[Vendor]/[Theme]/Magento_Catalog/layout/.

Add the below code to XML layout file

 <move element="category.product.addto" destination="category.product.image" after="category.product.thumbnail"/>

Save the file and clear your Magento 2 cache.

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.