Skip to content

Commit

Permalink
Merge pull request #16 from zolthan/patch-1
Browse files Browse the repository at this point in the history
Wrong language in order status mails
  • Loading branch information
shyim authored Dec 6, 2020
2 parents d76358a + b5f6d51 commit 2d01bf6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/DependencyInjection/OrderServiceGeneratorPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,13 @@ public function process(ContainerBuilder $container): void
continue;
}

// Fetch order context to pass it into the event
$orderContextStmt = new Expression(new Assign($builder->var('orderContext'), $builder->methodCall($builder->var('this'), 'getOrderContext', [$builder->var('context'), $builder->var('order')])));
// Fire event
$arg = $builder->new('\\' . MailDataBagFilter::class, [$builder->var('data'), $builder->var('mailTemplate'), $builder->var('context')]);
$arg = $builder->new('\\' . MailDataBagFilter::class, [$builder->var('data'), $builder->var('mailTemplate'), $builder->var('orderContext')]);
$newStmt = new Expression($builder->methodCall($propertyFetch, 'dispatch', [$arg]));

array_splice($method->stmts, $i, 0, [$newStmt]);
array_splice($method->stmts, $i, 0, [$orderContextStmt, $newStmt]);
}
}
}
Expand Down

0 comments on commit 2d01bf6

Please sign in to comment.