Closed (fixed)
Project:
Ubercart
Version:
6.x-2.6
Component:
Module integration
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
3 Aug 2011 at 20:18 UTC
Updated:
19 Oct 2011 at 17:00 UTC
I was curious if this was possible...
I am using a Ubercart patch that puts stock levels of all attribute items in the product/product listing pages (via it appends onto add_to_cart form in template.php i think).
Only thing is i have caching enabled via Boost module.
So the product/product listing pages i believe will get cached but the stock will change... is there anyway via a Conditional actions in ubercart or some Trigger/Action rule, to have it clear the Boost cache for that item if a purchase is made. Seems cool if can do this is future. Not sure if Boost or Ubercart would be responsible for doing this.
Comments
Comment #1
longwaveYou could add a custom PHP action that runs
cache_clear_all();on the "customer completes checkout" trigger as a quick fix, but this clears all caches on your site and may cancel out much of the improvement that Boost provides.Clearing the various caches for specific nodes will be more complicated; as far as I know it's not easy to determine which items actually need to be cleared - as well as page and node caches, there could be Views and so on to deal with.
Comment #2
armyofda12mnkeys commentedinteresting... but the cache_clear_all() does sound like kills point of caching if has to clear everything... So there is there no way to clear one node's cache? The order, in uc_order_products table has a $nid. I could just set up a separate process that checks the table every hour, and looks for new orders and does something for each node like cache_just_clear($nid), but i don't know if you can clear one node's cache as a function like that doesn't seem to exist :) ... it seems like there should be a way to do this hopefully but I can't find any info on it.
Comment #3
armyofda12mnkeys commentedi used a custom PHP action to clear the BOOST cache like this: not sure if working 100% but anonymous user seems to see the update on the product/listing catalog pages that i wanted to show the updated stock on:
It depends on the user coming back to your site after checkout to Paypal which is payment method i using.
Comment #4
longwaveSounds like you fixed this, then.