/**
* @param $id_product
* @param int $quantity
* @param Context|null $context
* @param null $id_product_attribute
* @return bool
*/
public static function isDiscounted($id_product, $quantity = 1, Context $context = null, $id_product_attribute = null)
{
if (!$context) {
$context = Context::getContext();
}
@$id_group = $context->customer->id_default_group;
@$cart_quantity = !$context->cart ? 0 : Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT SUM(`quantity`)
FROM `'._DB_PREFIX_.'cart_product`
WHERE `id_product` = '.(int)$id_product.' AND `id_product_attribute` = '.(int)$id_product_attribute.' AND `id_cart` = '.(int)$context->cart->id
);
$quantity = $cart_quantity ? $cart_quantity : $quantity;
@$id_currency = (int)$context->currency->id;
@$ids = Address::getCountryAndState((int)$context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')});
$id_country = $ids['id_country'] ? (int)$ids['id_country'] : (int)Configuration::get('PS_COUNTRY_DEFAULT');
return (bool)SpecificPrice::getSpecificPrice((int)$id_product, $context->shop->id, $id_currency, $id_country, $id_group, $quantity, $id_product_attribute, 0, 0, $quantity);
}
Well, this is what I ended up with. Put this into Product.php override.