1. first of all, I need to create the following custom tables using data from commerce and drupal. How do i achieve this.

customer:
id--------------(from commerce)
name--------------(from commerce)
contact name--------------(from commerce)
billing address--------------(from commerce)
phone--------------(from commerce)
email--------------(from commerce)
customer id in visual, if specified------------------(Custom field)
imported into erp ------------------(Custom field)

order
order id--------------(from commerce)
customer id (links to customer.id)--------------(from commerce)
shipping address (if different from billing address)--------------(from commerce)
contact name/phone/email (if different from customer)--------------(from commerce)
whether credit card was successfully charged, and amount--------------(from commerce)
imported into erp (true/false field that I suggested)------------------(Custom field)

order line
order id (links to order id in table "order")--------------(from commerce)
line number--------------(from commerce)
part id--------------(from commerce)
qty--------------(from commerce)
price (order-specific, may be different from the regular price, such as when discount coupon was used)--------------(from commerce)

Please tell, which columns of which tables have this information.
2. Secondly i need a script that will update this table anytime an order is placed.

Any idea?

Comments

docans’s picture

I have created a github repo at https://github.com/docans/polyscience_order which i am working on. Please feel free to create branches.
Thanks

rahimisafari’s picture

1- i create a content type for each tables(costumer order and etc).

note: for relations i create a OldSystemID field for storing old system records id , because in drupal all content saved in node table and get a new id.

2- import database data with feeds module.
note : import records id to OldSystemID field.

3- all data imported.now i want simulate relations in drupal that there was in old database.
for repaire relations i create a module named "feeds relations repaire" that get primary and forein content types and fix relations between them by using OldSystemID fields.

note , i dont upload "feeds relations repaire" module to drupal site yet.

if you need it , contact me via "rahimisafari@gmail.com".

rszrama’s picture

Status: Active » Closed (won't fix)