0

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
  • Looks like an "artificial" flow. Are there any cases if somebody places an order and already has open address form block?
    – joni jones
    Feb 10, 2017 at 9:06
  • not sure about that but the checkout is straight out of the box M2.13 and it occurs whether it is using the blank theme, luma or my custom theme.
    – babywit
    Feb 10, 2017 at 18:14
  • Apparently this has something to do with the Braintree module that comes installed with M2. I disabled the Braintree payment extension and now the Place Order button works as it should and is disabled until the customer presses the update address button. Would love a work around if anyone has one as I like using the Braintree Payment solution.
    – babywit
    Feb 10, 2017 at 18:31

3 Answers 3

0

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

3
  • I just tried to install IWD checkout but same issue. It does have an update button that needs to be pushed. Also affected by braintree module. I can say it was an easy install.
    – babywit
    Feb 13, 2017 at 16:45
  • Can I ask what file you would put this javascript on. I am not verse yet in js or php so it is all copy and paste for me. Thank you.
    – babywit
    Feb 13, 2017 at 16:46
  • First of all if you turn on template hints you will be able to see what page is being called: Feb 14, 2017 at 14:25
0

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

0

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>
0

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.