Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How does osC add products to a cart?


Azhar

Recommended Posts

I am modifying my setup of osCommerce heavily for it to suit my products, etc and would like to know how products are added to a users shopping cart in osCommerce. For example, in most packages, to insert something in the users cart they would have to click on a link, for example "addproducttocart.php?product_id=49". Although in osC, when I look at the source it shows the "In Cart" button on the product_info page as a form button, although with no form header, at least nothing I've spotted.

 

So, for one of my scripts I require, for example, product 49 in the catalog to be inserted into the users cart without them having to click on an "Add to cart" button. How would I do this?

 

Any help greatly appreciated.

Link to comment
Share on other sites

Right, ok but I still cannot figure out what code I will have to insert into my PHP file in order to allow a product ID (lets say $ddmcatalogid) to be added to the cart automatically. I have tried the code below although it does not work:

 

$cart->cart->add_cart($ddmcatalogid, $cart->get_quantity($ddmcatalogid)+1);

 

Any suggestions?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...