Skip to content

Commit aa086eb

Browse files
authored
Check if property exists on controller
1 parent 4c127ba commit aa086eb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

classes/Hook/HookActionValidateOrder.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ public function __construct(Ps_Googleanalytics $module, Context $context)
5353
*/
5454
public function run()
5555
{
56-
// Check if we are creating backoffice order
57-
if ($this->context->controller->controller_name != 'AdminOrders' && $this->context->controller->controller_name != 'Admin') {
56+
// Check if we are creating backoffice order, we are only launching this hook when creating backoffice order
57+
// For FO purposes, we use displayOrderConfirmation.
58+
if (empty($this->context->controller->controller_name) || ($this->context->controller->controller_name != 'AdminOrders' && $this->context->controller->controller_name != 'Admin')) {
5859
return;
5960
}
6061

0 commit comments

Comments
 (0)