VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: timlogotim on November 14, 2014, 22:04:24 PM

Title: Category Cache
Post by: timlogotim on November 14, 2014, 22:04:24 PM
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?
Title: Re: Category Cache
Post by: jenkinhill on November 14, 2014, 23:21:15 PM
Have you turned off cache in the VM category module Basic Options?
Title: Re: Category Cache
Post by: Milbo on November 15, 2014, 20:44:59 PM
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();
Title: Re: Category Cache
Post by: timlogotim on November 20, 2014, 00:18:49 AM
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.
Title: Re: Category Cache
Post by: GJC Web Design on November 20, 2014, 11:50:58 AM
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