Erreur lorsqu'on vide le panier

  • Posts: 32
  • Thank you received: 1
10 years 8 months ago #120963

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).

Last edit: 10 years 8 months ago by cdp-nc.

Please Log in or Create an account to join the conversation.

  • Posts: 2334
  • Thank you received: 403
10 years 8 months ago #120994

Bonjour,

Pourriez vous poster le code qui se trouve autour des lignes indiquées?

Please Log in or Create an account to join the conversation.

  • Posts: 32
  • Thank you received: 1
10 years 8 months ago #121143

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;
		}

Last edit: 10 years 8 months ago by Jerome.

Please Log in or Create an account to join the conversation.

  • Posts: 26029
  • Thank you received: 4006
  • MODERATOR
10 years 8 months ago #121162

Hi,

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.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.074 seconds
Powered by Kunena Forum