Author Topic: Category Cache  (Read 3047 times)

timlogotim

  • Beginner
  • *
  • Posts: 21
Category Cache
« 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?

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28464
  • Always on vacation
    • Jenkin Hill Internet
Re: Category Cache
« Reply #1 on: November 14, 2014, 23:21:15 pm »
Have you turned off cache in the VM category module Basic Options?
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VirtueMart 4.0.12 10777  J 3.10.11 PHP 7.4.30

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10530
  • VM4.0.7 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Category Cache
« Reply #2 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.

Code: [Select]
$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

  • Beginner
  • *
  • Posts: 21
Re: Category Cache
« Reply #3 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.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10695
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.8.8
Re: Category Cache
« Reply #4 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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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