I want to move custom options below Add to Cart button and also want to move short description within form tag.How can I achieve this?
Also I want to know why my custom php code not working in addtocart phtml file? Thanks
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI want to move custom options below Add to Cart button and also want to move short description within form tag.How can I achieve this?
Also I want to know why my custom php code not working in addtocart phtml file? Thanks
case 1: Assume that you are using a custom theme name "Vendor_yourtheme".
Update the file YOUR-MAGENTO-ROOT/app/design/frontend/Vendor/yourtheme/Magento_Catalog/layout/catalog_product_view.xml as below
File : catalog_product_view.xml
<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="product.info.form.options">
<move element="product.info.options" destination="product.info.options.wrapper.bottom" />
</referenceBlock>
<move element="product.info" destination="product.info.main" before="product.info.addtocart"/>
</body>
</page>
Case 2: Assume that you are using a custom extension name Company_MyModule to update product view detail page layout.
Update the file YOUR-MAGENTO-ROOT/app/code/Company/MyMyModule/view/frontend/layout/catalog_product_view.xml with below below
File : catalog_product_view.xml
<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<<referenceBlock name="product.info.form.options">
<move element="product.info.options" destination="product.info.options.wrapper.bottom" />
</referenceBlock>
<move element="product.info" destination="product.info.main" before="product.info.addtocart"/>
</body>
</page>
Please clear Mageto cache to view the updated layout changes in front end.