Jump to content

[SOLVED] $cart object


andries

Recommended Posts

Hi

I am really new to prestashop. We are developping a webshop where it is possible to create a custom product using Flash.

Everything works fine, except one thing: adding it to the cart. I am able to add items to the cart, but they don't appear in the front end. In the backoffice I can see that he creates a new cart each time we save the product.

The goal is of course to add this product to the current cart.

At the moment I call the cart.php script with curl, and send the following parameters: token, id_product, add, quantity_wanted.

I have the feeling I am missing some or many parameters (for example the current customer ID, current cart ID, ...) but I don't know where to find the correct values for this. Which method allows me to grab those IDs? And which parameters are obligatory to add correctly an item to a cart?

Thanks in advance!

Andries

Solution:
the call from curl is an "outside" call and simply doesn't work. you have to use the Ajax call, or include the cart.php script.

Link to comment
Share on other sites

OK

I actually think curl is the bitch.

He calls from outside... does anyone can please help me in showing how I can call the cart.php script automatically, and sending the necessary post variables with it?

thanks in advance !

Link to comment
Share on other sites

Thanks for your reply.

In the end I modified the cart.php script, so I could include it, and only used the parameters I was sending...

I know this is not completely the right way to do it, but I really know nothing about JavaScript, so that was a direction I didn't want to take.

Anyway got it working now !

Link to comment
Share on other sites

  • 4 months later...
Thanks for your reply.

In the end I modified the cart.php script, so I could include it, and only used the parameters I was sending...

I know this is not completely the right way to do it, but I really know nothing about JavaScript, so that was a direction I didn't want to take.

Anyway got it working now !


Any chance you can post your solution for others trying to inject products into the cart?
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...