WooCommerce Stock Update & Caching
I've been writing some code to update my stock quantities based on a CSV file that is automatically retrieved from my drop ship supplier. Objective is to sync stock every X minutes.
The code sits in a PHP in the root of my website. WooCommerce is installed as you would expect.
I have managed to update the database fine using update statements within my PHP file and have confirmed that the stock is being updated in the database. However, it is not being reflected when viewed on the website. Going to WooCommerce -> System Status and clicking Clear Transients sorts it all out and shows the database modified prices on the website.
Can anyone suggest a way for me to be able to call this functionality ($woocommerce->clear_product_transients() from a standard PHP file outside the scope of the WooCommerce installation?
I don't really want to move the file as it should run from a cronjob automatically say every 10 minutes.
Thanks,
Michael
-
Mkj -
Thanks
{{ DiscussionBoard.errors[7561205].message }} -
-
Michael Westgate -
Thanks - 1 reply
{{ DiscussionBoard.errors[7561230].message }}-
Mkj -
Thanks
{{ DiscussionBoard.errors[7561477].message }} -
-
-
Michael Westgate -
Thanks - 1 reply
{{ DiscussionBoard.errors[7565209].message }}-
cmauro -
Thanks
{{ DiscussionBoard.errors[8426408].message }} -
-