Bonjour,
(très surpris par votre question, ce code est le source, donc dispo sur n'importe quelle installation)
function getShippingProductsData(&$order, $products = array()) {
if(empty($order->shipping_prices)) {
$order->shipping_prices = array();
}
if(!isset($order->shipping_prices[0])) {
$order->shipping_prices[0] = new stdClass();
$order->shipping_prices[0]->all_with_tax = $order->total->prices[0]->price_value_with_tax;
if(isset($order->full_total->prices[0]->price_value_without_shipping_with_tax)) {
$order->shipping_prices[0]->all_with_tax = $order->full_total->prices[0]->price_value_without_shipping_with_tax;
}
$order->shipping_prices[0]->all_without_tax = $order->total->prices[0]->price_value;
if(isset($order->full_total->prices[0]->price_value_without_shipping)) {
$order->shipping_prices[0]->all_without_tax = $order->full_total->prices[0]->price_value_without_shipping;
}
$order->shipping_prices[0]->weight = $order->weight;
$order->shipping_prices[0]->volume = $order->volume;
$order->shipping_prices[0]->total_quantity = $order->total_quantity;
}
function getMethods(&$order){
$pluginClass = hikashop_get('class.plugins');
$rates = $pluginClass->getMethods('shipping');
if(bccomp($order->total->prices[0]->price_value,0,5) && !empty($rates)){
$currencyClass = hikashop_get('class.currency');
$currencyClass->convertShippings($rates);
}
return $rates;
}
function &getShippingGroups(&$order, &$rates) {
if(!empty($order->shipping_groups))
return $order->shipping_groups;
$shipping_groups = array();
$warehouse = new stdClass();
$warehouse->name = '';
$warehouse->products = array();
$warehouse->shippings = array();
$shipping_groups[0] = $warehouse;
foreach($order->products as &$product) {
if($product->cart_product_quantity <= 0)
continue;
if(!empty($product->product_warehouse)) {
if(!isset($shipping_groups[$product->product_warehouse])) {
$w = new stdClass();
$w->name = '';
$w->products = array();
$w->shippings = array();
$shipping_groups[$product->product_warehouse] = $w;
}
$shipping_groups[$product->product_warehouse]->products[] =& $product;
} else
$shipping_groups[0]->products[] =& $product;
}