3
votes

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.

1

1 Answers

2
votes

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.