Good news if you're running 1.5.7c (tested). The Stripe add-on works with the following minor code changes to Zen Cart:
1.) In public_html/includes/classes/observers/ZcaBootstrapObserver.php:
On/around line 198, change
to:PHP Code:$field = str_replace('class="', 'class="custom-select', $field);
Note: that change is a single space after custom-select; without it, the selector can't find the class since it's mangled by the custom-select. You can alternatively just comment out this line, though I can't vouch for what impact it might have elsewhere. Either option seems to work fine.PHP Code:$field = str_replace('class="', 'class="custom-select ', $field);
2.) If you don't make any further changes, Stripe should work, but if there's a problem with the customer's payment, the button to resubmit payment is permanently disabled and customer is likely to become frustrated. To fix this, go to public_html/includes/modules/pages/checkout_confirmation/jscript_double_submit.php and add the following after the line setTimeout('button_timeout()', 4000); so that the JavaScript becomes:
Then add the following lines of code just before the closing </script> tag:Code:setTimeout('button_timeout()', 4000); setTimeout('button_reenable()', 9000);
What the revised code does is re-enable the button to submit payment 5 seconds after it's been disabled. This should preserve the objective of preventing accidental double-clicks AND allow the customer to re-submit after correcting payment information.Code:function button_reenable() { var button = document.getElementById("btn_submit"); button.style.cursor="pointer"; button.disabled = false; }
Disclaimer: While these modifications are relatively minor, make them at your own risk. The scope of the post is strictly to help other merchants and has no connection with either the Zen Cart developers or the add-on module developer.


Reply With Quote

