Zen Cart Logo
Forums / General Questions / How do I store a variable from the UPS module into the Orders table?

How do I store a variable from the UPS module into the Orders table?

Locked

Views: 900

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
7 Oct 2007, 2:27 AM
#1
mygreygoose avatar

mygreygoose

New Zenner

Join Date:
Jun 2007
Posts:
91
Plugin Contributions:
0

How do I store a variable from the UPS module into the Orders table?

I have a custom variable in the includes\modules\shipping\ups.php module called $shipping_methods_types that contains the available UPS methods (not the chosen method - the available methods). For example, it'll contain: 1DA,2DA,GND.

I want to store that value in a field I've created called shipping_allowed in the orders table.

It looks like the place to insert it is in includes\classes\order.php in the create function through $sql_data_array. I've been able to put in a dummy value in the field by adding this code: $sql_data_array[shipping_allowed] = 1;

My problem is that I don't know how to pass the real value of $shipping_methods_types from the UPS module to the create function.

Anyone have an idea of how I can do that? Thanks for any clues you may be able to pass onto me.

7 Oct 2007, 4:30 AM
#2
mygreygoose avatar

mygreygoose

New Zenner

Join Date:
Jun 2007
Posts:
91
Plugin Contributions:
0

Re: How do I store a variable from the UPS module into the Orders table?

I found a way by using a session variable:

In ups.php:
$_SESSION["shipping_method_types"] = $shipping_methods_types;

In order.php:
'shipping_allowed' => $_SESSION['shipping_method_types'],