Post by bzark » Fri Dec 09, 2016 3:41 am

My store sells phone and wireless plans. I have a 3rd party retailer that sells the phone with three months free service. When the buyer receives the phone they go to my store website and enters the IMEI # to apply the promo. This is all working.

What I want to do is place an order using PHP code so the promotion shows up in their order history. I can create a promo product in the catalog but what I would like help with is what is the easiest way to add an order from PHP code without having the customer go through the checkout process?

New member

Posts

Joined
Wed Oct 01, 2014 10:32 pm

Post by rjcalifornia » Fri Dec 09, 2016 5:14 am

So as soon as they enter the promo code, you want OpenCart to automatically set the order without checkout?

Image


Active Member

Posts

Joined
Fri Sep 02, 2011 1:19 pm
Location - Worldwide

Post by thekrotek » Fri Dec 09, 2016 9:26 pm

You can do this, of course. You can try to do this by strictly passing some data to addOrder() function in model/checkout/order.php file. If you can read PHP code, just look into this function and see, which data is required. Then just find the event, where customer enter the IMEI, and call this function after.

But again, you need to know some programming for that.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by bzark » Sat Dec 10, 2016 1:50 am

rjcalifornia wrote:So as soon as they enter the promo code, you want OpenCart to automatically set the order without checkout?
Exactly, I see the addOrder() function and is all that I need to call or are there other functions that need to be called prior to that? And do you are anyone else have example code? I am comfortable with the PHP language so I can figure it out but just trying to maybe leverage of existing code if somebody has it.

New member

Posts

Joined
Wed Oct 01, 2014 10:32 pm
Who is online

Users browsing this forum: gerstavros and 28 guests