0

we are trying to override the cart "go to checkout" button in a custom module, but can't get it working state. (CE 2.2.6)

I am using view/layout/checkout_cart_index.xml with the following content

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <referenceBlock name="checkout.cart.methods.onepage.bottom" template="Namespace_Module::onepage/link.phtml" />
        </referenceContainer>
    </body>
</page>

And copied the original content to templates/onepage/link.phtml

So far so good, it doesn't work (checked with template hints and added a marker to link.phtml)

Any ideas would be helpful.

Cheers Jan

1 Answer 1

0

Try This :-

<referenceBlock name="checkout.cart.methods.onepage.bottom">
   <action method="setTemplate">
       <argument name="template" xsi:type="string">Namespace_Module::onepage/link.phtml</argument>
   </action>
</referenceBlock>
11
  • Hey Ronak, sadly the result is the same, doesn't work. I also tried to use the alias in the outer referenceContainer ("methods"). Confused! Mar 13, 2019 at 10:04
  • not working ????? Mar 13, 2019 at 10:05
  • See above @Ronak Rathod. Thanks! Mar 13, 2019 at 10:08
  • check my updated answer Mar 13, 2019 at 10:12
  • Your updated solution works! Many many thanks - why do you need to use the setTemplate method, it's unclear to me! Mar 13, 2019 at 10:19

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.