[12/05/2025] Un peu de paramétrage, notamment les frais de port gratuits en fonction de certains seuils
This commit is contained in:
38
local/modules/ColissimoPickupPoint/Hook/PdfHook.php
Normal file
38
local/modules/ColissimoPickupPoint/Hook/PdfHook.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* This file is part of the Thelia package. */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : dev@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* For the full copyright and license information, please view the LICENSE.txt */
|
||||
/* file that was distributed with this source code. */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace ColissimoPickupPoint\Hook;
|
||||
|
||||
use ColissimoPickupPoint\ColissimoPickupPoint;
|
||||
use Thelia\Core\Event\Hook\HookRenderEvent;
|
||||
use Thelia\Core\Hook\BaseHook;
|
||||
use Thelia\Model\OrderQuery;
|
||||
|
||||
class PdfHook extends BaseHook
|
||||
{
|
||||
public function onInvoiceAfterDeliveryModule(HookRenderEvent $event)
|
||||
{
|
||||
// No So Colissimo information if the delivery module is not ColissimoPickupPoint
|
||||
if (ColissimoPickupPoint::getModuleId() == $event->getArgument('module_id')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$order = OrderQuery::create()->findOneById($event->getArgument('order'));
|
||||
|
||||
if (!is_null($order)) {
|
||||
$event->add($this->render(
|
||||
'delivery_mode_infos.html',
|
||||
['delivery_address_id' => $order->getDeliveryOrderAddressId()]
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user