Is there a way to run the Delete Product List Cache Entries scheduled task via SMT code?
Announcement
Collapse
No announcement yet.
Run Delete Product List Cache Entries Scheduled Task from Template
Collapse
X
-
Run Delete Product List Cache Entries Scheduled Task from Template
Bruce Golub
Phosphor Media - "Your Success is our Business"
Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
phosphormedia.comTags: None
-
For inquiring minds (what's left of mine), what would be the difference in this method and the Scheduled Tasks method? Would this be similar to how many of Bill's modules had a process triggered when a certain screen was clicked on?Originally posted by Bruce - PhosphorMedia View PostIs there a way to run the Delete Product List Cache Entries scheduled task via SMT code?Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr
-
For example, I created a price updating feature via SMT. However, they have to remember to go find and run the Delete Cache to see changes (or wait until its scheduled run time). I want to be able to call it after the script runs, like Scheduled_Task('Delete Cached Product List')Bruce Golub
Phosphor Media - "Your Success is our Business"
Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
phosphormedia.com
Comment
-
The Standard Scheduled Tasks module is in the LSK, and so is the library code for functions like CachedProductListList_Load_OlderThan() and CachedProductList_Delete(). I bet you can just write this functionality into your template with a couple of mvt:do's.Kent Multer
Magic Metal Productions
http://TheMagicM.com
* Web developer/designer
* E-commerce and Miva
* Author, The Official Miva Web Scripting Book -- available on-line:
http://www.amazon.com/exec/obidos/IS...icmetalproducA
Comment
-
Kent beat me to it.
Also, I was just looking up some functions for something else and allowed myself to be distracted. These functions are in the LSK under the LSK LIB folder, there are two subfolders, and the filenames start with "cachedproduct...." etc.
Scott
Need to offer Shipping Insurance?
Interactive Design Solutions https://www.myids.net
MivaMerchant Business Partner | Certified MivaMerchant Web Developer
Competitive Rates, Custom Modules and Integrations, Store Integration
AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
My T-shirt Collection is mostly MivaCon T-shirts!!
Comment
-
Writes on Post it Note: "Update Local LSK Directory".....Bruce Golub
Phosphor Media - "Your Success is our Business"
Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
phosphormedia.com
Comment
-
This sounds like something I would love to learn how to do. I have store owners that are constantly adding products but forget about that cache.Originally posted by dcarver View PostYou could give the scheduled task a trigger and in the template code you could do an mvt:do to call ScheduledTask_Trigger( 'trigger_code' ). This will cause the scheduled task to run trigger delay seconds from now.Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr
Comment
-
Perfect. Thanks David!Originally posted by dcarver View PostYou could give the scheduled task a trigger and in the template code you could do an mvt:do to call ScheduledTask_Trigger( 'trigger_code' ). This will cause the scheduled task to run trigger delay seconds from now.Bruce Golub
Phosphor Media - "Your Success is our Business"
Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
phosphormedia.com
Comment
-
Hmm, it was a late night, but this doesn't appear to work:Originally posted by dcarver View PostYou could give the scheduled task a trigger and in the template code you could do an mvt:do to call ScheduledTask_Trigger( 'trigger_code' ). This will cause the scheduled task to run trigger delay seconds from now.
<mvt:do file="g.Module_Library_DB" name="g.updateCache" value="ScheduledTask_Trigger('PriceUpdater')" />
<mvt:if expr="g.updateCache">
<p>Updating Page Cache.</p>
<mvt:else>
<p>Page Cache Not Updated. Please Update manually.</p>
</mvt:if>
Description: Delete Cached Product List Entries
Trigger: PriceUpdater
Trigger Delay: 5 second(s)
Is the library file correct?
Bruce Golub
Phosphor Media - "Your Success is our Business"
Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
phosphormedia.com
Comment
-
odd...i think my search feature must have taken a vacation yesterday as it didn't turn up anything...now it is...thanks!Bruce Golub
Phosphor Media - "Your Success is our Business"
Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
phosphormedia.com
Comment
-
I don't know what the spec would be for this. After some testing, it appears that in order to run this trigger function from a template the Scheduled task must explicitly be ENABLED. If my finding is correct, Is there a reason for this? IMO, if the function is written into a template that itself is equal the ENABLE button/switch. Might be worth the discussion. If the function doesn't run when it's expected from coded into a template there is NO feedback for anyone to be able to troubleshoot if the task is switched off inadvertently. It's clearly problematic if the function in the scheduled task might be critical such as pricing or inventory updates.Originally posted by dcarver View PostYou could give the scheduled task a trigger and in the template code you could do an mvt:do to call ScheduledTask_Trigger( 'trigger_code' ). This will cause the scheduled task to run trigger delay seconds from now.
ScottNeed to offer Shipping Insurance?
Interactive Design Solutions https://www.myids.net
MivaMerchant Business Partner | Certified MivaMerchant Web Developer
Competitive Rates, Custom Modules and Integrations, Store Integration
AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
My T-shirt Collection is mostly MivaCon T-shirts!!
Comment
Comment