Shop is very slow everywhere i click

  • Posts: 24
  • Thank you received: 0
10 years 3 days ago #214970

Thanks for the reply

Last edit: 10 years 2 days ago by tampasounds.

Please Log in or Create an account to join the conversation.

  • Posts: 24
  • Thank you received: 0
10 years 2 days ago #215198

Ok all joins are now removed and the results are coming back between 4-6 sec which is a huge improvement
Also removed badge code since we don't use those.

Next question
Line Card (Brands) (Manufacturers) page... 11-14 seconds
What file do i edit to work on that next ?

Please Log in or Create an account to join the conversation.

  • Posts: 26276
  • Thank you received: 4046
  • MODERATOR
10 years 1 day ago #215265

Hi,

Your page "Line Card" is a brand listing ; a brand in a category in HikaShop database, so the category views are using for brands too.

Regarding the page, if you remove the setting "show the number of products", you will improve the loading of the page because HikaShop won't need to count the number of products for each brand in the list (and because a page display 500 brands, it could result a high number of data to process).

If you want to custom the view, it's the file "components/com_hikashop/views/category/view.html.php"
In that file you will find that block for the counting of the products

if($number_of_products){
	$additional_condition='';
	if($content_type=='manufacturer'){
		if(!$config->get('show_out_of_stock',1)){
			$additional_condition=' AND a.product_quantity!=0';
		}
		$database->setQuery('SELECT count(a.product_id) AS number_of_products,a.product_manufacturer_id as category_id FROM '.hikashop_table('product').' AS a WHERE a.product_published>0'.$additional_condition.' AND a.product_parent_id=0 AND a.product_manufacturer_id IN ('.implode(',',$ids).') GROUP BY a.product_manufacturer_id');
	}else{
		if(!$config->get('show_out_of_stock',1)){
			$additional_condition=' AND b.product_quantity!=0';
		}
		$database->setQuery('SELECT count(a.product_id) AS number_of_products,a.category_id FROM '.hikashop_table('product_category').' AS a INNER JOIN '.hikashop_table('product').' AS b ON a.product_id=b.product_id AND b.product_published>0'.$additional_condition.' AND b.product_parent_id=0 WHERE a.category_id IN ('.implode(',',$ids).') GROUP BY a.category_id');
	}
	$counts = $database->loadObjectList('category_id');
	$this->_getCount($rows,$counts);
}
And I think that is that specific query which use a lot of time in your page.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum