Hello,
I have this script but I need to add an if, how can I do it?
I tried some times, but with no luck!
if($status=="CONFIRMED_BY_SHOPPER")
{
$shipment = $this->get_shipment($virtuemart_order->virtuemart_shipmentmethod_id);
$order_details= $this->get_order($virtuemart_order->virtuemart_order_id);
$order_details= $order_details['details']['BT'];
$customerName = $order_details->title. " " . $order_details->first_name. " " . $order_details->last_name;
$address = $order_details->address_1. " ".$order_details->address_2;
$state = $this->get_state($order_details->virtuemart_state_id);
$country = $this->get_country($order_details->virtuemart_country_id);
$order_currency= $this->order_currency($order_details->order_currency);
$payment_methord= $this->get_paymentmethod($order_details->virtuemart_paymentmethod_id);
Thanks a lot in advance!
version etc
Plus what are you trying to achieve ?
I need to create the variables (you see in the code) to push them via api to a shipping service.
Everything is working right, in this situation I always push the billing address, but when the shipping address is set I need to push it, not the billing one.
Thanks,
Davide
You have written this function - $this->get_order
I assume this gets the order_userinfo data for this virtuemart_order_id
Check the returned rows
If you get more than one row it indicates that there is an ST address
An address_type of ST indicates the shipping address.
if(issset($order_details['details']['ST'])) $orderDetails = $order_details['details']['ST'];
else $orderDetails = $order_details['details']['BT'];
Note that i changed $order_details to $orderDetails for clarity.
Hi Studio 42, thank you very much, I solved it (isset is written with 3 S in you code :)).
Now it's working, but if I have the ST address, the email is not fetched, how can I retrieve the email address (it's always the same)?
Thanks!
The email belongs to the BT address, Fetch that first or copy it to the ST array.
regards
Jörgen @ Kreativ Fotografi