0

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

enter image description here

2

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.

enter image description here

|improve this answer|||||
  • Thanks.I'll try this and come back to you. – Shoaib Saleem Nov 30 '18 at 11:11
  • Thanks man. It helps me to rearrange my product page layout. – Shoaib Saleem Nov 30 '18 at 13:23
  • Can you also help to show related product in a thumbnail slider? – Shoaib Saleem Nov 30 '18 at 13:26
  • @ShoaibSaleem My pleasure. – Pritam Info 24 Nov 30 '18 at 13:27
  • @ShoaibSaleem. yes relates product can be shown in thumbnail slider. Shall I add another answer or you will post a separate question. – Pritam Info 24 Nov 30 '18 at 13:29

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.