Jump to content

LightlynX

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by LightlynX

  1. Thank you, phinq1910, that is the correct solution. 

     

    I tried also the solution on StackOverflow:

    $this->registerJavascript('remote-bootstrap', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js', ['server' => 'remote', 'position' => 'bottom', 'priority' => 20]);

    But it doesn't work and I get PHP Fatal Error:

    Uncaught Error: Call to undefined method Ptm_Testimonials::registerJavascript()

    I run on Prestashop 1.7.0.2

    Do you extend a controller? registerJavascript is a member of Controller class. Therefore you either extend some the controller class or you acquire your context and access its controller where you can acces the member method registerJavascript. e.g.

    $context = $this->getContext();
    $context->controller->registerJavascript(...);
    

    I hope this clears something for you.

    • Like 1
  2. Hello arnaud,

     

    ps 1.7.0.2 actually solves this problem. The developer named aleeks made a pull request which was merged few days ago and it does indeed support the remote resource loading. Have a look at http://stackoverflow.com/questions/40763815/add-remote-javascript-to-prestashop-1-7/41000834#41000834 Or to be more specific https://github.com/PrestaShop/PrestaShop/pull/7022

     

    I hope this answer brings smile to all our faces :)

    • Like 2
  3. Hello fellows,
     
    I am having troubles getting our "old" plugin to work with the new Prestashop 1.7
    The method addJs doesn't include the scripts anymore and the new method registerJavascript doesn't allow urls e.g. cdnjs
    I solved it that I added the script tag to the template which is quite a bad practice, but I really didn't know how to work around it.
     
    Another issue is regarding the setForm in PaymentOption class. When I load the tplcontaining the form and add a listener to the form (onsubmit) then the form doesn't get submitted as the documentation says in the github.

     

    Does anybody have these issues too?

  4. I am having similar problem too! Yesterday I decided to programm a payment module and I was mostly successful. Everything worked like a charm, until I looked inside the order finally and I have seen that warning. Where is the second payment coming from???? I am adding a transaction number to my orders and my order doesn't have the invoice whereas the other one, not generated by me, has one. Please point me to a point, where I could start searching. I am slowly going crazy because of this 

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More