From b3e65fd15a1a5c6a08d747b496490e220f3ff195 Mon Sep 17 00:00:00 2001 From: Mark Thiebaut Date: Wed, 6 Apr 2022 23:18:06 +0200 Subject: [PATCH] Search getFirstProduct start to 0 In the function getProducts, change the second param "start" of the prestashop Product::getProducts(...) to 0 instead of 1. Try to have only one product in you shop store, and you will get an error. For the moment, with start 1, you will get the second element, and not the first. --- Trustpilot/viewLoader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Trustpilot/viewLoader.php b/Trustpilot/viewLoader.php index 6bbea92..ca7f3d9 100644 --- a/Trustpilot/viewLoader.php +++ b/Trustpilot/viewLoader.php @@ -110,7 +110,7 @@ public function getCustomTrustBoxes() public function getFirstProduct() { $lang = $this->getLanguageId(); - $products = Product::getProducts($lang, 1, 1, 'id_product', 'ASC', false, true); + $products = Product::getProducts($lang, 0, 1, 'id_product', 'ASC', false, true); $firstProduct = $products[0]; $product_id = $firstProduct['id_product']; $product = new Product($product_id, false, $lang);