Advertisement
PRidea

Drupal Commerce add to cart stuff

Nov 7th, 2013
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 5.13 KB | None | 0 0
  1. INSERT INTO db2.commerce_line_item (line_item_id, order_id, type, line_item_label, quantity, created, changed, data) VALUES('2', '11', 'product', 'ar445', '1.00', '1383820868', '1383820868', 'a:0:{}');
  2. #all clear here
  3.  
  4. UPDATE db2.commerce_order SET changed = '1383820868' WHERE order_id = '11';
  5. #nothing interesting
  6.  
  7. UPDATE db2.commerce_order_revision SET revision_timestamp = '1383820868' WHERE revision_id = '28';
  8. #nothing interesting
  9.  
  10. INSERT INTO db2.field_data_commerce_display_path (entity_type, bundle, deleted, entity_id, revision_id, language, delta, commerce_display_path_value, commerce_display_path_format) VALUES('commerce_line_item', 'product', '0', '2', '2', 'und', '0', '', NULL);
  11. #what is this table for? Besides delta field, everything is easy to understand.
  12.  
  13.  
  14. INSERT INTO db2.field_data_commerce_line_items (entity_type, bundle, deleted, entity_id, revision_id, language, delta, commerce_line_items_line_item_id) VALUES('commerce_order', 'commerce_order', '0', '11', '28', 'und', '1', '2');
  15. #whoa... nothing understandable, why delta is 1, and what is it for?
  16.  
  17. UPDATE db2.field_data_commerce_order_total SET commerce_order_total_amount = '16000', commerce_order_total_data = 'a:1:{s:10:"components";a:1:{i:0;a:3:{s:4:"name";s:10:"base_price";s:5:"price";a:3:{s:6:"amount";i:16000;s:13:"currency_code";s:3:"RUB";s:4:"data";a:0:{}}s:8:"included";b:1;}}}' WHERE entity_type = 'commerce_order'deleted = '0'entity_id = '11'language = 'und'delta = '0';
  18. #how can I generate this stuff? Or can I just update amounts in field and data array?
  19.  
  20.  
  21. INSERT INTO db2.field_data_commerce_product (entity_type, bundle, deleted, entity_id, revision_id, language, delta, commerce_product_product_id) VALUES('commerce_line_item', 'product', '0', '2', '2', 'und', '0', '12');
  22. #I understand, what is this for, it seems I should get commerce_product_product_id with another mysql call...
  23.  
  24. INSERT INTO db2.field_data_commerce_total (entity_type, bundle, deleted, entity_id, revision_id, language, delta, commerce_total_amount, commerce_total_currency_code, commerce_total_data) VALUES('commerce_line_item', 'product', '0', '2', '2', 'und', '0', '10000', 'RUB', 'a:1:{s:10:"components";a:1:{i:0;a:3:{s:4:"name";s:10:"base_price";s:5:"price";a:3:{s:6:"amount";i:10000;s:13:"currency_code";s:3:"RUB";s:4:"data";a:1:{s:10:"components";a:0:{}}}s:8:"included";b:1;}}}');
  25. #I don't understand that stuff, as the total is totally different O_o
  26.  
  27.  
  28. INSERT INTO db2.field_data_commerce_unit_price (entity_type, bundle, deleted, entity_id, revision_id, language, delta, commerce_unit_price_amount, commerce_unit_price_currency_code, commerce_unit_price_data) VALUES('commerce_line_item', 'product', '0', '2', '2', 'und', '0', '10000', 'RUB', 'a:1:{s:10:"components";a:1:{i:0;a:3:{s:4:"name";s:10:"base_price";s:5:"price";a:3:{s:6:"amount";s:5:"10000";s:13:"currency_code";s:3:"RUB";s:4:"data";a:1:{s:10:"components";a:0:{}}}s:8:"included";b:1;}}}');
  29. #same here, what is that stuff for?
  30.  
  31.  
  32. INSERT INTO db2.field_revision_commerce_display_path (entity_type, bundle, deleted, entity_id, revision_id, language, delta, commerce_display_path_value, commerce_display_path_format) VALUES('commerce_line_item', 'product', '0', '2', '2', 'und', '0', '', NULL);
  33. #same as field_data_commerce_display_path, am i right?
  34.  
  35.  
  36. INSERT INTO db2.field_revision_commerce_line_items (entity_type, bundle, deleted, entity_id, revision_id, language, delta, commerce_line_items_line_item_id) VALUES('commerce_order', 'commerce_order', '0', '11', '28', 'und', '1', '2');
  37. #same as field_data_commerce_line_items
  38.  
  39. UPDATE db2.field_revision_commerce_order_total SET commerce_order_total_amount = '16000', commerce_order_total_data = 'a:1:{s:10:"components";a:1:{i:0;a:3:{s:4:"name";s:10:"base_price";s:5:"price";a:3:{s:6:"amount";i:16000;s:13:"currency_code";s:3:"RUB";s:4:"data";a:0:{}}s:8:"included";b:1;}}}' WHERE entity_type = 'commerce_order'deleted = '0'entity_id = '11'revision_id = '28'language = 'und'delta = '0';
  40. #same
  41.  
  42.  
  43. INSERT INTO db2.field_revision_commerce_product (entity_type, bundle, deleted, entity_id, revision_id, language, delta, commerce_product_product_id) VALUES('commerce_line_item', 'product', '0', '2', '2', 'und', '0', '12');
  44. #same
  45.  
  46. INSERT INTO db2.field_revision_commerce_total (entity_type, bundle, deleted, entity_id, revision_id, language, delta, commerce_total_amount, commerce_total_currency_code, commerce_total_data) VALUES('commerce_line_item', 'product', '0', '2', '2', 'und', '0', '10000', 'RUB', 'a:1:{s:10:"components";a:1:{i:0;a:3:{s:4:"name";s:10:"base_price";s:5:"price";a:3:{s:6:"amount";i:10000;s:13:"currency_code";s:3:"RUB";s:4:"data";a:1:{s:10:"components";a:0:{}}}s:8:"included";b:1;}}}');
  47. #same
  48.  
  49. INSERT INTO db2.field_revision_commerce_unit_price (entity_type, bundle, deleted, entity_id, revision_id, language, delta, commerce_unit_price_amount, commerce_unit_price_currency_code, commerce_unit_price_data) VALUES('commerce_line_item', 'product', '0', '2', '2', 'und', '0', '10000', 'RUB', 'a:1:{s:10:"components";a:1:{i:0;a:3:{s:4:"name";s:10:"base_price";s:5:"price";a:3:{s:6:"amount";s:5:"10000";s:13:"currency_code";s:3:"RUB";s:4:"data";a:1:{s:10:"components";a:0:{}}}s:8:"included";b:1;}}}');
  50. #same
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement