zutnyik Posted December 6, 2015 Share Posted December 6, 2015 Hi. If I enable the file system cache in my prestashop configuration, on the front-end just one category appears. For each and every category the same products are appearing. I am on shared hosting so i cannot activate another type of caching. Can I debug this somehow, or what the problem might be? Thank you! Link to comment Share on other sites More sharing options...
zutnyik Posted December 7, 2015 Author Share Posted December 7, 2015 Anyone can help me with this one please !? Thanks! Link to comment Share on other sites More sharing options...
zutnyik Posted December 10, 2015 Author Share Posted December 10, 2015 Please !!?? Link to comment Share on other sites More sharing options...
musaakbulut Posted December 11, 2015 Share Posted December 11, 2015 Same problem.. any solution? Link to comment Share on other sites More sharing options...
markych Posted December 18, 2015 Share Posted December 18, 2015 (edited) Hi, that is because of several queries in blocklayered return sama data from the cache. Quick fix is to force these queries not to use cache: blocklayered.php: public function getProductByFilters($selected_filters = array()): { .... // $this->nbr_products = Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'cat_filter_restriction'); <---- this line needs to be changed $this->nbr_products = Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'cat_filter_restriction', false); .... $this->products = Db::getInstance()->executeS(' SELECT p.*, '.($alias_where == 'p' ? '' : 'product_shop.*,' ).' '.$alias_where.'.id_category_default, pl.*, image_shop.`id_image` id_image, il.legend, m.name manufacturer_name, '.(Combination::isFeatureActive() ? 'product_attribute_shop.id_product_attribute id_product_attribute,' : '').' DATEDIFF('.$alias_where.'.`date_add`, DATE_SUB("'.date('Y-m-d').' 00:00:00", INTERVAL '.(int)$nb_day_new_product.' DAY)) > 0 AS new, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity'.(Combination::isFeatureActive() ? ', product_attribute_shop.minimal_quantity AS product_att FROM '._DB_PREFIX_.'cat_filter_restriction cp LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = cp.`id_product` '.Shop::addSqlAssociation('product', 'p'). (Combination::isFeatureActive() ? ' LEFT JOIN `'._DB_PREFIX_.'product_attribute_shop` product_attribute_shop ON (p.`id_product` = product_attribute_shop.`id_product` AND product_attribute_shop.`default_on` = 1 AND product_attribute_shop.id_shop='.(int)$contex LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').' AND pl.id_lang = '.(int)$cookie->id_lang.') LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop='.(int)$context->shop->id.') LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$cookie->id_lang.') LEFT JOIN '._DB_PREFIX_.'manufacturer m ON (m.id_manufacturer = p.id_manufacturer) '.Product::sqlStock('p', 0).' WHERE '.$alias_where.'.`active` = 1 AND '.$alias_where.'.`visibility` IN ("both", "catalog") ORDER BY '.Tools::getProductsOrder('by', Tools::getValue('orderby'), true).' '.Tools::getProductsOrder('way', Tools::getValue('orderway')).' , cp.id_product'. // ' LIMIT '.(((int)$this->page - 1) * $n.','.$n)); <-------------- this line needs to be changed ' LIMIT '.(((int)$this->page - 1) * $n.','.$n), true, false); Edited December 18, 2015 by markych (see edit history) 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