简体   繁体   中英

Prestashop 1.6 Controller override

I know how to override things in Prestashop. I'm trying to override Category Controller to display custom categories (different template with different data).

I copied CategoryController to /modules/mymodule/override/controllers/front and I have module controller at /modules/mymodule/controllers/front/display.php and there's initContent method.

How can I use modified CategoryController in my display.php controller?

You have created two different controllers:

  1. Overriden CategoryController
  2. ModuleController

Using 1. within 2. is nonesense - which means that you do something semantically wrong. If you want to to display custom categories with different template you need only to override the CategoryController, and set the proper template (if you will use two different templates for displaying categories). If you need only one template, just override the controller and change the theme template.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM