Jump to content

fejl i ganalytics modulet efter update


fransjaeger

Recommended Posts

Hej jeg får følgende fejl fra ganalytics modulet
 
WARNING: [pool www] child 27273 said into stderr: "NOTICE: PHP message: PHP Notice:  Undefined index: id_product in ... /modules/ganalytics/ganalytics.php on line 415"
 
Håber nogen kan se hvad der er galt
 
	public function wrapProduct($product, $extras, $index = 0, $full = false)
	{
		$ga_product = '';

		$variant = null;
		if (isset($product['attributes_small']))
			$variant = $product['attributes_small'];
		elseif (isset($extras['attributes_small']))
			$variant = $extras['attributes_small'];

		$product_qty = 1;
		if (isset($extras['qty']))
			$product_qty = $extras['qty'];
		elseif (isset($product['cart_quantity']))
			$product_qty = $product['cart_quantity'];

		if ($full)
		{
			$product_type = 'typical';
			if (isset($product['pack']) && $product['pack'] == 1)
				$product_type = 'pack';
			elseif (isset($product['virtual']) && $product['virtual'] == 1)
				$product_type = 'virtual';

			$ga_product = array(
				'id' => (isset($product['reference']) && !empty($product['reference'])) ? $product['reference'] : $product['id_product'],
				'name' => urlencode($product['name']),
				'category' => $product['category'],
				'brand' => isset($product['manufacturer_name']) ? $product['manufacturer_name'] : '',
				'variant' => $variant,
				'type' => $product_type,
				'position' => $index ? $index : '0',
				'quantity' => $product_qty,
				'list' => Tools::getValue('controller'),
				'url' => isset($product['link']) ? $product['link'] : '',
				'price' => number_format($product['price'], '2')
			);
		}

		return $ga_product;
	}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...