I am wondering how I could pass a variable into the simpleCart function for different checkout links depending on which button is pressed.
Buttons:
$('.paypal_checkout').on('click', function(){
window.checkoutlink = 'http://url.com/paypal';
simpleCart.checkout();
return true;
});
$('.stripe_checkout').on('click', function(){
window.checkoutlink = 'http://url.com/stripe';
simpleCart.checkout();
return true;
});
SimpleCart:
simpleCart({
checkout: {
type: "SendForm" ,
url: checkoutlink ,
}
});
You have to edit the simpleCart.js file to make it work where it has SendForm I changed action = opts.url to the global variable checkoutlink which Is defined within my onclick function:
edited simpleCart.js:
buttons: