- Posts: 279
- Thank you received: 42
Error when I cancel the order from the back-end
2 years 5 months ago - 2 years 5 months ago #360071
by oxido
Error when I cancel the order from the back-end was created by oxido
-- HikaShop version -- : 5.0.3
-- Joomla version -- : 4.4.2
-- PHP version -- : 8.1.27
-- Browser(s) name and version -- : Google chrome
-- Error-message(debug-mod must be tuned on) -- : BIGINT UNSIGNED value is out of range in '`my_db`.`#__hikashop_discount`.`discount_used_times` - 1'
Steps for reproduction.
1. Activate the affiliation.
2. Create a coupon code without limit of use and set "Force affiliation to": (select 1 partner).
3. Create an order from Front-end and use the coupon.
4. In the back-end, go to Orders and change the status of the order to "cancel"
It only happens when the status of the order is changed from anything to "cancel"
5. if the error does not appear on the first try, change the status by selecting any other option, then select "cancelled" again
-- Joomla version -- : 4.4.2
-- PHP version -- : 8.1.27
-- Browser(s) name and version -- : Google chrome
-- Error-message(debug-mod must be tuned on) -- : BIGINT UNSIGNED value is out of range in '`my_db`.`#__hikashop_discount`.`discount_used_times` - 1'
Steps for reproduction.
1. Activate the affiliation.
2. Create a coupon code without limit of use and set "Force affiliation to": (select 1 partner).
3. Create an order from Front-end and use the coupon.
4. In the back-end, go to Orders and change the status of the order to "cancel"
It only happens when the status of the order is changed from anything to "cancel"
5. if the error does not appear on the first try, change the status by selecting any other option, then select "cancelled" again
Code:
BIGINT UNSIGNED value is out of range in '`my_db`.`#__hikashop_discount`.`discount_used_times` - 1'
Last edit: 2 years 5 months ago by oxido. Reason: to add more details
Please Log in or Create an account to join the conversation.
2 years 5 months ago #360076
by nicolas
Replied by nicolas on topic Error when I cancel the order from the back-end
Hi,
Thank you for your feedback.
Change the line:
to:
in the file administrator/components/com_hikashop/classes/order.php and it will fix the problem.
We'll add the fix on our end for the next version of HikaShop which is scheduled for the next few days.
Thank you for your feedback.
Change the line:
Code:
$query = 'UPDATE '.hikashop_table('discount').' SET discount_used_times = discount_used_times - 1 WHERE discount_code='.$this->database->Quote($code).' AND discount_type=\'coupon\' LIMIT 1';
Code:
$query = 'UPDATE '.hikashop_table('discount').' SET discount_used_times = discount_used_times - 1 WHERE discount_used_times> 0 AND discount_code='.$this->database->Quote($code).' AND discount_type=\'coupon\' LIMIT 1';
We'll add the fix on our end for the next version of HikaShop which is scheduled for the next few days.
The following user(s) said Thank You: oxido
Please Log in or Create an account to join the conversation.
Time to create page: 0.172 seconds