correction productaccessories
This commit is contained in:
parent
95fa1dcd26
commit
8ea468bcea
@ -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;
|
||||
|
BIN
themes/toutpratique/img/picto_abordable.jpg
Normal file
BIN
themes/toutpratique/img/picto_abordable.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
BIN
themes/toutpratique/img/picto_efficace.jpg
Normal file
BIN
themes/toutpratique/img/picto_efficace.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
BIN
themes/toutpratique/img/picto_pratique.jpg
Normal file
BIN
themes/toutpratique/img/picto_pratique.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
BIN
themes/toutpratique/img/picto_respectueux.jpg
Normal file
BIN
themes/toutpratique/img/picto_respectueux.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.1 KiB |
Loading…
Reference in New Issue
Block a user