Jump to content

Orders creation on sql


Recommended Posts

The PaymentModule class has a function called validateOrder, which converts the cart to an order.  You will not see any SQL statements there, as Prestashop uses an object oriented data model which handles converted PHP classes to DB records.

 

Now if I understand properly, I would suggest that you create a module that hooks "actionValidateOrder", and then you can sends this data to your warehouse.

 

What that means, is that the module will receive an event anytime a new order is created (aka actionValidateOrder).  then in your module, you handle only the part you need to worry about, which is extracting the order and customer details, parsing that data into a format your data warehouse understands (XML, CSV etc...), and then pushing the data to them (webservice, FTP etc..)

 

If you are looking for a freelancer to do this work for you, send me a PM and we can discuss further.  I would need to understand your data warehouse API (what data they want, and how they want it), before I can provide an estimate

Link to comment
Share on other sites

  • 2 weeks later...

Thanks!

Changed my strategy. I will query the database from external software (search for new orders every hour) and download orders details this way.

Although there is complication as I can not switch off Prestashop from blocking sold items (I don't use advanced warehouse but I still use quantity control)

I removed the lines from Paymentmodule that I initially thought (as they are even named quantity update) that control this behaviour but no effect. 

My interest is how to stop updating column: quantity in stock_available table

If anyone knows the line I would appreciate.

If you are curious (my customers - some 60% make mistakes and buy few times the same product before final payment) If it is last item, that makes it hard, as they call me to remove previous order, put the item back, etc...

Tkanks!

xxx

Eva

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...