简体   繁体   中英

Prestashop 1.6.x module custom endpoints

I'm developing module for PrestaShop, I've got my own views made in Vue.js (register, login, settings etc. pages) and I need custom endpoints in my module to comunicate with my views. I would like to avoid overriding core files in Presta. How to create some custom endpoints for my module?

Create a PHP file in the module, for example, endpoint.php

<?php
include(dirname(__FILE__).'/../../config/config.inc.php');

After this, you will able to use any PrestaShop function and syntax like any other class file.

It is possible to use the Prestashop Webservice, that allows to add resources for modules. This solution could save some time in terms of standards and security.

This is the documentation for Prestashop Webservice, for versions 1.6 and 1.7: https://devdocs.prestashop.com/1.7/webservice/ https://doc.prestashop.com/display/PS16/Using+the+PrestaShop+Web+Service

The documentation regarding module resources in Prestashop Webservice is in this link:

https://webkul.com/blog/creating-prestashop-module-webservice-api/

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