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 !

Type: Discussion
Status: New
Rmg
View Replies:
jb1 replied on at Permalink Reply
jb1
Ok, good question.

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:
plum.Shop.emptyCart();


(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
Rmg replied on at Permalink Reply
Rmg
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.
<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
jb1 replied on at Permalink Reply
jb1
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
vGibson replied on at Permalink Reply
vGibson
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
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

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.