News:

Support the VirtueMart project and become a member

Main Menu

[SOLVED] Categories don't show in frontend immediately after add

Started by ServeTT, November 21, 2016, 20:18:53 PM

Previous topic - Next topic

ServeTT

Hello to everybody.

PHP 5.6.
Installed Joomla 3.6.4 + virtuemart 3.0.18.4 Blue Corvus 9383. Nothing else.
Site url - http://of.sabil.studio/index.php/test-categories
I can give access to admin panel, if You will need.

The proplem is that I create categories in admin panel, but in in frontend they appears after some minutes. Standart Joomla template after clean install, no changes.
In backend-everything is ok, but in fronted they appears after 5-7 minutes after, I did't change anything in Joomla settings.
Spent 3 hours (clean installed different older versions of Joomla and older versions of VM - same problem, no chages to templates and settings), but I can't understand - what I am doing wrong??
Sorry for maybe a stupid question, but I can't understand it( It is not my first site, but first such situation((
I hope very much for your help
Thank You!

Milbo

When it would be longer, I would think that you activated the joomla cache. Work first without activated cache.

It can also be your server cache, or your browser cache.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

ServeTT

Quote from: Milbo on November 21, 2016, 20:43:04 PM
When it would be longer, I would think that you activated the joomla cache. Work first without activated cache.

It can also be your server cache, or your browser cache.
Joomla cache is off, I didn't chage any settings, that are by default.
Tried on different browsers - same result(

GJC Web Design

VM cats are natively cached .. try creating a cat - then clear Joomla cache then check frontend

most users install the System - Regular Labs - Cache Cleaner plugin
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

ServeTT

Quote from: GJC Web Design on November 21, 2016, 21:08:46 PM
VM cats are natively cached .. try creating a cat - then clear Joomla cache then check frontend

most users install the System - Regular Labs - Cache Cleaner plugin

Clearing Joomla cache helped, thanks, but cleaning cache after every new category is not comfortable((
I have other site on J2.5 and VM2 - and there everything is ok with categories withou cache cleaning.

ServeTT

Turned off cache in the VM category module Basic Options
In administrator/components/com_virtuemart/models/category.php found method to clear the cache but it isn't working correctly, as I think, because com_virtuemart_cat_childs is not clearing.

I modified it

public function clearCategoryRelatedCaches(){
$cache = JFactory::getCache();
$cache->clean('com_virtuemart_cats');
$cache->clean('com_virtuemart_cat_childs');
$cache->clean('mod_virtuemart_product');
$cache->clean('mod_virtuemart_category');
     
              $conf = JFactory::getConfig();

$options = array(
'defaultgroup' => '',
'storage' => $conf->get('cache_handler', ''),
'caching' => true,
'cachebase' => $conf->get('cache_path', JPATH_SITE . '/cache')
);
$cache = JCache::getInstance('', $options);
$cache->clean('com_virtuemart_cats');
$cache->clean('mod_virtuemart_product');
$cache->clean('mod_virtuemart_category');
              $cache->clean('com_virtuemart_cat_childs');
}


I didn't look the docs in Joomla API for cache, maybe some things are duplicating, but it works for me!)

jenkinhill

Quote from: ServeTT on November 21, 2016, 21:16:58 PM
cleaning cache after every new category is not comfortable((

Then install https://www.regularlabs.com/extensions/cachecleaner  - it automatically clears the cache whenever something is saved.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

GJC Web Design

Quotecleaning cache after every new category is not comfortable((

and also isn't necessary .. the cache will clear when it expires and they will be visible - whats the rush?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

ServeTT

Quote from: jenkinhill on November 21, 2016, 23:26:05 PM
Quote from: ServeTT on November 21, 2016, 21:16:58 PM
cleaning cache after every new category is not comfortable((

Then install https://www.regularlabs.com/extensions/cachecleaner  - it automatically clears the cache whenever something is saved.

Thank You!
But I think that there is a bug in clearCategoryRelatedCaches, because there is a code in core to clear the cache, but it didn't work, I provided bug-report with my fix
http://forum.virtuemart.net/index.php?topic=136075.0

Quote from: GJC Web Design on November 21, 2016, 23:30:15 PM
Quotecleaning cache after every new category is not comfortable((

and also isn't necessary .. the cache will clear when it expires and they will be visible - whats the rush?
It is not comfortable to wait some minutes to see new categories and as I wrote above - there is a method to clean a cache in VM core, that didn't clean com_virtuemart_cat_childs (http://forum.virtuemart.net/index.php?topic=136075.0)

ServeTT