Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Adding Item To Cart Via Api Rate Topic   - - - - -

 
  • bahcaci
  • Junior Member
  • Members
  • Join Date: 01-Apr 08
  • 14 posts

Posted 18 April 2016 - 03:04 PM #1

Is it possible to add product to cart with API? I am trying to integrate a system with CS-Cart.  User can add product to his cart without visiting shopping cart site.



 
  • Vivek Gupta
  • Senior Member
  • Members
  • Join Date: 09-Jul 15
  • 247 posts

Posted 18 April 2016 - 07:19 PM #2

Yes , add to cart possible with api , but by defaul at not available in cscart , additional code required for this .

 

http://docs.cs-cart....ties/carts.html


Vivek Gupta 
 


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11249 posts

Posted 18 April 2016 - 08:35 PM #3

Actually carts are tied to sessions so if user doesn't have an account (where it can then be tied to user_id but you'd never know what it is remotely) then when the user comes to the site, it will be there if they have the same session id as the cart was created in, otherwise it will not be visible to them.

 

We have a very old (but still works) free snippet that can be used by remote sites to add items to a cart and either take the customer to the cart or directly to checkout.  You can also apply a coupon code to the cart if you know it.

 

The snippet is located at: http://ez-ms.com/pri...out.pre.php.txt

 

Example for adding quantity 3 of a product with product_code ABC and coupon code XYZ to a cart and taking the user directly to checkout would be:

http://yourdomain.com?dispatch=checkout.remote_checkout.ABC.3&c_code=XYZ

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • bahcaci
  • Junior Member
  • Members
  • Join Date: 01-Apr 08
  • 14 posts

Posted 18 April 2016 - 11:10 PM #4

 

Actually carts are tied to sessions so if user doesn't have an account (where it can then be tied to user_id but you'd never know what it is remotely) then when the user comes to the site, it will be there if they have the same session id as the cart was created in, otherwise it will not be visible to them.

 

We have a very old (but still works) free snippet that can be used by remote sites to add items to a cart and either take the customer to the cart or directly to checkout.  You can also apply a coupon code to the cart if you know it.

 

The snippet is located at: http://ez-ms.com/pri...out.pre.php.txt

 

Example for adding quantity 3 of a product with product_code ABC and coupon code XYZ to a cart and taking the user directly to checkout would be:

http://yourdomain.com?dispatch=checkout.remote_checkout.ABC.3&c_code=XYZ

 

 

Thank you for your response. I could not open snippet link.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11249 posts

Posted 19 April 2016 - 08:10 AM #5

Try using: http://ez-ms.com/pri...heckout.pre.tgz

 

Something doesn't seem to like .php in the filename anywhere


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • bahcaci
  • Junior Member
  • Members
  • Join Date: 01-Apr 08
  • 14 posts

Posted 19 April 2016 - 06:57 PM #6

Try using: http://ez-ms.com/pri...heckout.pre.tgz

 

Something doesn't seem to like .php in the filename anywhere

 

Thank you. I guess I can handle this issue with AJAX request.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11249 posts

Posted 19 April 2016 - 07:24 PM #7

Probably not since AJAX will probably not have session id associated with it.  So it may be in a cscart_sessions table, but there will be no way to associate the user to the session once they get to the cart.

 

Good luck.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.