Top WooCommerce & WordPress Plugins › Forums › Price Robot for WooCommerce › Formula for lowering price every 7 days
- Support forum for the Price Robot for WooCommerce.
- This topic has 2 replies, 2 voices, and was last updated 1 year, 1 month ago by
Tom Anbinder.
- AuthorPosts
-
October 4, 2022 at 6:46 am #92103
Niklas
ParticipantHi,
Trying here..
Im using this formula:
[min value="59"][product_price]-[floor]([current_time]-[product_last_sale_time min_date="2022-10-04"])/(24*60*60/7)[/floor][/min]
But even when resetting prices, many prices drop by 2 immediately. Also, some prices move the opposite way and some move by much more even though data should be from today (so not a week has passed).
Any idea?
Best Regards
October 4, 2022 at 9:36 pm #92227Hi Niklas,
I’ve just tried using your formula on my test site, and it seems to be working fine here. Just to be sure, you are trying to lower the price by $7 for each day without sales, correct? I.e., if the initial product price is $100, then after two days without sales, the product price will be $86 (because 100-2*7=86)?
October 4, 2022 at 9:47 pm #92228P.S. If you’d want to lower the price by $1 every seven days, then your formula would look like this:
[min value="59"][product_price]-[floor]([current_time]-[product_last_sale_time min_date="2022-10-04"])/(24*60*60*7)[/floor][/min]
i.e., we have
60*7
instead of60/7
.One note, though – you have set
min_date="2022-10-04"
, so today (i.e., 2022-10-05), the formula will not make any changes to product prices because it has to be at least one full week since the last sale. One exception – it will set the minimum price for all products to $59 (because we have[min value="59"]...[/min]
), so if any of your products have an initial price lower than $59, it will be automatically increased to $59. - AuthorPosts
- You must be logged in to reply to this topic.