Post by xinxilas » Tue Mar 27, 2018 11:38 am

I have a lot of Categories, so it slowed down my site.

So i read here to disable categories count , it woked, but i like categories count , is there any way to count categories with an trigger and saves each categories count?

Thank you, Renato!

New member

Posts

Joined
Mon Apr 27, 2015 7:46 am

Post by IP_CAM » Tue Mar 27, 2018 12:34 pm

Well, some Mod's exist for this, at least for OC 1.5.x Versions. But I just compared a v.3.0.2.x
D:\... \OC_3.0.2.0\catalog\model\catalog\product.php File with my Version File,
and I found exactly the same Routine, as it exists in my v.1.5.6.x Version File:
OC Version v.3.0.2.x:

Code: Select all

		$query = $this->db->query($sql);

		return $query->row['total'];
	}
compared to:
DEFAULT OC v.1.5.6.5_rc File Content:

Code: Select all

		$query = $this->db->query($sql);

	return $query->row['total'];
}
In my OC v.1.5.6.5_rc, I implemented the NEW CACHE Code like shown below,
but with OC v.3.x, I don't believe, that this md5 and possibly $this-> still
works, but it should be a clacks for a Coder, to make this work in OC 2 + 3.x
Versions as well.

It's a highly efficient way, to speed up a system, in the most simple way. Another
Fix add's all Cat's and their 'Values' into one single File, then also placed in the
Cache Folder, but this way of doing it takes TWO steps, to get the RESULT, compared
with this very simple 1-step Flatfile-data way of doing it, so, one saves another
microsecond, and so keeps the prozessor a little cooler as well... :laugh:
( but don't worry, that's just small minded Swiss perfectionist thinking... ::) )

But by use of such a Modification, there is no more difference in Pageload speed,
regardless of, if Category Counting is on or off. And I like to 'keep' it on too!
---
MODIFIED OC Version 1.5.6.x :

Code: Select all

// JTI MOD  Category Product Numbers Cache
	//	$query = $this->db->query($sql);
	//  return $query->row['total'];

	$cacheid='product.gettotalproducts.'.md5($sql).(int)$customer_group_id;
	$total=$this->cache->get($cacheid);
	if ($total === null ) {
	$query = $this->db->query($sql);
		$total = $query->row['total'];
		$this->cache->set($cacheid,$total);
   }
	return $total;
}
// END JTI MOD Category Product Numbers Cache
I just hope, that someone will be willing, to make it work for you, and
probably a few others...
Good Luck ! ;)
Ernie
---
Source:
http://octurbo.com/caching-opencarts-category-counts/
---
The other 1.5.6.x Count Caching Solution from genious Weismann Web:
https://gist.github.com/weismannweb/a16 ... 89ca1d1209
---
Image

Attachments

opencart_cache_category_products.jpg

opencart_cache_category_products.jpg (119.71 KiB) Viewed 426 times

Last edited by IP_CAM on Wed Mar 28, 2018 1:37 am, edited 1 time in total.

For Sale: Top URL's, including an OpenCart V-Pro Installation, similar to:
http://www.bigmax.ch - http://www.ipcam.li - http://www.jti.li
For Information + URL's offered, please contact me at: jti@jacob.ch
I am NOT available for Custom Support in existing OC Installations!
My Github Repositories: https://github.com/IP-CAM
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by xinxilas » Tue Mar 27, 2018 8:42 pm

big thanks, ill give a try!

New member

Posts

Joined
Mon Apr 27, 2015 7:46 am

Post by IP_CAM » Sun Apr 01, 2018 1:09 am

well, it's astonishing, how much help we got with this, but I bet, somone
is already creating a paid extension out of it... :'(
I am just glad, not to use later versions, and so depending on others.
Ernie

For Sale: Top URL's, including an OpenCart V-Pro Installation, similar to:
http://www.bigmax.ch - http://www.ipcam.li - http://www.jti.li
For Information + URL's offered, please contact me at: jti@jacob.ch
I am NOT available for Custom Support in existing OC Installations!
My Github Repositories: https://github.com/IP-CAM
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by IP_CAM » Thu Jul 19, 2018 3:30 am

