// Fixed most viewed conversion rate

This commit is contained in:
Damien Metzger committed 2013-09-12 18:24:18 +02:00
1 parent 26babfc8f9
commit f20a3eb9b5
1 file changed
+9 -9
+9 -9
View File
@@ -257,34 +257,34 @@ class Dashproducts extends Module
'id' => 'product', 'id' => 'product',
'value' => '<img src="..'._PS_TMP_IMG_.'product_mini_'.(int)$product_obj->id.'.jpg'.'" />', 'value' => '<img src="..'._PS_TMP_IMG_.'product_mini_'.(int)$product_obj->id.'.jpg'.'" />',
'class' => 'text-center', 'class' => 'text-center',
); );
$tr[] = array( $tr[] = array(
'id' => 'product', 'id' => 'product',
'value' => Tools::htmlentitiesUTF8($product_obj->name).'<br/>'.Tools::displayPrice(Product::getPriceStatic((int)$product_obj->id)), 'value' => Tools::htmlentitiesUTF8($product_obj->name).'<br/>'.Tools::displayPrice(Product::getPriceStatic((int)$product_obj->id)),
'class' => 'text-center', 'class' => 'text-center',
); );
$tr[] = array( $tr[] = array(
'id' => 'views', 'id' => 'views',
'value' => $product['counter'], 'value' => $product['counter'],
'class' => 'text-center', 'class' => 'text-center',
); );
$added_cart = $this->getTotalProductAddedCart($date_from, $date_to, (int)$product_obj->id); $added_cart = $this->getTotalProductAddedCart($date_from, $date_to, (int)$product_obj->id);
$tr[] = array( $tr[] = array(
'id' => 'added_to_cart', 'id' => 'added_to_cart',
'value' => $added_cart, 'value' => $added_cart,
'class' => 'text-center', 'class' => 'text-center',
); );
$purchased = $this->getTotalProductPurchased($date_from, $date_to, (int)$product_obj->id); $purchased = $this->getTotalProductPurchased($date_from, $date_to, (int)$product_obj->id);
$tr[] = array( $tr[] = array(
'id' => 'purchased', 'id' => 'purchased',
'value' => $this->getTotalProductPurchased($date_from, $date_to, (int)$product_obj->id), 'value' => $this->getTotalProductPurchased($date_from, $date_to, (int)$product_obj->id),
'class' => 'text-center', 'class' => 'text-center',
); );
$tr[] = array( $tr[] = array(
'id' => 'rate', 'id' => 'rate',
'value' => (!$purchased ? '-' : ($added_cart*100)/$purchased.'%'), 'value' => ($product['counter'] ? round(100 * $purchased / $product['counter'], 1).'%' : '-'),
'class' => 'text-center', 'class' => 'text-center',
); );
$body[] = $tr; $body[] = $tr;
} }