TransWikia.com

How do you make the Place Order button disabled until after the address update button is pushed?

Magento Asked by babywit on February 13, 2021

I am in Magento 2.13. If a customer checks out and uses a different billing and shipping address, the place order button is live, even if they have not pushed the update address button.
This causes the shipping address to over write the billing address when it is submitted causing errors in the CC processing and also for the shipping address to show up in the invoice.
How can I make it so that the Place Order button is disabled until AFTER they have hit the update button for the address?Place Order Button is live before Update Address button has been pushed

3 Answers

The issue is in Braintree payment method only and it resolved in Magento - 2.1.10 issue #8522

To resolve the issue in below Magento 2.1.10 version follow given steps.

Override the below template in your theme

vendor/magento/module-braintree/view/frontend/web/template/payment/form.html

After that update code from line no 139 to 149 with given below code

<button class="action primary checkout"
        type="submit"
        data-bind="
            click: placeOrderClick,
            attr: {title: $t('Place Order')},
            css: {disabled: !isPlaceOrderActionAllowed()},
            enable: isActive()
        "
        disabled>
    <span data-bind="i18n: 'Place Order'"></span>
</button>

Answered by Technocracker on February 13, 2021

This appears to be an acknowledged bug in M2 See Issue 8522

Answered by babywit on February 13, 2021

First I would have a look at IWD one page checkout ( google it ) its a great exetension and I use it on several M2 stores, it automatically calculates shipping and does not have an update button.

Failing that try this with good old javascripty

<script>
document.getElementById(' Your ORDER BUTTON ID ').style.display = 'none';

document.getElementById(' UPDATE BUTTON ID ').onclick=function(){

document.getElementById(' YOUR ORDER BUTTON ID ').style.display=''; 
};
</sript>

There are other ways of doing this but to be fare if you just use javascript you are not changing any magento process logic , just make sure you overwright the files in the correct way , seriously though look at the IWD extension it solves your problem out of the box I think

Answered by Barry Connolly on February 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP