cscart_order_details table


I was looking at ‘cscart_order_details’ table because I’m trying to import old orders from another e-comm shop and I saw this field:


it contains values (numbers) that I can’t explain…but if I try to modify that numbers and check that affected order in admin, I saw that totals and amount are lost… any ideas about it, please?

item_id order_id product_id product_code price amount extra
11276096 702000 1137 TS4GSDMHC 29,87 1 a:2:{s:15:"product_options";a:0:{}s:8:"discount";s:4:"0.00";}
1877798191 702000 1138 TS4GSDHC6 38,58 1 a:2:{s:15:"product_options";a:0:{}s:8:"discount";s:4:"0.00";}
130141017 702000 1133 TS2GUSD 29,87 1 a:2:{s:15:"product_options";a:0:{}s:8:"discount";s:4:"0.00";}


Best Regards


what is this field?

Did you figure it out?

I am integrating amazon AMTU into cs-cart - everything is done except for this field - I thought I knew cs-cart inside out but what the hell is this field?


No, I haven’t found any solution about. I solved upgrading to CS 1.3.5 and importing orders from there…



oh right, thanks

So 1.3.5 doesn’t have this item_id field?

CS-Cart 1.3.5 has an option for importing your old orders: you can find it in import/export menus.


I see - thanks, but the problem for me is that i’m writing a custom php script to dynamically import orders from a SOAP program (AMTU) into cs-cart, so I really need to know how to determine what should go in this field.

Bump :frowning: :confused:

Here’s what I found out

[quote name=‘Maria Saifullina’]

One order can have some items of one product with different options (for instance) therefore, it is required to generate unique IDs for products with different options.

“item_id” is unique IDs for such products (with different options).


That’s great, thanks - makes sense now. – I have started back on this project today, and I think I can sort it now


It looks simple after all.

The solution? Just put 1 in that field. After all, Amazon sales don’t have product options.

I imagined this would screw up the product stock database but so far no adverse effects.


having 1 in this field has caused all sorts of problems

back to the drawing board

I am aware this is an old post but it took me FOREVER to finally track this solution down and thought it might help someone else in the future.

The Item id is generated (as of version 3.0.2) using a function fn_generate_cart_id (from core/fn.cart.php). Simply pass

the product id and the product_opitons array to it to generate a unique item_id.


$item_id = fn_generate_cart_id($product_id, $extra['product_options']);

After all these years… lol