We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As discussed, try to generate a code until it is unique, currently i got a exception that the code already exists.
My current solution:
$uniqueCode = false; while (!$uniqueCode) { $codes = $this->cartPriceRuleVoucherCodeGenerator->generateCodes($voucherCodeConfiguration); $code = reset($codes); $existingCode = $this->cartPriceRuleVoucherRepository->findByCode($code->getCode()); if (!$existingCode) { $uniqueCode = true; } }
The text was updated successfully, but these errors were encountered:
Great solution. Maybe we can also implement a user feedback in the backend to show those codes which would have been duplicates.
Sorry, something went wrong.
@davidhoeck ?
No branches or pull requests
As discussed, try to generate a code until it is unique, currently i got a exception that the code already exists.
My current solution:
The text was updated successfully, but these errors were encountered: