• I am confused with the meaning of the variation sales price entries in the SQL database. Can anyone explain to me the difference between the following…

    • _min_variation_price
    • _max_variation_price
    • _min_variation_regular_price
    • _max_variation_regular_price
    • _min_variation_sale_price
    • _max_variation_sale_price

    In particular, how does _min_variation_price differ from _min_variation_regular_price?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Regular and sale are entered by the admin in the product data section. Plain price is calculated by WooCommerce as follows: If sale is set, plain price = sale. (You cannot enter a sale > regular) If sale is not set, plain price = regular. So plain price is always the price the customer pays.

    Thread Starter blernt1on

    (@blernt1on)

    So _min_variation_price and _max_variation_price are calculated by WooCommerce?

    How does WooCommerce determine if a product sale price is to be displayed? I have removed the sale price in the dashboard but the SQL database is still showing a sale price.

    Yes, min & max_variation_price are calculated by WooCommerce.

    I tried this and although I’m always seeing a _sale_price meta key, when there is no sale price, the value for _sale_price is a zero length string. In which case, price = regular price.

    When I delete the sale price in the dashboard, I am not seeing the previous sale price value in the database, just the _sale_price key.

    Thread Starter blernt1on

    (@blernt1on)

    I think I may have misunderstood your answer slightly, so each of the following SQL entries are calculated by WooCommerce?

    _min_variation_price
    _max_variation_price
    _min_variation_regular_price
    _max_variation_regular_price
    _min_variation_sale_price
    _max_variation_sale_price

    Some of my variable products have these entries and others do not, very confusing

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    This is legacy; WC no longer uses or sets these values.

    Thread Starter blernt1on

    (@blernt1on)

    Thanks for the clarification Mike, do you know at which version they became redundant?

    Yes, it is my understanding that all those are calculated by WooCommerce.

    My older variable products have those 6 meta values, although the values are not correct and do not reflect the current prices for that product. I have 2 variable products I just created under WC3.1 and these do not have the 6 meta entries.

    See the changelog, v3.0 line 357:
    https://github.com/woocommerce/woocommerce/blob/master/CHANGELOG.txt
    “Performance – Optimised variable product sync. Upper/lower price meta is no longer stored, just the main prices, if a child has weight, and if a child has dimensions.”
    although I don’t understand what weight and dimensions have to do with it.

    It looks like the 6 meta entries are leftovers and no longer used or updated.

    Thread Starter blernt1on

    (@blernt1on)

    Thanks for the clarification, all makes sense now.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘_min_variation_price VS _min_variation_regular_price’ is closed to new replies.