Jump to content

Javascript access to cart total


tomsk32

Recommended Posts

Hi,

 

My suspicion is that this is a very simple question, however I am struggling to quickly find a solution, or rather reference material that will help me.

 

I am putting together a demonstration and visualisation of how a web chat product could be integrated into Prestashop.

 

I have successfully set up standard chat triggers such as number of pages visited etc however proactive char triggers such as cart total or product mix deliver more value to clients wishing to implement web chat.

 

The initial proof is to trigger chat based on the current order value in the cart (if over a certain threshold then trigger chat) - one proven, I can then implement more complex logic that works off the data in the cart and the order process (product mix, delivery methods and so forth).

 

Custom chat triggers are implemented as javascript and so within my script I need to reference the cart total - from reading around I think I need to make an AJAX call to the cart - however I can't locate a reference guide to the cart model nor the JSON data it returns.

 

Any pointers to documentation or sample reference code will be most welcome.

 

Many thanks

 

T.

Edited by tomsk32 (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...