News:

AbanteCart v1.4.2 is released.

Main Menu

formatting for options using API

Started by pyroxide, June 03, 2015, 03:28:34 PM

Previous topic - Next topic

pyroxide

currently developing an app as a front-end of my shopping cart. how am i supposed to format the options when adding an item to the customer's cart (rt=a/checkout/cart)?

eCommerce Core

You need to add 'option' : {} to your post

To know format and values you can first run a/product/product to get product options.

Check this example:
https://github.com/abantecart/testing_tools/blob/master/test_api.php

Or demo:
http://demo.abantecart.com/test_api.php


"If you're in the luckiest one per cent of humanity, you owe it to the rest of humanity to think about the other 99 per cent."
― Warren Buffett

pyroxide

#2
aha! i found the solution. the format is multiple instances of option[ID]=VALUE . i had to look at the method params in the api test to find that out. never knew that such a page existed. it was very helpful.

in C# i'm using the following:

for (int i=0; i<options.Count; i++)
{
   frmProduct.AddField("option[" + options[i].ToString() + ']', optionValues[i].ToString());
}

where options and optionValues are both instances of System.Collections.ArrayList

Forum Rules Code of conduct
AbanteCart.com 2010 -