The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.
Closed Thread
 
Thread Tools Display Modes
  #1  
Old 07-29-2013, 06:49 AM
A Wee ClicK's Avatar
A Wee ClicK is offline
Webpartner
 
Join Date: Aug 2011
Location: UK (Northern Ireland)
Posts: 88
Default

New API to add products to the bag via JavaScript functions


Hi,

Where can we find details of the new add products to the bag API?

Thanks
__________________
Andrew

---------------------------------------------
UtterApparel.com
ASLCreative.com
Zingaboo.com
  #2  
Old 08-06-2013, 08:58 AM
A Wee ClicK's Avatar
A Wee ClicK A Wee ClicK is offline
Webpartner
 
Join Date: Aug 2011
Location: UK (Northern Ireland)
Posts: 88
Default

Anybody have any ideas on how to do this?
__________________
Andrew

---------------------------------------------
UtterApparel.com
ASLCreative.com
Zingaboo.com
  #3  
Old 08-12-2013, 01:53 PM
Qetzal's Avatar
Qetzal Qetzal is offline
Ecwid Team
 
Join Date: Sep 2009
Posts: 10,848
Default

You should use the "Ecwid.Cart.addProduct" JavaScript function. Example:

HTML Code:
var productId = 10;

Ecwid.Cart.addProduct(productId, function() {success, product, cart} {
    console.log(success); // true or false
    console.log(product.name); //added 
});

We will publish the detailed explanation of new JavaScript API methods in our knowledge base soon.
__________________
Eugene K.
Ecwid Team

@ecwid | Facebook | Ecwid Knowledge Base
  #4  
Old 08-18-2013, 07:54 AM
A Wee ClicK's Avatar
A Wee ClicK A Wee ClicK is offline
Webpartner
 
Join Date: Aug 2011
Location: UK (Northern Ireland)
Posts: 88
Default

Hi Eugene,

In that code, where do I add quantity, product options etc?
__________________
Andrew

---------------------------------------------
UtterApparel.com
ASLCreative.com
Zingaboo.com
  #5  
Old 09-06-2013, 07:38 AM
smoothsailingco.com's Avatar
smoothsailingco.com smoothsailingco.com is offline
 
Join Date: Dec 2011
Location: CA / FL
Posts: 345
Default

Wondering about this too. Is there a way to add options to the item going into the bag?
__________________
Smooth Sailing Clothing Co.
  #6  
Old 09-13-2013, 02:10 PM
Richard De Falco's Avatar
Richard De Falco Richard De Falco is offline
Junior Member
 
Join Date: Sep 2013
Posts: 1
Default

Never tried, but see here for complete API doc :

http://kb.ecwid.com/w/page/41188517/...CartaddProduct
  #7  
Old 09-15-2013, 09:23 PM
A Wee ClicK's Avatar
A Wee ClicK A Wee ClicK is offline
Webpartner
 
Join Date: Aug 2011
Location: UK (Northern Ireland)
Posts: 88
Default

My basic test worked first time - BRILLIANT!!!

I have been waiting for this for a very long time - I can now integrate it into product designer script.

Also like the way you can query a customer's shopping cart, meaning one can now monitor what people are putting into their shopping carts and store that info in a database.
__________________
Andrew

---------------------------------------------
UtterApparel.com
ASLCreative.com
Zingaboo.com
  #8  
Old 09-15-2013, 09:26 PM
A Wee ClicK's Avatar
A Wee ClicK A Wee ClicK is offline
Webpartner
 
Join Date: Aug 2011
Location: UK (Northern Ireland)
Posts: 88
Default

One question - how do you upload a file with the cart api?
__________________
Andrew

---------------------------------------------
UtterApparel.com
ASLCreative.com
Zingaboo.com
  #9  
Old 09-16-2013, 11:25 AM
Maya's Avatar
Maya Maya is offline
Ecwid Team
 
Join Date: Feb 2010
Location: Ecwid headquarter
Posts: 5,878
Default

Quote:
Originally Posted by A Wee ClicK View Post
One question - how do you upload a file with the cart api?
Hello Andrew,

Ecwid allows to add product to the cart via API and selected options value for it. Currently following option types are supported: text field and date. Unfortunately, it is not possible to add product with uploaded file to the cart via Javascript API. More details on the supported product options types in the Ecwid.Cart.addProduct API method: http://www.ecwid.com/forums/showthre...4451#post94451

As a workaround, you can ask your customer to upload file in some external storage and send you the link to it. This link can be passed in "text field" option.

Good luck!


UPDATED: modified info about supported products options in Ecwd.Cart.addProduct()
__________________
Maya N., Ecwid Team

------------------
Welcome to our new Help Center!

Last edited by Makfruit; 09-30-2013 at 02:04 PM.
  #10  
Old 09-16-2013, 11:27 AM
A Wee ClicK's Avatar
A Wee ClicK A Wee ClicK is offline
Webpartner
 
Join Date: Aug 2011
Location: UK (Northern Ireland)
Posts: 88
Default

Maya, that is fine - how do I hide that "text field" that contains the file name through the checkout stages?
__________________
Andrew

---------------------------------------------
UtterApparel.com
ASLCreative.com
Zingaboo.com
Closed Thread
The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:47 AM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.