[4.1.x.x] Catalog's specials show incorrect price
Author: tongo-angelovCreated Sep 27, 2026Updated Sep 28, 2026
What version of OpenCart are you reporting this for? 4.1.x.x
Describe the bug Specials' price is not correct
To Reproduce Steps to reproduce the behavior:
- Go to admin panel and add discount to Canon EOS 5D and set special to checked
- Go to catalog /index.php?route=product/special to view specials
Expected behavior If discount is set to 10%, price should be 10% less and not $10
Screenshots / Screen recordings
Set special:
product/special list:
Server / Test environment (please complete the following information):
- Ubuntu Server
- PHP v8.3
- Apache/2.4.58
Additional context
catalog/model/catalog/product.getSpecials gets discount's value without checking its type:
$sql = "SELECT *, `p`.`price`, `ps`.`price` as `special` ...query need to set special's value based on discount type:
$sql = "SELECT *, `p`.`price`, (CASE WHEN `ps`.`type` = 'P' THEN (`p`.`price` - (`p`.`price` * (`ps`.`price` / 100))) WHEN `ps`.`type` = 'S' THEN (`p`.`price` - `ps`.`price`) ELSE `ps`.`price` END) AS `special` ...Source: opencart/opencart