How to override prestashop core files

☆樱花仙子☆ 提交于 2019-12-25 01:49:36

问题


Can you please explain how to override following core files properly in presatashop. Prestashop 1.7.1.2 allowed only controllers, modal and tpl files in override folder. We can not override src folders in same way.

src/PrestaShopBundle/Controller/Admin/ProductController.php src/PrestaShopBundle/Resources/views/Admin/Product/form.html.twig


回答1:


I don't believe this is possible in Prestashop 1.7. See their post here : it seems like they want you to use hooks, ie extending not overriding...




回答2:


PrestaShop give you the ability to override core files, you can check the : officiel doc




回答3:


From PS 1.7.3, you can override src views and controllers in a module.

To override this template file:

src/PrestaShopBundle/Resources/views/Admin/Product/form.html.twig

You can add it a module:

modules/<MY-MODULE>/views/PrestaShop/Admin/Product/form.html.twig

Doc PrestaShop for views in a module


And to override this controller file:

src/PrestaShopBundle/Controller/Admin/ProductController.php

You can add it in global override folder:

override/PrestaShop/Controllers/Admin/ProductController.php

Or in a module:

modules/<MY-MODULE>/override/PrestaShop/Controllers/Admin/ProductController.php

Doc PrestaShop for controllers in a module



来源:https://stackoverflow.com/questions/47455188/how-to-override-prestashop-core-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!