Re: Re: Re: Re: You're welcome. 1) You can

Posts: 79
Joined: 10/29/2007
Bug Finder

When I tried to use the save $op from hook_order, it would not save into the order object, so I used the total $op. Here's the query I used to get the latest non blank billing info from the cim and order table and save it with the order.

<?php
if ( $op == 'total' && empty($order->billing_city)  && !empty($order->cim_ppid) ) {

   
$query = "SELECT billing_first_name,billing_last_name,billing_phone,billing_company,billing_street1,
billing_street2,billing_city,billing_zone,billing_postal_code,billing_country from uc_orders inner join uc_payment_cim on uc_payment_cim.order_id = uc_orders.order_id where cim_ppid = $order->cim_ppid and billing_city <> '' and uid = $user->uid order by uc_orders.order_id desc limit 1 "
;
   
$row = db_fetch_object(db_query($query));
$order->billing_postal_code = $row->billing_postal_code;
$order->billing_first_name = $row->billing_first_name;
$order->billing_last_name= $row->billing_last_name;
$order->billing_phone = $row->billing_phone;
$order->billing_company = $row->billing_company;
$order->billing_street1 = $row->billing_street1;
$order->billing_street2 = $row->billing_street2;
$order->billing_city = $row->billing_city;
$order->billing_zone = $row->billing_zone;
$order->billing_postal_code = $row->billing_postal_code;
$order->billing_country = $row->billing_country;

}
?>

Reuse Credit Card By: VitaLife (25 replies) Sun, 04/27/2008 - 11:45