Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Api For Shopping Cart Rate Topic   - - - - -

 
  • natewallis
  • Advanced Member
  • Members
  • Join Date: 11-Jan 13
  • 147 posts

Posted 24 July 2018 - 12:36 AM #1

Hi.

 

Googling isn't returning much. 

 

I am developing a vue.js frontend for our website and I am starting to think that I should be leveraging the API a little more, rather than passing data through from my controllers into the TPL files and then onto my vue.js components.

 

The only entity that I can't see in the API docs is the shopping cart.  It would be beneficial to be able to retrieve this via the API.

 

By retrieving the shopping cart, I am talking about the shopping cart for the current session, rather than retrieving abandoned or specific user carts. 

 

I noticed in the CS-CART code they they are effectively locking this off from the API.  Would there be any reason for this? I am not sure I really see the issue with being able to retrieve your own cart attached to the current session.

 

Has anyone looked at this already?

 

Cheers.



 
  • natewallis
  • Advanced Member
  • Members
  • Join Date: 11-Jan 13
  • 147 posts

Posted 24 July 2018 - 02:01 AM #2

Hmm, not sure this is going to work. 

 

Not sure I am going to have access to the cart from the api.php file (easily - without duplicating core code).

 

Happy to take hints here if anyone has done this :)



 
  • natewallis
  • Advanced Member
  • Members
  • Join Date: 11-Jan 13
  • 147 posts

Posted 24 July 2018 - 02:58 AM #3

We have a simple website (products are not complicated), so I don't need a great deal of API access.  But if I can get API access to retrieve and modify users shopping cart, then I will be able to have my vue.js frontend deal with CS-CART via AJAX... I will still soldier on and see how it goes

 

Turns out the "NO_SESSION" in api.php gets in the way of this being possible. 

 

And I guess that makes sense when you are considering it is a REST API.

 

Its a bummer though, as I think something like this would be handy to retrieve via an AJAX call.