Jump to content

store is slow


Recommended Posts

oki i will help you man

you have 3 catalog and one file drag all files in root and over wright files then go to
http://www.yourdomain.com/install.php after this process delete install.php

then you go to backoffice tools>and tabs add new tab you have to give it a name like chash if u like
in class wright this AdminCache then you can give an icon /img/t/AdminCache.gif
then you choose where you want to put your tab my sugestion is that you put it in tools man

dose this guide good man ;)

Link to comment
Share on other sites

presta has a veryyyyyyy slooooowwwwwwwww query in bestseller list if you have many products and/or orders :)

it will do no harm changing in classes/ProductSale.php from this:

       $result = Db::getInstance()->ExecuteS('
       SELECT p.id_product, pl.`link_rewrite`, pl.`name`, pl.`description_short`, i.`id_image`, il.`legend`, ps.`quantity` AS sales, p.`ean13`, cl.`link_rewrite` AS category
       FROM `'._DB_PREFIX_.'product_sale` ps 
       LEFT JOIN `'._DB_PREFIX_.'product` p ON ps.`id_product` = p.`id_product`
       LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.intval($id_lang).')
       LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1)
       LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.intval($id_lang).')
       LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (cl.`id_category` = p.`id_category_default` AND cl.`id_lang` = '.intval($id_lang).')
       LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = p.`id_product`)
       INNER JOIN `'._DB_PREFIX_.'category_group` ctg ON (ctg.`id_category` = cp.`id_category`)
       '.($cookie->id_customer ? 'INNER JOIN `'._DB_PREFIX_.'customer_group` cg ON (cg.`id_group` = ctg.`id_group`)' : '').'
       WHERE p.`active` = 1
       AND ('.($cookie->id_customer ? 'cg.`id_customer` = '.intval($cookie->id_customer).' OR' : '').' ctg.`id_group` = 1)
       GROUP BY p.`id_product`
       ORDER BY sales DESC
       LIMIT '.intval($pageNumber * $nbProducts).', '.intval($nbProducts));



to this:

   $result = Db::getInstance()->ExecuteS('
   SELECT p.id_product, pl.`link_rewrite`, pl.`name`, pl.`description_short`, i.`id_image`, il.`legend`, ps.`quantity` AS sales, p.`ean13`, cl.`link_rewrite` AS category
   FROM `'._DB_PREFIX_.'product_sale` ps 
   LEFT JOIN `'._DB_PREFIX_.'product` p ON ps.`id_product` = p.`id_product`
   LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.intval($id_lang).')
   LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1)
   LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.intval($id_lang).')
   LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (cl.`id_category` = p.`id_category_default` AND cl.`id_lang` = '.intval($id_lang).')
   LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = p.`id_product`)
   INNER JOIN `'._DB_PREFIX_.'category_group` ctg ON (ctg.`id_category` = cp.`id_category`)
   WHERE p.`active` = 1
   GROUP BY p.`id_product`
   ORDER BY sales DESC
   LIMIT '.intval($pageNumber * $nbProducts).', '.intval($nbProducts));    





I am using smarty cache instead of the above code however it's not trivial to present it here as you may break your store

Link to comment
Share on other sites

×
×
  • Create New...