-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Product meta lookup table incorrectly shows product on sale #43008
Labels
Comments
Merged
11 tasks
jonathansadowski
added
focus: product
Issues related to product or product page.
team: Mothra
labels
Dec 20, 2023
jorgeatorres
added a commit
that referenced
this issue
Mar 1, 2024
…sale Closes #43008 (#43011) * Update wc-product-functions.php Determine if a product is on sale based on regular price, which is how its done in the WC_Product class https://github.com/woocommerce/woocommerce/blob/7122669d448acb90d0f8a7177b76baaccec2e76b/plugins/woocommerce/includes/abstracts/abstract-wc-product.php#L1633 * Add changefile(s) from automation for the following project(s): woocommerce * added missing placeholders * Update 43011-patch-1 * Add changefile(s) from automation for the following project(s): woocommerce * Re-trigger CI --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Jorge A. Torres <jorge.torres@automattic.com>
thealexandrelara
pushed a commit
that referenced
this issue
Mar 4, 2024
…sale Closes #43008 (#43011) * Update wc-product-functions.php Determine if a product is on sale based on regular price, which is how its done in the WC_Product class https://github.com/woocommerce/woocommerce/blob/7122669d448acb90d0f8a7177b76baaccec2e76b/plugins/woocommerce/includes/abstracts/abstract-wc-product.php#L1633 * Add changefile(s) from automation for the following project(s): woocommerce * added missing placeholders * Update 43011-patch-1 * Add changefile(s) from automation for the following project(s): woocommerce * Re-trigger CI --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Jorge A. Torres <jorge.torres@automattic.com>
Konamiman
pushed a commit
that referenced
this issue
Mar 13, 2024
…sale Closes #43008 (#43011) * Update wc-product-functions.php Determine if a product is on sale based on regular price, which is how its done in the WC_Product class https://github.com/woocommerce/woocommerce/blob/7122669d448acb90d0f8a7177b76baaccec2e76b/plugins/woocommerce/includes/abstracts/abstract-wc-product.php#L1633 * Add changefile(s) from automation for the following project(s): woocommerce * added missing placeholders * Update 43011-patch-1 * Add changefile(s) from automation for the following project(s): woocommerce * Re-trigger CI --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Jorge A. Torres <jorge.torres@automattic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Prerequisites
Describe the bug
If i product has its
_sale_price
and_regular_price
the same then_price
will also be the same.$product->is_on_sale()
will correctly return false as it checks against the regular price but the lookup table will show on sale as it ignores the regular price and just checks if the_price
is the same as the_sale_price
It may be incorrect to have all 3 prices be the same, but it can happen and it will cause this behavior. In my case its not in my control as we are working with a company which integrates our products/inventory with another system (which is where prices are configured) I have an issue opened with them as well to not populate the
_sale_price
meta field when its the same. but regardless i think this should also be fixed hereExpected behavior
wp_wc_product_meta_lookup.onsale
should be 0 when$product->is_on_sale()
is falseActual behavior
wp_wc_product_meta_lookup.onsale
can sometimes be 1 when$product->is_on_sale()
is falseSteps to reproduce
set regular_price, price, and sale_price to the same value and generate lookup tables`
WordPress Environment
N/A
Isolating the problem
The text was updated successfully, but these errors were encountered: