Jump to content

Nocebo

Members
  • Content count

    58
  • Joined

  • Last visited

About Nocebo

  • Rank
    PrestaShop Apprentice

Profile Information

  • Activity
    Other
  1. I still have not found a solution to my problem
  2. Hello everyone, To validate my module I must remove javascript from my PHP file public function headerHTML() { if (Tools::getValue('controller') != 'AdminModules' && Tools::getValue('configure') != $this->name) { return; } $this->context->controller->addJqueryUI('ui.sortable'); /* Style & js for fieldset 'slides configuration' */ $html = '<SCRIPT type="text/javascript"> $(function() { var $mySlides = $("#slides"); $mySlides.sortable({ opacity: 0.6, cursor: "move", update: function() { var order = $(this).sortable("serialize") + "&action=updateSlidesPosition"; $.post("'.$this->context->shop->physical_uri.$this->context->shop->virtual_uri.'modules/'.$this->name.'/ajax_'.$this->name.'.php?secure_key='.$this->secure_key.'", order); } }); $mySlides.hover(function() { $(this).css("cursor","move"); }, function() { $(this).css("cursor","auto"); }); }); </SCRIPT>'; return $html; } When I integrate this javascript into a .TPL or .js file these variables are not interpreted $mySlides = $("#slides"); $mySlides.sortable $.post("'.$this->context->shop->physical_uri.$this->context->shop->virtual_uri.'modules/'.$this->name.'/ajax_'.$this->name.'.php?secure_key='.$this->secure_key.'", order); $(this) How to do, I searched a lot on google, but without success for now
  3. problem with validator

    Hello everyone, I tried to validate my module but impossible with this : public function headerHTML() { if (Tools::getValue('controller') != 'AdminModules' && Tools::getValue('configure') != $this->name) { return; } $this->context->controller->addJqueryUI('ui.sortable'); /* Style & js for fieldset 'slides configuration' */ $html = '<script type="text/javascript"> $(function() { var $mySlides = $("#slides"); $mySlides.sortable({ opacity: 0.6, cursor: "move", update: function() { var order = $(this).sortable("serialize") + "&action=updateSlidesPosition"; $.post("'.$this->context->shop->physical_uri.$this->context->shop->virtual_uri.'modules/'.$this->name.'/ajax_'.$this->name.'.php?secure_key='.$this->secure_key.'", order); } }); $mySlides.hover(function() { $(this).css("cursor","move"); }, function() { $(this).css("cursor","auto"); }); }); </script>'; return $html; } I try to play java in a tpl or js, but this is not interpreted Thank for your help
  4. Hello, I created a theme under prestashop 1.7 and when I export it and install it elsewhere it's a disaster The position of the modules is not correct Modules are not activated .... Is there a way to export a theme correctly?
  5. Module validation

    Thank for your reply. that's what I did public function hookActionAdminControllerSetMedia() { $this->context->controller->addJs($this->_path.'views/js/admin.js'); } JS : $(function() { var $myimgs = $("#imgs"); $myimgs.sortable({ opacity: 0.6, cursor: "move", update: function() { var order = $(this).sortable("serialize") + "&action=updateimgsPosition"; $.post("'.$this->context->shop->physical_uri.$this->context->shop->virtual_uri. 'modules/ps_Module/ajax_ps_Module.php?secure_key='.$this->secure_key.'", order); } }); $myimgs.hover(function() { $(this).css("cursor","move"); }, function() { $(this).css("cursor","auto"); }); }); But the link is not good
  6. Module validation

    Thank you for your help. Could you give me an example. plz 1053: return '<P class="alert alert-warning">'. protected function getWarningMultishopHtml() { if (Shop::getContext() == Shop::CONTEXT_GROUP || Shop::getContext() == Shop::CONTEXT_ALL) { return '<p class="alert alert-warning">' . $this->getTranslator()->trans( 'You cannot manage image from a "All Shops" or a "Group Shop", select the shop to edit', array(), 'Modules.homeimgpromo.Admin' ) . '</p>'; } else { return ''; } }
  7. Hello everyone, I'm trying to validate a module, but it sends me an error The use of smarty templates is mandatory to display HTML. Your PHP code should not contain HTML. I wrote to the support, they told me : remove the displayed HTML tags : 721: $html = '<script type="text/javascript"> 1053: return '<p class="alert alert-warning">'. $html = '<a class="btn '.$class.'" href="'.AdminController::$currentIndex. '&configure='.$this->name. '&token='.Tools::getAdminTokenLite('AdminModules'). '&changeStatus&id_img=' .(int)$id_img.'" title="'.$title.'"><i class="'.$icon.'"></i> '.$title.'</a>'; I need these elements, I do not know how to modify them to be accepted thank you in advance for your help
  8. I have same problem The use of smarty templates is mandatory to display HTML. Your PHP code should not contain HTML Please help me
  9. Hello, I created a module and when I reset it, the images are deleted in the folder. thank you in advance for your help
  10. Hello, I created a module that I install in this hook $this->registerHook('displayHome') He settles down at the bottom of this hook, but I would like to tell him to go to the top Thank for your help
  11. problem with validator

    Thank you very much for your truly valuable help
  12. problem with validator

    Thank you for your answer, I do not think the validation team accepts a module with errors, even if there is a little.
  13. problem with validator

    Thank a lot for your help. I have almost finished all the transformation of the module and the correction Unused function parameter $hookName. Unused function parameter $configuration. ··public·function·getWidgetVariables($hookName,·array·$configuration) But if I remove it the module does not install anymore
  14. problem with validator

    Thank you for your answer. I'm abusing asking you for this public·function·renderWidget($hookName·=·null,·array·$configuration·=·[])
  15. problem with validator

    When I do this the module does not install anymore ['media' => 'all', 'priority' => 150] ('media' => 'all', 'priority' => 150)
×