Jump to content

Add Two Products At Once To Cart


Recommended Posts

I have a web page on prestashop at this website want to add to cart two products at a time. attempt will detail exactly what I look for and I've tried several things but still can not get it:


in the shop I offer a number of parts, I created a module in the same product page, shows a series of technical services where you can apply what you ride.


Technical skills have them discharged as product prestashop, and the module in which the show get the id of the product (the idea was with this id to add to cart).


The customer can buy only the parts or service parts and obviously when you just want to buy the parts by clicking on Add to cart works, but I do not know how to do is if you also select a service to add you to cart the parts mounting over that site.


I tried to explain it as best I could, anyway I appreciate the help in advance and sorry for my English

  • Like 1
Link to comment
Share on other sites

If you are able to get id of the products that are needed to add to the cart, then you can do "add to cart" one after the other. Try below code.


<script> $.ajax({
               type: 'POST',
               url: baseUri + '?rand=' + new Date().getTime(),

               data: 'controller=cart&add=1&ajax=true&qty=1'+'&id_product=11',

               success: function(q) {

  • Like 1
Link to comment
Share on other sites

Thank you very much, is very simple and does not know how much I appreciate it.


He had proven a thousand ways and I never thought of something as simple as this.


As demonstrated in this case, sometimes the most effective solution is the easiest.


Really thank you very much

Link to comment
Share on other sites

  • 4 months later...

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...