Bug description
get_lowest_price_array() in class-iworks-omnibus-post-type-price-log.php uses 'type' => 'NUMERIC' in its meta_query. In WordPress, NUMERIC maps to CAST(meta_value AS SIGNED) in MySQL, which truncates decimal values to integers.
This causes the != comparison (used to exclude the current sale price) to never work for non-integer prices:
-- What happens with NUMERIC (SIGNED):
CAST("29.98" AS SIGNED) = 29
29 != 29.98 → TRUE -- should be FALSE!
-- What should happen with DECIMAL(10,2):
CAST("29.98" AS DECIMAL(10,2)) = 29.98
29.98 != 29.98 → FALSE -- correct
Result
The current sale price is never excluded from the "lowest price" query. The plugin shows the current promotional price as the "previous lowest price" instead of the actual lowest price before the discount.
Additional issue
woocommerce_wp_text_input_price() only displays price_sale from the result array. When the missing setting is set to regular and there's no sale history, the fallback returns price (regular price) but without price_sale key — so the admin always shows "no data" for products that never had a sale.
Steps to reproduce
- Create a simple product with regular price 29.99, no sale price
- Save product
- Set sale price to 29.98, save
- Check Omnibus Directive fields in admin → shows 29.98 (wrong, should show 29.99)
Expected behavior
Omnibus should show 29.99 (the lowest price from 30 days before the discount was introduced).
Suggested fix
Change 'type' => 'NUMERIC' to 'type' => 'DECIMAL(10,2)' in the meta_query inside get_lowest_price_array().
Workaround
We created a companion plugin that fixes this via filters (no modifications to Omnibus files):
https://github.com/lukelocksmith/omnibus-fix
Environment
- Omnibus version: 3.0.4
- WordPress: 6.7
- WooCommerce: 9.x
- PHP: 8.x
- MySQL: 8.x
Bug description
get_lowest_price_array()inclass-iworks-omnibus-post-type-price-log.phpuses'type' => 'NUMERIC'in itsmeta_query. In WordPress,NUMERICmaps toCAST(meta_value AS SIGNED)in MySQL, which truncates decimal values to integers.This causes the
!=comparison (used to exclude the current sale price) to never work for non-integer prices:Result
The current sale price is never excluded from the "lowest price" query. The plugin shows the current promotional price as the "previous lowest price" instead of the actual lowest price before the discount.
Additional issue
woocommerce_wp_text_input_price()only displaysprice_salefrom the result array. When themissingsetting is set toregularand there's no sale history, the fallback returnsprice(regular price) but withoutprice_salekey — so the admin always shows "no data" for products that never had a sale.Steps to reproduce
Expected behavior
Omnibus should show 29.99 (the lowest price from 30 days before the discount was introduced).
Suggested fix
Change
'type' => 'NUMERIC'to'type' => 'DECIMAL(10,2)'in themeta_queryinsideget_lowest_price_array().Workaround
We created a companion plugin that fixes this via filters (no modifications to Omnibus files):
https://github.com/lukelocksmith/omnibus-fix
Environment