I think I don't understand 100% how it works.
I have created mymodule/src/Presenter/CartPresenter.php
namespace Mfacilities\OrderExtras\Presenter; use Currency; use Order as PrestashopOrder; use OrderState; //use PrestaShop\PrestaShop\Adapter\Cart; class CartPresenter extends \PrestaShop\PrestaShop\Adapter\Presenter\Cart { public $cartPresenter; public function __construct(CartPresenter $cartPresenter) { $this->cartPresenter = $cartPresenter; } /** * @param Cart $cart * @param bool $shouldSeparateGifts * * @return array * * @throws \Exception */ public function present($cart, $shouldSeparateGifts = false) { die('TEST'); } }
If in my config/services.yml I add :
mycompany.mymodule.presenter.custom_cartpresenter: class: 'MyCompany\MyModule\Presenter\CartPresenter' arguments: - 'PrestaShop\PrestaShop\Adapter\Presenter\Cart\CartPresenter'
If I try like that (with a composer dumpautoload and a cache clear before), nothing happen.