Last active
April 23, 2024 12:45
-
-
Save weismannweb/8add8fab5be99854db5c618d751281b2 to your computer and use it in GitHub Desktop.
Caches category data for Opencart 3.0 to make it faster. Opencart installs with alot of categories are really slow. http://forum.opencart.com/viewtopic.php?f=161&t=126241
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<modification> | |
<id>Cache category data to speed up page load for store with many categories and sub categories.</id> | |
<version>1.0.1</version> | |
<vqmver>2.3.2</vqmver> | |
<author>Weismann Web - www.weismannweb.com</author> | |
<file name="catalog/controller/extension/module/category.php"> | |
<operation> | |
<search position="after"><![CDATA[ | |
foreach ($categories as $category) { | |
]]></search> | |
<add><![CDATA[ | |
$category_data = $this->cache->get('vqmod_category_data_controller_module_category_'.$data['category_id'].'_'.$this->config->get('config_store_id')); | |
if ($category_data) { | |
$data['categories'] = $category_data; | |
break; | |
} | |
]]></add> | |
</operation> | |
<operation> | |
<search position="replace"><![CDATA[ | |
return $this->load->view('extension/module/category', $data); | |
]]></search> | |
<add><![CDATA[ | |
if (empty($category_data)) { | |
$this->cache->set('vqmod_category_data_controller_module_category_'.$data['category_id'].'_'.$this->config->get('config_store_id'), $data['categories']); | |
} | |
return $this->load->view('extension/module/category', $data); | |
]]></add> | |
</operation> | |
</file> | |
<file name="catalog/controller/common/menu.php"> | |
<operation> | |
<search position="after"><![CDATA[ | |
foreach ($categories as $category) { | |
]]></search> | |
<add><![CDATA[ | |
$category_data = $this->cache->get('vqmod_category_data_controller_common_header'.$this->config->get('config_store_id')); | |
if ($category_data) { | |
$data['categories'] = $category_data; | |
break; | |
} | |
]]></add> | |
</operation> | |
<operation> | |
<search position="replace"><![CDATA[ | |
return $this->load->view('common/menu', $data); | |
]]></search> | |
<add><![CDATA[ | |
if (empty($category_data)) { | |
$this->cache->set('vqmod_category_data_controller_common_header'.$this->config->get('config_store_id'), $data['categories']); | |
} | |
return $this->load->view('common/menu', $data); | |
]]></add> | |
</operation> | |
</file> | |
</modification> |
I have around 47000 products in my store and is too slow when load each category.
I disabled category count, still it is same.
I am using OC 3.0.3.3 and where can I use the code cache_category_data.xml please
Thats old code but I offer optimization for 6 to 8 hours @ $95/hr if you so
desire. Let us know if you need it done? Guarenteed faster speed. We do
upfront payment for small projects like this.
…On Sat, Feb 27, 2021, 6:31 PM mckrahman ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
I have around 47000 products in my store and is too slow when load each
category.
I disabled category count, still it is same.
I am using OC 3.0.3.3 and where can I use the code cache_category_data.xml
please
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://gist.github.com/8add8fab5be99854db5c618d751281b2#gistcomment-3647995>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJJOMMCIMEQGCCAKMBRYSLTBF6DVANCNFSM4VDQD25A>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there any similar exists for OC 1.5?