AbanteCart Development > API Development

formatting for options using API

(1/1)

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


pyroxide:
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

Navigation

[0] Message Index

Go to full version
Powered by SMFPacks Social Login Mod