1
  1. Need to hide proceed to checkout button on the cart page when session variable set

  2. Need to add one more button PROCEED TO APPROVAL below the Proceed to checkout button on the cart page.

Followed different approached mentioned here but no luck.

checkout_cart_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

<!-- first approach failed -->
<!--<body>
<referenceContainer name="checkout.cart.methods">
        <block class="Ken\Bestseller\Block\Onepage\MyLink" name="checkout.cart.methods.onepage.bottom" template="Ken_Bestseller::onepage/mylink.phtml">
        </block>
</referenceContainer>
</body>-->

<!-- second  approach failed -->
<!-- <body>
  <referenceContainer name="content">
        <referenceBlock name="checkout.cart.methods.onepage.bottom" template="Ken_Bestseller::onepage/mylink.phtml" />
  </referenceContainer>
</body> -->

<!-- 3rd  approach failed -->
  <!--<body>
       <referenceBlock name="checkout.cart.methods.onepage.bottom" template="Ken_Bestseller::onepage/mylink.phtml"/>
   </body> -->

<!-- added custom button -->
  <body>
      <referenceContainer name="checkout.cart.methods" >
            <block class="Ken\Bestseller\Block\Onepage\MyLink" name="custom.template.kenisum" after="checkout.cart.shortcut.buttons" template="Ken_Bestseller::onepage/mylink.phtml"/>
       </referenceContainer>
   </body>
</page>
2

Can you please try this once ?

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="checkout.cart.methods">
            <referenceBlock name="checkout.cart.methods.onepage.bottom">
                <action method="setTemplate">
                    <argument name="template" xsi:type="string">Ken_Bestseller::onepage/mylink.phtml</argument>
                </action>
            </referenceBlock>
        </referenceContainer>
    </body>
</page>

Hope this will help you!

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.