Empty cart after paypal
Permalink Browser Info Environment
Hi, I want to empety my cart after the customer paid on paypal, is that possible ?
How can I call a plum.shop.js function apart from the file plum.shop.js ?
Thank you for answer !
How can I call a plum.shop.js function apart from the file plum.shop.js ?
Thank you for answer !
Type: | Discussion |
---|---|
Status: | New |
Thank you for your fast answer ! I think it's a good way to do, but it doesn't work on my website. I put this.
But doesn't work ... I think it's because the shop is not call on the confirmation page. Is there a way to delete the cookies ?
Thank you
<script src="http://www.wyssmuller.ch/packages/jb_ecommerce_express/blocks/jb_ecommerce_express/js_manual/jquery.plum.shop.js"></script> <script src="http://www.wyssmuller.ch/packages/jb_ecommerce_express/blocks/jb_ecommerce_express/js_manual/express.js"></script> <script type="text/javascript"> plum.Shop.emptyCart(); </script>
But doesn't work ... I think it's because the shop is not call on the confirmation page. Is there a way to delete the cookies ?
Thank you
Ok, you're on the right track.
You may want to try these things:
1) Add the eCommerce Express block to the "thankyou" page (but without any products). This way the "plum" variable will be activated (and remove the manual addition of the 2 JS files); or
2) Manually delete the cookie called "expresscommerce" using a jQuery plugin like this:
https://github.com/carhartl/jquery-cookie...
I haven't tested those options, but it should get you closer.
Hope this helps.
JB
You may want to try these things:
1) Add the eCommerce Express block to the "thankyou" page (but without any products). This way the "plum" variable will be activated (and remove the manual addition of the 2 JS files); or
2) Manually delete the cookie called "expresscommerce" using a jQuery plugin like this:
https://github.com/carhartl/jquery-cookie...
I haven't tested those options, but it should get you closer.
Hope this helps.
JB
Working on getting this function to work on my clients "Thank you" page and it seems that it locks up and breaks the page any time I add
By break, I mean it never fully refreshes and loads the page after saving the html block and if I refresh the page the top edit bar is completely empty and you cant click on any blocks to edit them and you have to revert to the previous 'working' version via the dashboard. I'm not sure what is causing it but I can't seem to get it to work at all. Any chance this is broken with the newer version since this is a >6mo post?
Also, I'm assuming this is using a server side session now-days since I can't seem to located a cookie for expresscart for my browser... ?
Thanks again for the support
plum.Shop.emptyCart();
By break, I mean it never fully refreshes and loads the page after saving the html block and if I refresh the page the top edit bar is completely empty and you cant click on any blocks to edit them and you have to revert to the previous 'working' version via the dashboard. I'm not sure what is causing it but I can't seem to get it to work at all. Any chance this is broken with the newer version since this is a >6mo post?
Also, I'm assuming this is using a server side session now-days since I can't seem to located a cookie for expresscart for my browser... ?
Thanks again for the support
You'll need to manually add the reference to the external JS files (express.js and jquery.plum.shop.js) on your "thank you" page. The "HTML" block would be best for doing that.
Secondly to call the following Javascript function:
(based on line 191 of the express.js file)
I haven't tested this code, but it's definitely along the right lines.
Hope this helps.
JB