Jump to content

Mehdib92

Members
  • Posts

    180
  • Joined

  • Last visited

1 Follower

About Mehdib92

  • Birthday 10/29/1986

Contact Methods

Profile Information

  • Location
    Paris (92)
  • Activity
    Developer

Recent Profile Visitors

6,221,190 profile views

Mehdib92's Achievements

  1. Thank you for your help. Instead of returning ['product' => $product_for_template], I was returning [$product_for_template]
  2. Hi, For my module, I add a TypeaheadProductCollectionType on the product page (like the related product). It works to add a product or a combination (the data are correctly stored in the database) but I don't find how to retrieve the data and display them. Despite having everything in the database, not any product is displayed under the search field. Anyone knows how to do that ? Or have a clue ? Thanks
  3. Hi, I had the same problem and the article (https://blog.floriancourgey.com/2018/05/how-to-work-with-the-symfony-kernel-anywhere-in-prestashop-1-7/) worked for me. Thanks
  4. Hi, I'm developing a module which add datas to a stock movement. In order to do that, I have decorate the PrestaShop\PrestaShop\Core\Stock\StockManager following this doc. I don't know if the decoration was made in a good way because the stock movement in the BO still use PrestaShop\PrestaShop\Core\Stock\StockManager instead of my class. But in my module, if I call my CustomStockManager, the movement is not made. I've found that the function SymfonyContainer::getInstance(); return null so the function saveMovement() return false. Is there a way to know why the SymfonyContainer return false ? Thanks
  5. Hi, I'm syncing my ERP with the 1.7.8.6 version of Prestashop. On the 1.6.1 version, I used the StockManagerInterface and the function addProduct() or removeProduct(). Everything was OK. But on the 1.7.8.6 I don't understand which StockManager is used. The thing that I don't understand is the use of the Stock, especially to have the physical quantity. If I understand, the class Stock is not used anymore but it is the StockAvailable class which is used in replacement ? Thanks
  6. Don't worry, you don't disappoint me, you just confirm what I was thinking. I just hoped that I was wrong And do you think it's the same for the PrestaShop\PrestaShop\Core\Domain\Order\QueryResult\OrderProductCustomizationForViewing ?
  7. I added the filetype when a customer upload a file for the customization. And I need to modify the display depending the filetype. What I want to do is override the function addCustomizedData() in the PrestaShop\PrestaShop\Adapter\Presenter\Cart\CartPresenter to add the data everywhere. I could do it with the hook actionPresentCart but I also need it on several pages of the site that's why I want to override/decorate the CartPresenter
  8. 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.
  9. It doesn't work, I have the message When I use bin/console debug:container, the CartPresenter is not listed, I think this is why it doesn't work
  10. Hi, I'd like to know if it's possible to decorate a Presenter. I'd like to override a function in the CartPresenter (I think for my need it will be easier than using the hook) but when I do it I have the message Is there a way to do that ? Thanks
  11. Hi, I have a module which will add actions to the orders in the back-office. In my module, I decorate the OrderController() and create a route to call my function. but when I want to call the route in javascript, I have the error : The route "mymodule_newaction" does not exist. If I check debug:router in the console, I see the route Here is my routes.yml : mymodule_newaction: path: mymodule/{orderId}/newaction methods: [POST] defaults: _controller: 'MyCompany\MyModule\Controller\Admin\Sell\Order\CustomOrderController::newAction' _legacy_controller: 'OrderController' _legacy_link: 'CustomOrderController::newAction' options: expose: true requirements: orderId: \d+ I can't figure out how to make the the route work.
  12. Il peut s'agir d'un souci au niveau du composer.json. Regarde ma réponse à ce post
×
×
  • Create New...