Skip to content

Instantly share code, notes, and snippets.

@snez
Last active December 30, 2017 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snez/e5c6d797264b5f7bd6cdcf5cc5aba045 to your computer and use it in GitHub Desktop.
Save snez/e5c6d797264b5f7bd6cdcf5cc5aba045 to your computer and use it in GitHub Desktop.
Stripe.js patch for MageStore OneStepCheckout 3.2.0
diff --git a/app/design/frontend/base/default/template/onestepcheckout/onestepcheckout.phtml b/app/design/frontend/base/default/template/onestepcheckout/onestepcheckout.phtml
index e7971e7..6902b59 100755
--- a/app/design/frontend/base/default/template/onestepcheckout/onestepcheckout.phtml
+++ b/app/design/frontend/base/default/template/onestepcheckout/onestepcheckout.phtml
@@ -693,7 +693,17 @@
var options = document.getElementsByName('payment[method]');
for (var i = 0; i < options.length; i++) {
if ($(options[i].id).checked) {
- if (options[i].id.indexOf("tco") != -1) {
+ if (options[i].id.indexOf("cryozonic_stripe") != -1) {
+ createStripeToken(function(err)
+ {
+ if (err)
+ alert(err);
+ else
+ $('one-step-checkout-form').submit();
+ });
+ break;
+ }
+ else if (options[i].id.indexOf("tco") != -1) {
var params = Form.serialize('one-step-checkout-form');
var request = new Ajax.Request(
'<?php echo $this->getCheckoutUrl() . 'isAjax/tco'; ?>',
@mohitmehta1996
Copy link

What the hell is this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment