News:

Support the VirtueMart project and become a member

Main Menu

Category Cache

Started by timlogotim, November 14, 2014, 22:04:24 PM

Previous topic - Next topic

timlogotim

I have a script that publishes/unpublishes categories every 30 minutes based on inventory imports.  I have Joomla caching turned off and I have Jot Cache disabled, but every time I go to Joomla Maintenance / Clear Cache...the virtuemart categories are listed.  How can I prevent VM Categories from being cached?  I need these to always reflect live information.  I'm confused because I have all caching disabled (or at least the two places I know about).  Can you help point me in the right direction?

jenkinhill

Have you turned off cache in the VM category module Basic Options?
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

Milbo

in this case, you must get the cache and delete it manually after you did the imports. It is a two liner.


$cache = JFactory::getCache('com_virtuemart_cats','callback');
$cache->clean();
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

timlogotim

I am getting the following error after inserting that 2-liner at the end of my php file.

"Fatal error: Class 'JFactory' not found in /home/xxxx/public_html/folder/update_inventory.php on line 51"

The php is about 5 mysql queries (loading csv data files to temp table and comparing to vm inventory table and publishing/unpublishing items and categories based on inventory).

What do I need to add so that line is recognized?  My php file is only queries updating tables.

GJC Web Design

if this is a standalone php script outside of Joomla you need to import the Joomla framework - "bootstrap" is the jargon - Google - plenty of examples
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