reseller to customer
This commit is contained in:
@@ -85,12 +85,15 @@ class Wiaas_Checkout {
|
||||
private static function _add_wiaas_checkout_data($order, $data) {
|
||||
// save currency
|
||||
$line_items = $order->get_items();
|
||||
foreach ($line_items as $line_item) {
|
||||
if (isset($line_item['wiaas_currency'])) {
|
||||
$order->set_currency($line_item['wiaas_currency']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$currency = array_column($line_items, 'wiaas_currency')[0];
|
||||
$currency = empty($currency) ? get_woocommerce_currency() : $currency;
|
||||
$order->set_currency($currency);
|
||||
|
||||
// set order commercial lead
|
||||
$commercial_lead_id = array_column($line_items, 'wiaas_commercial_lead_id')[0];
|
||||
$order->add_meta_data('wiaas_commercial_lead_id', $commercial_lead_id, true);
|
||||
$order->save_meta_data();
|
||||
|
||||
// save additional wiaas order info
|
||||
Wiaas_Order::set_order_vat($order->get_id(), $data['vat']);
|
||||
@@ -102,6 +105,7 @@ class Wiaas_Checkout {
|
||||
if (isset($data['project_id'])) {
|
||||
Wiaas_Order_Project::set_project_for_order($order->get_id(), $data['project_id']);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user