3

I am building a web application which allows visitors of a site to custom-build a product, and then add that custom-built item to their shopping cart in order to purchase it. For instance, I might build a car with the following customizations:

  • Alloy wheels
  • Leather seats
  • Red

I've searched around looking for a solution to my problem, but have yet to come across anything very helpful. I am using CS-Cart as my shopping cart solution.

What I need to know is how I might programmatically add this custom-built item to a user's shopping cart. Does CS-Cart provide an API for doing something like this? If not, does anyone have any suggestions on how I might achieve my goal? I basically just need to add a generic "custom build" item to the user's cart with the customizations they made somehow attached to this item.

Alix Axel
  • 151,645
  • 95
  • 393
  • 500
Jon Mooring
  • 151
  • 2
  • 13

1 Answers1

2

I've been taking a look at CS-Cart and this question came up.

From reading through the CS-Cart API documentation, it looks like CS-Cart's API is more of a plugin framework than an actual web service. In other words, I believe you can write code to modify CS-Cart (or programmatically update shopping cart items) but this code needs to be written as a plugin into CS-Cart rather than simply as an API call from your third-party webapp.

So I think you have two solutions:

  1. Build a CS-Cart plugin which has a mini-API to take your custom item from your webapp and add it into the shopping cart through CS-Cart
  2. If you literally just need to add the item into the shopping cart, and your webapp and CS-Cart are on the same server, you may be able to skirt around CS-Cart and get your webapp to literally just add the item into CS-Cart's shopping cart PHP session

I hope this helps - I'm not mega-familiar with CS-Cart so if there are any factual errors in this I apologise.

Alex Dean
  • 15,575
  • 13
  • 63
  • 74
  • This sounds right from what I've read about the CS-Cart API. Thank you for taking the time to formulate this response. – Jon Mooring Aug 09 '11 at 15:27
  • No problem Jon, happy to help! – Alex Dean Aug 09 '11 at 18:52
  • I stumbled accross this question while looking for other CS Cart stuff. Just for the record, the newcoming CS-Cart 4.x release is the first to implement a real API (actually a RESTful one). – Luke404 Jun 17 '13 at 23:36