Michel Jak Posted May 2, 2020 Share Posted May 2, 2020 When i am trying to override the catalog product listing product main_variants data in filterProductSearch hook in prestashop 1.7.6 then i am getting below error. Notice: Indirect modification of overloaded element of PrestaShop\PrestaShop\Adapter\Presenter\Product\ProductListingLazyArray has no effect Here is my code: if (Module::isInstalled($this->name) && Module::isEnabled($this->name)) { if ($params['searchVariables']['products'] && $this->configVals['ATS_SWATCH_IMAGE_CATALOG_ENABLE']) { foreach ($params['searchVariables']['products'] as &$product) { if ($product['main_variants']) { $productObj = new Product($product['id_product'], $product['id_lang']); $combinationImages = $productObj->getCombinationImages($product['id_lang']); foreach ($product['main_variants'] as &$variant) { if (isset($combinationImages[$variant['id_product_attribute']][0]['id_image'])) { $variant['html_color_code'] = ''; $variant['texture'] = $this->context->link->getImageLink( $product['link_rewrite'], $combinationImages[$variant['id_product_attribute']][0]['id_image'], ImageType::getFormattedName('small') ); } } } } } } return $params; This code is working perfectly in prestahop 1.7.3.2 Please help Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now