3

I want to change "Process to checkout" url of minicart with custom theme.

I override content.html in my custom theme but I don't know how we change url of button.

<div class="actions" if="getCartParam('possible_onepage_checkout')">
    <div class="primary">
        <button
                id="top-cart-btn-checkout"
                type="button"
                class="action primary checkout"
                data-action="close"
                data-bind="
                    attr: {
                        title: $t('Go to Checkout')
                    },
                    click: closeMinicart()
                "
                translate="'Go to Checkout'"
        />
        <div data-bind="html: getCartParam('extra_actions')"></div>
    </div>
</div>
4

Go to this file : vendor/magento/module-checkout/view/frontend/web/js/view/minicart.js

then check this code :

  'url': {
                'checkout': window.checkout.customerLoginUrl,
                'update': window.checkout.updateItemQtyUrl,
                'remove': window.checkout.removeItemUrl,
                'loginUrl': window.checkout.customerLoginUrl,
                'isRedirectRequired': window.checkout.isRedirectRequired
            },

Change the 'checkout' for URL changing.

for example :

  'url': {
                'checkout': 'google.com',
                'update': window.checkout.updateItemQtyUrl,
                'remove': window.checkout.removeItemUrl,
                'loginUrl': window.checkout.customerLoginUrl,
                'isRedirectRequired': window.checkout.isRedirectRequired
            },

Note: First add this file in our custom theme on this location : http://example.com/app/design/frontend/Nameplace/Themename/Magento_Checkout/web/js/view/minicart.js

  • Thanks for answer. But shoppingCartUrl is used in view cart but I want to change Process To Checkout url – Rahul Dec 14 '17 at 12:42
  • Check mine updated answer – D Singh Dec 14 '17 at 13:18
  • @DSingh, how to link proceed to checkout link to cart page? – jafar pinjar Dec 18 '18 at 13:51
  • @jafarpinjar this worked for me: 'checkout': window.checkout.shoppingCartUrl – user7290573 Oct 2 '19 at 15:30

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.