Do not allow voucher of one customer to be applicable to another customer

This commit is contained in:
Abhishek Kumar
2023-08-28 17:20:43 +05:30
parent ccace94c38
commit 368c95b08a
3 changed files with 15 additions and 8 deletions

View File

@@ -768,7 +768,12 @@ class AdminCartRulesControllerCore extends AdminController
public function displayAjaxSearchCartRuleVouchers()
{
$found = false;
if ($vouchers = CartRule::getCartsRuleByCode(Tools::getValue('q'), (int)$this->context->language->id, true)) {
if ($vouchers = CartRule::getCartsRuleByCode(
Tools::getValue('q'),
(int)$this->context->language->id,
true,
(int) Tools::getValue('id_customer')
)) {
$found = true;
}
echo json_encode(array('found' => $found, 'vouchers' => $vouchers));