Reputation: 3126
I need to pass item id through checkout on custom form. Here is item add
<div class="simpleCart_shelfItem">
<div class="ju_cntr" style="width:350px">
<input type="hidden" class="item_id" name='tratata' value="asfd2">
<div class="juice_hd item_name" style="width:350px">
test2
</div>
<div class="juice_pic" style="width:350px">
<img class="item_thumb item_image item_add" src="/images/upload/9174.jpg"/>
</div>
<div class="juice_txt">
<span class="item_price">$123.00</span><input type="text" value="1" class="item_Quantity"><a class="item_add" href="javascript:;"> Add to Cart </a>
</div>
</div>
</div>
and result on checkout
Array
(
[currency] => USD
[shipping] => 0
[tax] => 0
[taxRate] => 0
[itemCount] => 2
[item_name_1] =>
123
[item_quantity_1] => 7
[item_price_1] => 123
[item_options_1] =>
[item_name_2] =>
test2
[item_quantity_2] => 6
[item_price_2] => 123
[item_options_2] =>
)
Does anybody know how can I do that? Thanks!
Here is documentation http://simplecartjs.org/documentation/
Upvotes: 0
Views: 400
Reputation: 353
Actually, the additional item data is passed inside the item_options_n element.
So in your case it should be:
[item_name_1] =>
123
[item_quantity_1] => 7
[item_price_1] => 123
[item_options_1] =>
[item_name_2] => id: <your_id_here>
test2
[item_quantity_2] => 6
[item_price_2] => 123
[item_options_2] => id: <your_id_here>
If not, may be it doesn't grab the values from form elements. In that case you would have to get them manually.
Upvotes: 1