Well, good News, :D
I accidentally stumbled into a new VqMod Version of WeismannWeb's famous
Category Cache Extension for OpenCart 3.0.x Versions. And if it works,
then, nobody else would ever have to reply to the above anymore! :laugh:
Good Luck!
Ernie
---
Caches category data for Opencart 3.0 VqMod to make it faster.
Opencart Software with alot of categories acts really slow.
Category Counting can be left active this way, without resulting in slower Performance! ;)
http://forum.opencart.com/viewtopic.php?f=161&t=126241
---
Download VqMod for OC v.3.0.x
https://gist.github.com/IP-CAM/410aaa24 ... 159ea21eaa
---
PS. I created an OcMod File for v.3.0.x Versions, but since I cannot test it, I removed
it again from here. Hopefully, one already downloaded it, and comments on Results,
otherwhise, contact me, to get it for tests.

For Sale: Top URL's, including an OpenCart V-Pro Installation, similar to:
http://www.bigmax.ch - http://www.ipcam.li - http://www.jti.li
For Information + URL's offered, please contact me at: jti@jacob.ch
I am NOT available for Custom Support in existing OC Installations!
My Github Repositories: https://github.com/IP-CAM
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by IP_CAM » Mon Jul 23, 2018 3:12 am

Well, famous OSWorX finalized + tested my OC v.3.0.2.x OcMod Design
of the VqMod mentioned above , and it seems to function, as it comes
in the Installation ZIP File below. :D

WHAT IT DOES:
is, to add two Files into the system/storage/cache/... Section, to so have
all VALUES needed, to show Categories and amounts of Products, taken from one single
File, instead of first looking for all of it in the Database, as shown below, out of one of
my 1.5.6.5 Test Shop Installations. It will look about the same, up to v.3.0.2.x, I assume.
---
cache.ocmod_category_data_controller_module_category0.1532284844

Code: Select all

a:8:{i:0;a:4:{s:11:"category_id";s:2:"20";s:4:"name";s:13:"Desktops (61)";s:8:"children";a:0:{}s:4:"href";s:36:"http://www.opencart.li/shop/desktops";}i:1;a:4:{s:11:"category_id";s:2:"18";s:4:"name";s:14:"Notebooks (48)";s:8:"children";a:0:{}s:4:"href";s:56:"http://www.opencart.li/shop/product/category&path=18";}i:2;a:4:{s:11:"category_id";s:2:"25";s:4:"name";s:15:"Components (51)";s:8:"children";a:0:{}s:4:"href";s:56:"http://www.opencart.li/shop/product/category&path=25";}i:3;a:4:{s:11:"category_id";s:2:"57";s:4:"name";s:12:"Tablets (49)";s:8:"children";a:0:{}s:4:"href";s:56:"http://www.opencart.li/shop/product/category&path=57";}i:4;a:4:{s:11:"category_id";s:2:"17";s:4:"name";s:13:"Software (35)";s:8:"children";a:0:{}s:4:"href";s:56:"http://www.opencart.li/shop/product/category&path=17";}i:5;a:4:{s:11:"category_id";s:2:"24";s:4:"name";s:11:"Phones (43)";s:8:"children";a:0:{}s:4:"href";s:56:"http://www.opencart.li/shop/product/category&path=24";}i:6;a:4:{s:11:"category_id";s:2:"33";s:4:"name";s:12:"Cameras (41)";s:8:"children";a:0:{}s:4:"href";s:56:"http://www.opencart.li/shop/product/category&path=33";}i:7;a:4:{s:11:"category_id";s:2:"34";s:4:"name";s:16:"MP3 Players (60)";s:8:"children";a:0:{}s:4:"href";s:39:"http://www.opencart.li/shop/mp3-players";}}
And this way, one is no longer required, to disable visible Product Counting, to so enhance default OC-Performance!
Good Luck! ;)
Ernie

Attachments

OpenCart v.3.0.2.x Cache Category Data OcMod


For Sale: Top URL's, including an OpenCart V-Pro Installation, similar to:
http://www.bigmax.ch - http://www.ipcam.li - http://www.jti.li
For Information + URL's offered, please contact me at: jti@jacob.ch
I am NOT available for Custom Support in existing OC Installations!
My Github Repositories: https://github.com/IP-CAM
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: daniGo, DigitCart and 18 guests