Jump to content

Kazeno

Members
  • Posts

    5
  • Joined

  • Last visited

Contact Methods

Profile Information

  • Location
    London
  • Activity
    Freelancer

Recent Profile Visitors

2,088,551 profile views

Kazeno's Achievements

Newbie

Newbie (1/14)

  • Dedicated Rare
  • One Month Later Rare
  • One Year In Rare
  • Week One Done Rare

Recent Badges

28

Reputation

  1. One of my clients had this exact problem when trying to generate PDF invoices, and it turned out that one of the template tpl files was missing from his /pdf folder. In this case it was "pagination.tpl", but there are multiple auxiliary tpls that are used by different controllers, and can thus generate that same error. If the problem was on the homepage instead, then I would suspect that the same thing happened to some of the template tpls in the themes/{your_theme_name} folder.
  2. Not trying to upset Mr. Moderator over here, but his answer was pretty useless, so here's one of my own. Action hooks are pretty much used the same way as the other ones, i.e. assuming you're writing a module, you must first register the hook on install() like this: public function install() { //... stuff here $this->registerHook('actionValidateOrder'); //... other stuff here } Then you add another method to your module's class, named after your hook, beginning with the word "hook" and all in camelCase: public function hookActionValidateOrder($params) { //the thing you want to do when the hook's executed goes here } The $params array is populated by the function that executes the hook, so you must find it to know what gets passed to it. In this case it's executed by classes/PaymentModule.php, in the following lines: // Hook validate order Hook::exec('actionValidateOrder', array( 'cart' => $this->context->cart, 'order' => $order, 'customer' => $this->context->customer, 'currency' => $this->context->currency, 'orderStatus' => $order_status )); As you can see, in this case it's passed some objects related to the order. Let's say you want to get the id of the carrier related to the order, then your hook function becomes: public function hookActionValidateOrder($params) { $carrier_id = $params['cart']->id_carrier; //do whatever with the carrier } Hope this makes it clearer.
  3. Hi, turns out this is not a bug, but a "feature": the only modules that appear at the top of the Payment tab are the ones sanctioned by Prestashop, i.e. made by themselves or by their "Certified Partners". The modules list is retrieved from http://api.prestashop.com/xml/tab_modules_list.xml and is cached in config/xml/tab_modules_list.xml in your store directory. You could temporarily add your module to this file, but it's gonna be erased next time the system refreshes (redownloads) it. You could try adding a custom hook to run after AdminController->refresh() so that it re-adds your module to the file after each refresh, but I don't think the Prestashop Addons team would accept such a hack if you want to sell your module in their store.
×
×
  • Create New...