Forums / Contribution-Writing Guidelines / Creating Manual Entry page for offsite Orders

Creating Manual Entry page for offsite Orders

Views: 1,848

Results 1 to 4 of 4
21 Aug 2012, 7:29 PM
#1
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
732
Plugin Contributions:
0

Creating Manual Entry page for offsite Orders

Hey Dr Byte and Team!

I am trying to create a plug-in so that users who sell on Amazon can easily import their orders into the ZenCart database. I basically will have a CSV file from Amazon with all the order information, but I am stuck on the actual MySQL commands to INSERT a new record into the database.

For example, if I were to just create an INSERT INTO ORDERS command, that puts a record in there, but it still can't be seen in the admin panel.

So is it possible to respond with the actual COMMAND to insert a generic order to a customer account? Or at the very least, let me know what tables need to be updated for an order to be successfully attached to a customer. I know the Orders table needs a record, and I'm sure the Orders_Products and Orders_Total tables. Anything else?

And to keep this simple, I am NOT worrying about attributes, downloadable items, etc. I just want to start off by creating a dummy test PHP page where I can copy/paste the customer shipping address, product purchased, and shipping paid, and when submitted, I run the MySQL command to insert the order into a preexisting customer in our store.

I would really appreciate any feedback you can give me on this!

  • Jeff
21 Aug 2012, 10:40 PM
#2
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
732
Plugin Contributions:
0

Re: Creating Manual Entry page for offsite Orders

For the record, I am inserting a record in the following tables:

  • Orders
  • Orders_Products
  • Orders_Total
  • Orders_Status_History

Each record points to the same Order ID, and yet, I still cannot get the Admin Console to be able to VIEW and open the order.

What other table am I not updating which could be causing that?

  • Jeff
21 Aug 2012, 11:03 PM
#3
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
732
Plugin Contributions:
0

Re: Creating Manual Entry page for offsite Orders

Nevermind. I think I got it. :)

  • Jeff
23 Aug 2012, 1:23 AM
#4
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Creating Manual Entry page for offsite Orders

Don't you also need to insert into the customers table for the customer info? Please, share what you have done once you have it worked out. I know that there are many users here that could benefit from this!


Zen Cart and it's community are the best!!