-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bfd22ae
commit 5a4f059
Showing
3 changed files
with
61 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MyParcelNL\PrestaShop\Module\Hooks; | ||
|
||
use CustomerMessage; | ||
use CustomerThread; | ||
use MyParcelNL\Pdk\App\Api\Backend\PdkBackendActions; | ||
use MyParcelNL\Pdk\Facade\Actions; | ||
|
||
trait HasPdkOrderHooks | ||
{ | ||
/** | ||
* @throws \PrestaShopDatabaseException | ||
* @throws \PrestaShopException | ||
*/ | ||
public function hookActionObjectCustomerMessageAddAfter(array $params): void | ||
{ | ||
if ($params['object'] instanceof CustomerMessage) { | ||
$message = $params['object']; | ||
$thread = new CustomerThread($message->id_customer_thread); | ||
|
||
Actions::execute(PdkBackendActions::POST_ORDER_NOTES, [ | ||
'orderIds' => [$thread->id_order], | ||
]); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters