Jump to content

briast

New Members
  • Posts

    11
  • Joined

  • Last visited

briast's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. When I create a specific price condition through webservice, It's created good and I can see It on product's page. But, sometimes, the discount doesn't work and is not applied. But if I edit the condition in the product page and I save it without any change, It begins to be applied. Is there any cache or function I should clear or call after a condition is created in order to get it running well?
  2. I use webservices to synchronize my ERP with PrestaShop, but I have a problem with specific price rules because I can add the rule (using specific_price_rule webservice), but I don't know how can I add the conditions of this rule (for example some categories or brands, that applied to this rule). I have reviewed all available webservices but I don't see anyone to do it. Is it possible?
  3. I can't believe it. It works like a charm. The error is gone. Thanks for your help.
  4. Before posting my question, I've tried all combinations I have found in internet. With this, I get the same error. I need my own url with parameters.
  5. Yes. It's enabled. I don't know why it throws this exception. No template found for ../public_html/modules/mymodule/views/templates/front/myfunction.tpl when this tpl file exists and It is in this folder.
  6. I have searched and found several posts about this topic, but none helped me. When I navigate to the controller url, I get "No template found" error. But the template is created and assigned. The url is something like this: <mydomain>/index.php?catId=1234&fc=module&module=mymodule&controller=myfunction This is my very simple module and folder structure: modules/mymodule/mymodule.php <?php if (!defined('_PS_VERSION_')) { exit; } class mymodule extends Module { public function __construct() { $this->name = 'mymodule'; $this->tab = 'front_office_features'; $this->version = '1.0.0'; $this->author = 'Tester'; $this->need_instance = 0; $this->ps_versions_compliancy = array( 'min' => '1.7.0.0', 'max' => _PS_VERSION_ ); $this->bootstrap = true; $this->controllers = array('myfunction'); parent::__construct(); $this->displayName = $this->trans('MyModule', array(), 'Modules.Mainmenu.Admin'); $this->description = $this->trans('My first simple module', array(), 'Modules.Mainmenu.Admin'); $this->confirmUninstall = $this->l('Do you want to uninstall?'); } public function install() { if (version_compare(_PS_VERSION_,'1.5','>=')) { if (Shop::isFeatureActive()) Shop::setContext(Shop::CONTEXT_ALL); } return parent::install(); } public function uninstall() { return parent::uninstall(); } public function getContents() { echo "Step 1"; } public function hookDisplayHome($params) { $this->context->smarty->assign( 'moduleLink', $this->context->link->getModuleLink( $this->name, 'myfunction', array('catId' => 1337 ) ) ); return $this->display(__FILE__, 'views/templates/hook/testfrontctrl.tpl'); } } modules/mymodule/controllers/front/myfunction.php <?php class mymodulemyfunctionModuleFrontController extends ModuleFrontController { public function __construct() { parent::__construct(); } public function init() { $this->page_name = 'myfunction'; $this->display_column_left = false; $this->display_column_right = false; parent::init(); } public function initContent() { parent::initContent(); // Do some process echo 'RESULT OK : ' . Tools::getValue('catId'); $this->setTemplate(_PS_MODULE_DIR_.'mymodule/views/templates/front/myfunction.tpl'); } } modules/mymodule/views/templates/front/myfunction.tpl modules/mymodule/views/templates/hook/testfrontctrl.tpl (both same content) <h2>Hello world</h2>
  7. Hello. I'm starting with module development and I would like to make a module that register a new path (url + parameters) and when a user navigate to this url you'll see a page that print the parameters. That is, create a custom route and a controller that responds to this route with parameters. I think it's very simple, but I haven't found some instrucctions about how to do it.
  8. Hola. Estoy empezando con el desarrollo de módulos y querría crear uno muy básico en el que pueda crear una ruta url personalizada que reciba parámetros y que al hacer un GET a dicha url me muestre por pantalla los parámetros recibidos. He estado leyendo la documentación, en especial la creación del controlador en https://devdocs.prestashop.com/1.7/modules/concepts/controllers/front-controllers/, pero no consigo encontrar como crear mi propia ruta y responder a ella por código. Imagino que esto es algo muy básico pero no encuentro forma de hacerlo. Gracias.
  9. I have successfully added products and its images using webservices following the documentation, but now I need to add files, that could be downloaded, for some products. There is a field, in products, for files, but I can't find a way to upload it through webservices. How could I do it?
×
×
  • Create New...