I have a product (course) that loses value the closer it gets to the end of term. I've set up 'End date' and 'Weekly price' as custom fields on a page, and can calculate the exact price to pay in PHP.
How do I dynamically create a woocommerce product, or change an established product's price based on the 'Time Left' calculation I performed?
I've tried changing 'price.php' in Woocommerce's template file, but apparently it's just a cosmetic change, and the price reverts to original at basket and checkout.
Haven't the foggiest where else to start, so many thanks in advance.