Hello,
Is your change displaying an error?
Because the right PHP syntax should be this :
if($cart->getVoucherCode() == "hhdyyhfyr") {
// return ;
return;
}
Even if it's not the correct way to do this, there is an other method that allow you to handle more than one voucher code :
if( in_array($cart->getVoucherCode(), ["voucherCode1", "voucherCode2", "voucherCode3"]) ) {
// return ;
return;
}
There are 3 voucher codes in this example but you can put more.