Formula for lowering price every 7 days

Top WooCommerce & WordPress Plugins Forums Price Robot for WooCommerce Formula for lowering price every 7 days

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #92103
    Niklas
    Participant

    Hi,

    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

    #92227
    Tom Anbinder
    Moderator
    Plugin Support

    Hi 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)?

    #92228
    Tom Anbinder
    Moderator
    Plugin Support

    P.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 of 60/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.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.