0

I want to Change "Place order" button link and redirect to my custom module page. But I didn't create any payment module. I want my Place Order button will redirect to custom module page where I can collect data from users (Products data that customer order in forms)

Module Path: app>code>Softadroit>Prescription>controller>index>index.php

1 Answer 1

1

I hope you have developed a custom payment extension. You can change the action by modifying the following file in your module.

app/code/<Vendor>/<Module>/view/frontend/web/js/view/payment/method-renderer/<component>.js


define(
[   'jquery',
        'Magento_Checkout/js/view/payment/default',
        'mage/url'
    ],
function ($, Component, url) {
        'use strict';

        return Component.extend(
            {
                defaults: {
                    template: '<Vendor_Module>/payment/<template>',
                    redirectAfterPlaceOrder: false
                },
                placeOrder: function () {
                    //overriding placeOrder function
                    window.location.replace(url.build('module/new/URL'));
                }
                afterPlaceOrder: function () {
                    //redirecting after placing order in Magento
                    window.location.replace(url.build('module/new/URL'));
                }
                }
        );
});
1
  • Thanks for your reply but I didn't create any custom payment module. Commented Aug 19, 2020 at 5:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.