Zen Cart Logo
Forums / Addon Payment Modules / When is the "Orders" table updated?

When is the "Orders" table updated?

Views: 905

Results 1 to 3 of 3
16 Nov 2011, 8:07 PM
#1
arrow avatar

arrow

New Zenner

Join Date:
Nov 2007
Location:
Montreal, Qc
Posts:
51
Plugin Contributions:
0

When is the "Orders" table updated?

Hi guys,

I'm currently installing the Optimal Payments module on my site. It might be secure but I'm not particularly in love with it; it needs quite a few modifications before it does what I want it to do.

My main annoyance right now is that it doesn't keep the credit card type after the transaction* and I need to display it on the checkout success page.

I know which file to change ("optimalpayments.php") but I don't know which function is responsible for putting the data the customer entered into the Orders table. I tried searching for "INSERT INTO TABLE_ORDERS", with no luck. Does Zen-Cart have a specific function that takes care of this?

  • I'm still on Test mode but somehow, I don't think it changes anything.
17 Nov 2011, 3:36 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: When is the "Orders" table updated?

The order class relies on the before_process() method in your payment module's class to set the card-type into the $order object before the order is created by the methods inside the orders class.

For example, this line from the authorizenet_aim module accomplishes that:```
$order->info['cc_type'] = $_POST['cc_type'];


That way the info will be saved into the order record in the database, for retrieval at a later time when needed.
17 Nov 2011, 3:04 PM
#3
arrow avatar

arrow

New Zenner

Join Date:
Nov 2007
Location:
Montreal, Qc
Posts:
51
Plugin Contributions:
0

Re: When is the "Orders" table updated?

That line is there (or at least the equivalent of it) and it's there long enough so that the card type appears during the checkout confirmation page. Once the checkout success page appears though, the card type is nowhere to be found. Should I understand that it's written in the database during before_process() and deleted later in another function? That's annoying... Is an order element always inserted in the database or is it just supposed to happen during before_process()?