- Posts: 32
- Thank you received: 1
Erreur lorsqu'on vide le panier
13 years 1 month ago - 13 years 1 month ago #120963
by cdp-nc
Erreur lorsqu'on vide le panier was created by cdp-nc
Bonjour,
Lorsqu'un client annule un article dans le panier, si ce dernier se retrouve vide, il a droit à ces messages :
Notice: Trying to get property of non-object in C:\Program Files\EasyPHP-5.3.9\www\siteCDP\administrator\components\com_hikashop\classes\shipping.php on line 261
Notice: Trying to get property of non-object in C:\Program Files\EasyPHP-5.3.9\www\siteCDP\administrator\components\com_hikashop\classes\shipping.php on line 261
Notice: Trying to get property of non-object in C:\Program Files\EasyPHP-5.3.9\www\siteCDP\administrator\components\com_hikashop\classes\shipping.php on line 265
Notice: Trying to get property of non-object in C:\Program Files\EasyPHP-5.3.9\www\siteCDP\administrator\components\com_hikashop\classes\shipping.php on line 265
Notice: Trying to get property of non-object in C:\Program Files\EasyPHP-5.3.9\www\siteCDP\administrator\components\com_hikashop\classes\shipping.php on line 90
Notice: Trying to get property of non-object in C:\Program Files\EasyPHP-5.3.9\www\siteCDP\administrator\components\com_hikashop\classes\shipping.php on line 90
Warning: Invalid argument supplied for foreach() in C:\Program Files\EasyPHP-5.3.9\www\siteCDP\administrator\components\com_hikashop\classes\shipping.php on line 406
(j'ai installé la dernière version ce matin : You have the latest stable version of HikaShop Starter: 2.2.1
mais ça le faisait aussi avec la précédente).
Lorsqu'un client annule un article dans le panier, si ce dernier se retrouve vide, il a droit à ces messages :
Notice: Trying to get property of non-object in C:\Program Files\EasyPHP-5.3.9\www\siteCDP\administrator\components\com_hikashop\classes\shipping.php on line 261
Notice: Trying to get property of non-object in C:\Program Files\EasyPHP-5.3.9\www\siteCDP\administrator\components\com_hikashop\classes\shipping.php on line 261
Notice: Trying to get property of non-object in C:\Program Files\EasyPHP-5.3.9\www\siteCDP\administrator\components\com_hikashop\classes\shipping.php on line 265
Notice: Trying to get property of non-object in C:\Program Files\EasyPHP-5.3.9\www\siteCDP\administrator\components\com_hikashop\classes\shipping.php on line 265
Notice: Trying to get property of non-object in C:\Program Files\EasyPHP-5.3.9\www\siteCDP\administrator\components\com_hikashop\classes\shipping.php on line 90
Notice: Trying to get property of non-object in C:\Program Files\EasyPHP-5.3.9\www\siteCDP\administrator\components\com_hikashop\classes\shipping.php on line 90
Warning: Invalid argument supplied for foreach() in C:\Program Files\EasyPHP-5.3.9\www\siteCDP\administrator\components\com_hikashop\classes\shipping.php on line 406
(j'ai installé la dernière version ce matin : You have the latest stable version of HikaShop Starter: 2.2.1
mais ça le faisait aussi avec la précédente).
Last edit: 13 years 1 month ago by cdp-nc.
Please Log in or Create an account to join the conversation.
13 years 1 month ago #120994
by Eliot
Replied by Eliot on topic Erreur lorsqu'on vide le panier
Bonjour,
Pourriez vous poster le code qui se trouve autour des lignes indiquées?
Pourriez vous poster le code qui se trouve autour des lignes indiquées?
Please Log in or Create an account to join the conversation.
13 years 1 month ago - 13 years 1 month ago #121143
by cdp-nc
Replied by cdp-nc on topic Erreur lorsqu'on vide le panier
Bonjour,
(très surpris par votre question, ce code est le source, donc dispo sur n'importe quelle installation)
(très surpris par votre question, ce code est le source, donc dispo sur n'importe quelle installation)
Code:
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;
}
Last edit: 13 years 1 month ago by Jerome.
Please Log in or Create an account to join the conversation.
13 years 1 month ago #121162
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Erreur lorsqu'on vide le panier
Hi,
You can forget the message of Eliot.
Thanks for the report, we will remove this warnings.
Regards,
You can forget the message of Eliot.
Thanks for the report, we will remove this warnings.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Time to create page: 0.166 seconds