Contradictory Messages when Applying Coupon to Restricted Products

29.01.2026 11:37
#1
ecoShopUser
Joomshopping forum user no avatar
Name: Andrea
13.08.2012
Posts: 301
Quote
Contradictory Messages when Applying Coupon to Restricted Products

Hi,

I am experiencing a logic issue with the coupon code system in the JoomShopping backend. I have set up a discount code that is restricted to specific products/categories.

The Issue:
When a user adds a valid product to the cart, the coupon works as expected.
However, when a user adds only products that are NOT eligible for the discount and enters the code, the system displays two contradictory messages simultaneously.

Observed Behavior: The following two messages appear at the same time:

"Coupon is not valid for this product or product group" (Correct)
"Discount code applied successfully" (Incorrect/Contradictory)

The second message should not appear if the coupon requirements (specific products) are not met. This is confusing for customers as it implies a discount has been applied even though the price remains unchanged.

Can you please fix this?
Thanks.
Andrea
Contradictory Messages when Applying Coupon to Restricted Products


Last change: 29.01.2026 11:39
 
29.01.2026 12:15
#2
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 28243
Quote
Aw: Contradictory Messages when Applying Coupon to Restricted Products

addons version?
shop version?

 
29.01.2026 12:46
#3
ecoShopUser
Joomshopping forum user no avatar
Name: Andrea
13.08.2012
Posts: 301
Quote
Aw: Contradictory Messages when Applying Coupon to Restricted Products

Component Version 5.8.3

Addon Coupon Extra Fields 3.10.2

 
29.01.2026 20:41
#4
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 28243
Quote
Aw: Contradictory Messages when Applying Coupon to Restricted Products

Coupons extrafields 3.11.0 (Joomshopping 5.9.1+)
+
Will be fixed in
JooomShooping 5.9.1

------------------------------------------------

components\com_jshopping\Controller\CartController.php

function discountsave(){
$dispatcher = Factory::getApplication();
$dispatcher->triggerEvent('onLoadDiscountSave', array());

$ajax = $this->input->getInt('ajax');
$code = $this->input->getVar('rabatt');
$back_step = $this->input->getInt('back_step');

$coupon = JSFactory::getTable('coupon');
$cart = JSFactory::getModel('cart', 'Site');

if ($coupon->getEnableCode($code)){
$cart->load();
$dispatcher->triggerEvent('onBeforeDiscountSave', array(&$coupon, &$cart));
$cart->setRabatt($coupon->coupon_id, $coupon->coupon_type, $coupon->coupon_value);
$dispatcher->triggerEvent('onAfterDiscountSave', array(&$coupon, &$cart));
if ($coupon && $coupon->coupon_id && $coupon->coupon_value) {
JSError::raiseMessage('', Text::_('JSHOP_RABATT_APPLIED'));
}
if ($ajax){
print Helper::getOkMessageJson($cart);
die();
}
}else{
JSError::raiseWarning('', $coupon->error);
if ($ajax){
print Helper::getMessageJson();
die();
}
}

if ($back_step) {
$url = JSFactory::getModel('checkoutStep', 'Site')->getCheckoutUrl((string)$back_step, 1);
} else {
$url = Helper::SEFLink($cart->getUrlList(), 1, 1);
}
$this->setRedirect($url);
}

 


Copyrights MAXXmarketing GmbH. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.