correction productaccessories

This commit is contained in:
ToutPratique 2016-07-20 11:14:56 +02:00
parent 95fa1dcd26
commit 8ea468bcea
5 changed files with 4 additions and 4 deletions

View File

@ -67,6 +67,7 @@ class ProductAccessories extends Module
$label = 'Vous aimerez peut être aussi';
$products = $cart->getProducts();
$productsId = array_column($products, 'id_product');
$accessories = array();
@ -78,11 +79,11 @@ class ProductAccessories extends Module
}
$accessories = array_unique($accessories, SORT_REGULAR);
$randAccessories = array_rand($accessories, 3);
shuffle($accessories);
$randAccessories = array_slice($accessories, 0, 3);
$showAccessories = [];
foreach ($randAccessories as $key) {
foreach ($randAccessories as $key => $randAccessory) {
$product = new Product($accessories[$key]['id_product'], $context->language->id, $context->shop);
$product->id_product_attribute = 0;
@ -93,7 +94,6 @@ class ProductAccessories extends Module
$row['image_url'] =$this->getImage($product);
$row['features'] = self::getFrontFeaturesStatic($context->language->id, $product->id, self::FEATURE_ID);
$accessory = Product::getProductProperties($context->language->id, $row, $context);
$showAccessories[] = $accessory;

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB