Hi, so we have our cart page and when the user clicks on the payment button, we need to check if the total sum meets our min order criteria. We have implemented custom code that gets current cart object, but the problem remains - how to select payment button. The closest we get is $w( “#shoppingCart1” ) which returns IFrame that contains, the button we need to attach click event handler:
<button type="button" data-hook="checkout-button-button" class="_36c9s"><span data-hook="nonFastFlow-button-content">....</button>
With vanilla javascript that would be easy, but that’s not possible with corvid restrictions - can’t directly select DOM elements and attach event listeners.
Our goal:
-
attach click event listener to the payment button
-
handle event - if total cart value < our settings, then preventDefault() & show warning lightbox
So is there a way to select a payment button?
Thanks!