Jump to content

Busted

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by Busted

  1. Hi, It's been a while since this question, but I had to do the same (1.7.8). In your front controller : public function getTemplateVarPage() { $page = parent::getTemplateVarPage(); $page['meta']['title'] = 'Your Title'; return $page; }
  2. Sorry I totally forgot, and the notification went in my spam box. So it seems that based in my example, you have to extend CustomerController instead of FrameworkBundleAdminController. So yeah, Dichkovky got the right answer but I haven't tested yet, you can try it by yourself. If I have the needs to do the same, I'll post my results
  3. Hi Guillaume, Not yet but I'm going to take a course for a prestashop symfony/backend formation this month, and I'll ask the formator about that. I'll update my answer here, but you'll have to wait at least three weeks
  4. Hello everyone I would like to know if anybody has tried to decorate a controller ? I made a test with the symfony way to decorate a core controller in a custom module. The point was to caught the "toggleStatusAction" when you click on the active icon in the customers list (BO) . I followed the prestashop documentation to do so. So as precised I wrote a service.yml in a config folder: services: custom_controller: class: Test\CustomerDecoration\Controller\NotificationController decorates: PrestaShopBundle\Controller\Admin\Sell\Customer\CustomerController arguments: ['@custom_controller.inner'] Here's my class : <?php namespace Test\CustomerDecoration\Controller; use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController; use PrestaShopBundle\Controller\Admin\Sell\Customer\CustomerController; /* Here every others use statements but I removed them for clarity */ class NotificationController extends FrameworkBundleAdminController { /** * @var CustomerController */ private $decoratedController; public function __construct(CustomerController $decoratedController) { $this->decoratedController = $decoratedController; } public function toggleStatusAction($customerId) { var_dump($customerId);die; return $this->decoratedController->toggleStatusAction($customerId); } } I use composer to load my Class and... it worked fine. Somehow. Except this error on the Customer index in the BO : When I declare this method in my NotificationController it works : public function indexAction(Request $request, CustomerFilters $filters) { return $this->decoratedController->indexAction($request, $filters); } But for every other action (edit, view etc) I have to re-declare every methods. So two differents situations : 1 ) I did something wrong with my code. My bad. 2 ) I did well, which means that everytime we have to decorate a controller, we have to declare again almost every methods ? With "old" override system we just have to extends the Class, and add/modify methods and/or attributes. Again if I did right, it's going to be a pain to code in my opinion. So now I'm stuck between those two statements, and I don't know which one is the good one. If anybody has an answer to that, I'll very interested.
  5. Bonjour! Je développe un module, et celui-ci affiche la liste de ma classe/modele entrée en base. J'ai donc un controller qui étend la classe ModuleAdminController, et j'utilise la fonction renderList() pour afficher ma liste. J'override celle-ci ainsi que la fonction displayListContent() de HelperList que j'étend également dans une autre classe. Tout cela pour me permettre d'afficher des thumbnails que je génère avec la fonction thumbnails() de la classe ImageManager. Les thumbnails sont bien présents dans le html à chaque item, et ce dans la colonne voulue : <img src="/shop/img/tmp/advert_mini_1_1.jpg?time=1508507815" alt="" class="imgm img-thumbnail" style="display: none !important;"> Mais le display est verrouillé à none J'ai dans la console l'erreur reproduite pour toutes les img : advert_mini_1_1.jpg Failed to load resource: net::ERR_BLOCKED_BY_CLIENT Est-ce que prestashop bloque l'affichage de toute image qui n'est pas validée d'une certaine façon? Lorsque j'examine le chemin des images dans mon navigateur, je peux afficher l'image en faisant "ouvrir dans un nouvel ongle". Donc le chemin est bon, mais la requête n'abouti pas faute d'autorisation j'imagine? Je suis développeur mais peu familier avec la culture de prestashop. Même après avoir lu la doc, il me reste pas mal de choses à apprendre. Merci d'avance pour toute piste ou suggestion possible!
×
×
  • Create New...