Jump to content

ChewieTheWookie

Members
  • Content count

    6
  • Joined

  • Last visited

About ChewieTheWookie

  • Rank
    PrestaShop Newbie
  • Birthday 02/26/1972

Profile Information

  • Gender
    Male
  • Location
    Romania

Contact Methods

  • Website URL
    https://about.me/computershowtopro
  1. Hook only triggered sometimes [SOLVED]

    I don't know how to mark the post / question as solved. I tried that, I can't find any "mark as solved" or any similar button. Could it be because I'm on a linux computer ? I don't see errors in the console, so the pages are loaded fully here. The only moderation action I see is "hide" .
  2. Hook only triggered sometimes [SOLVED]

    I don't know how to mark the post / question as solved.
  3. Hook only triggered sometimes [SOLVED]

    I figured it out. Unfortunately, your suggestions didn't turn out to be valid, but that's ok, thank you anyway for trying to help me. The answer is simple, the hook for displaying the error or confirmation, must not be called upon the order changing, but simply on going to the orders list screen. So the steps to reproduce this are: when the hook for the order status change is triggered, store a value in the configuration table. Then add a hook to the module that gets triggered on the order list page; if the value is let's say... zero, display the result from two other fields and set the same zero to one. If the value is already one... don't do anything. I've succesfully finished the module and I hope it will be available on the marketplace if it will be approved. The customer for whom the module was initially created is actually happy with it.
  4. Hook only triggered sometimes [SOLVED]

    I am aware that this is an action hook. I understand what you say, and how it works. The problem is NOT that the hook doesn't get triggered, as I've later found out, the hook does get triggered every time an order gets updated, It is definitely - at least in this particular case - being called from a place where display IS allowed, at least in form of error messages or warnings, and as I've stated, *sometimes* they do get displayed. The problem is, that a simple confirmation message cannot be sent to that controller or that process (the updating of the order), because, the hook itself and the exec hook "capability" of Prestashop doesn't exactly prescribe a clear way to do this. So... in the meantime, I've played around with 2 more action hooks, actionObjectOrderHistoryAddBefore, and actionObjectOrderHistoryAddAfter, both of them behave the same way, they are triggered just fine, but the $this->adminDisplayWarning('Hook has been triggered') still doesn't get "transmitted" by the hook back to the order modification screen , *only randomly*. I've tried forcing php's ob_flush, tried filling the buffer with larger messages, none seems to result in a clear, straight-forward way of being able to display a confirmation message / warning message of this hook's triggering, on the order status change screen. Any thoughts on that ? What is a clear way of displaying a message from this hook, in the order status change screen. So steps would be... the module registers the hook on install ( actionOrderStatusPostUpdate), and then the function gets triggered whenever an order's status changes. I want that confirmation of this triggering, to be displayed, on the order status change screen. Thanks again
  5. Hi everyone. I was wondering if some of my more experienced colleagues from here can shed some light on why a hook like hookActionOrderStatusUpdate($params) only gets triggered randomly. I wrote a module to do something on any order status change. It's irrelevant what the module does. For simplicity's sake, let's take this example: public function hookActionOrderStatusUpdate($params) { $this->adminDisplayWarning($this->l('Hook has been triggered')); } This alone should be perfectly enough to trigger this message to be displayed *every* time any order's status is changed. But it only triggers the hook sometimes. The module installs correctly, and on install the "hook" is installed correctly, since it does trigger *sometimes*. Update: THE HOOK DOES GET TRIGGERED every time an order's status changes, but the $this->adminDisplayWarning('....') only gets displayed randomly. I've tried setting all caches to off, force recompilation of templates (this shouldn't even matter, because it's directly a hook into another admin screen, order status updates), nothing seems to matter. The hook sometimes gets triggered, sometimes is doesnt. Is this a mysql/database related issue ? Some bug in Prestashop's hook::exec mechanisms ? I am on vers. 1.6.1.17, and the module needs to work on this version, not 1.7.x. Any ideas ? I'm looking forward to potential answers. Thank you !
  6. Unable To Import Using Csv

    Thank you ! Solved my import problem on a 1.6.1.4, too !
×