Skip to content
Snippets Groups Projects
Commit 5d06ab1d authored by Juraj Nemec's avatar Juraj Nemec
Browse files

Issue #3252466: Check in queue if still in stock

parent c9f59498
No related branches found
No related tags found
1 merge request!17Issue #3252466: Check in queue if still in stock
......@@ -99,6 +99,10 @@ class CommerceStockNotifyQueue extends QueueWorkerBase implements ContainerFacto
// The product or variation is inactive, ignore it.
throw new \Exception("Variation $sku (or it\'s parent product) is unpublished. Skipping for now.");
}
if (!commerce_stock_notifications_check_stock($variation)) {
// There is no stock right now, do nothing.
return;
}
// Parameters that will be used during the mailing procedure.
$params = [
'mail_title' => $this->token->replace(AdminConfigForm::getValuesFromConfig()['email_subject'], [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment