News:

Support the VirtueMart project and become a member

Main Menu

Simulate order creation

Started by Khaostar, March 23, 2015, 14:43:51 PM

Previous topic - Next topic

Khaostar

Hi all,

I am facing a little complex situation here and I want to know if anyone have a methopd I could use to save some time.

So, shortly, I'm using a virtumart site wich works great. I have a special need right now that will force me to do a custom script. What I need to do is to create an order in the site without being on the site. Seems strange heh? It's a partnership whitin two companies. A bit complex.

Here is the scenario : a customer go to a site (witch is not a virtuemart site) and bought something very specific. When the customer complete his order, all the informations is sent to my site (virtuemart) in ajax. From here, I need to create an order the same way as if the customer has bought the product on my site. So I need to fill the database with the information such as client name, product, etc. I have all the information needed. So no problem here.

My Question : is there any function in Virtuemart that I can call and send the information and create an oder the same way as if the customer was on my site? I'm pretty sure that there is an easy solution but I can't find it.

For exemple, I would like to be able to do something like that :

orderid = virtuemart_createorder(<list of argument>);

I guess that there is a function somewhere already created. Anyone have a hint for me?

I'm using Joomla 2.5.20 and Virtuemart 2.6.6
And yes, I know that I should upgrade. :)

Thanks in advance for your help! :D