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
  #1  
Old 03-31-2014, 07:46 PM
John Haycock's Avatar
John Haycock is offline
Junior Member
 
Join Date: Mar 2014
Posts: 4
Default


Hi all

I'm experimenting with the product and javascript api using the test store id 1003

I'm trying to use the javascript api to add an item to the bag. It adds the item to the bag fine and the quantity but it isnt adding any options.

Here is the javascript I'm using. Please note that productID, quantity and choice are all javascript variables that contain the necessary values. I have checked and the choice variable is definitely being populated with the product size, so either (s, m, l, xl etc ) the correct product and quantity are added to the bag but the size always remains "s" no matter what the value of choice is

product = new Object();

product = {
id: productID,
quantity: quantity,
options: {
optionname: choice

},

callback: function (success, product, cart) {
// ...
}
}
Ecwid.Cart.addProduct(product);

Hope this makes sense. Please let me know if you need more details.

If I can crack this I'm going to be one very happy bunny

J

PS optionname is also a variable. In this case its value is "Size"

Last edited by Viktor D.; 04-01-2014 at 06:12 AM.
  #2  
Old 04-03-2014, 01:40 PM
Corwin's Avatar
Corwin Corwin is offline
Ecwid Team
 
Join Date: Jan 2014
Posts: 310
Default

Quote:
Originally Posted by John Haycock View Post
Hi all

I'm experimenting with the product and javascript api using the test store id 1003

I'm trying to use the javascript api to add an item to the bag. It adds the item to the bag fine and the quantity but it isnt adding any options.

Here is the javascript I'm using. Please note that productID, quantity and choice are all javascript variables that contain the necessary values. I have checked and the choice variable is definitely being populated with the product size, so either (s, m, l, xl etc ) the correct product and quantity are added to the bag but the size always remains "s" no matter what the value of choice is

product = new Object();

product = {
id: productID,
quantity: quantity,
options: {
optionname: choice

},

callback: function (success, product, cart) {
// ...
}
}
Ecwid.Cart.addProduct(product);

Hope this makes sense. Please let me know if you need more details.

If I can crack this I'm going to be one very happy bunny

J

PS optionname is also a variable. In this case its value is "Size"
Sorry for keeping you waiting for a reply. The code itself is correct, the real reason why the product is being added to the shopping basket with the base product option is that our Javascript API currently supports only text and date types for "options" property.

We are working on improving our Javascript API (it's in testing stage at the moment) and the updated version will support drop-down and radio-buttons product options types.
__________________
Bulat F.,
Ecwid Team

help portal
  #3  
Old 04-09-2014, 02:52 PM
John Haycock's Avatar
John Haycock John Haycock is offline
Junior Member
 
Join Date: Mar 2014
Posts: 4
Default

Hi Corwin thanks for getting back on this. I appreciate how busy you guys are.

I tried with static code, Size : "M" and that didn't work either.

I'll keep a look out for the update

Thanks

John
  #4  
Old 05-16-2014, 08:31 PM
Brandon Comerford's Avatar
Brandon Comerford Brandon Comerford is offline
 
Join Date: Sep 2013
Posts: 2
Default

Any update on when select/radio fields will be included?
  #5  
Old 05-19-2014, 08:31 AM
Corwin's Avatar
Corwin Corwin is offline
Ecwid Team
 
Join Date: Jan 2014
Posts: 310
Default

Quote:
Originally Posted by Service Account View Post
Any update on when select/radio fields will be included?
This improvement is being worked on and while we don't have an ETA for it's release it should be available soon. I will post an update into this thread as soon as Ecwid release with this improvement rolls out.
__________________
Bulat F.,
Ecwid Team

help portal
  #6  
Old 07-07-2014, 08:43 PM
Weir Crafts's Avatar
Weir Crafts Weir Crafts is offline
 
Join Date: Jun 2014
Posts: 3
Default

Hi,

We are new to Ecwid and working on converting our current cart system. We have a few pages that could use radio/select fields through the javascript API as described above. I realize that you probably can't give us a release date, but it would be nice to get a sense of if soon means in a few weeks or few months?

Thanks!
  #7  
Old 07-30-2014, 01:38 PM
Viktor D.'s Avatar
Viktor D. Viktor D. is offline
 
Join Date: Nov 2013
Posts: 720
Default

Quote:
Originally Posted by ___37816 View Post
Hi,

We are new to Ecwid and working on converting our current cart system. We have a few pages that could use radio/select fields through the javascript API as described above. I realize that you probably can't give us a release date, but it would be nice to get a sense of if soon means in a few weeks or few months?

Thanks!
Thank you for the update.

API v3 is in a closed beta testing currently.

If you would like to take part in API v3 beta testing, let me know. I’ll forward your request to the responsible person.

Look forward to hearing from you.

Best wishes.
  #8  
Old 08-18-2014, 03:19 PM
Weir Crafts's Avatar
Weir Crafts Weir Crafts is offline
 
Join Date: Jun 2014
Posts: 3
Default

Hi Viktor,

Sorry for the delay - if beta-testing is still an option, we would like to participate.

Thank you!
  #9  
Old 08-22-2014, 12:15 PM
Viktor D.'s Avatar
Viktor D. Viktor D. is offline
 
Join Date: Nov 2013
Posts: 720
Default

Quote:
Originally Posted by Weir Crafts View Post
Hi Viktor,

Sorry for the delay - if beta-testing is still an option, we would like to participate.

Thank you!
Thank you for the message.

I've forwarded your request to the responsible persons.

We will contact you via email. Best wishes!
  #10  
Old 08-22-2014, 05:06 PM
Matt Ecwid's Avatar
Matt Ecwid Matt Ecwid is offline
Ecwid Team
 
Join Date: Oct 2011
Posts: 4,947
Default

Hello,

JavaScript API "Add product" method now supports selectable options (radio buttons, dropdowns, checkboxes). See example here: http://kb.ecwid.com/w/page/41188517/...CartaddProduct

Thank you for your patience.
__________________
Matt K
Ecwid Team

Ecwid Guide for Beginners

Ecwid Help Center

Ecwid video tutorials
 
The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Tags
add to cart, addproduct, javascript api, options

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 04:54 PM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.