Jump to content

hypnootik

Members
  • Posts

    4
  • Joined

  • Last visited

Contact Methods

Profile Information

  • First Name
    Juha
  • Last Name
    Jurakas

hypnootik's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. Hi I have a minor issue importing 40 000 products using custom import script. Because it does take a lot of time to process and insert all the data, the script just dies half way. Now I could use cron, but its no use because I can not get my script working without calling "init.php" witch then calls http headers witch results the script to die before it has been executed. As far as I understand the problem is that init.php file calls store frontend. Is there any other way to include prestashop core functions without calling init.php file? require($this->store_base_dir . 'config/config.inc.php'); include($this->store_base_dir . 'init.php');
  2. Found the solution for my problem. I was using wrong Hook. The correct hook is actionOrderStatusPostUpdate instead of actionOrderStatusUpdate It is so unfortunate that all this information is lacking from PS official documentation. Would have been so easy, but instead I had to google my way out of this
  3. Hi I am trying to build a module that creates xml file from invoice every time invoice is created. So far the best I came up with is this function in my module. public function hookActionPaymentConfirmation ($params) { $this->hookActionOrderStatusUpdate($params); } public function hookActionOrderStatusUpdate($params) { $order = new Order((int)$params['id_order']); And it executes my module when I change the order status to "payment accepted". Unfortunately I do not get any invoice data ($params) on the first time order status is updated to "payment accepted". I do get the invoice data eventually but only when I chanee order status for the second time. Order Object ( ...... [invoice_number] => 0 I presume this hook is called before invoice is actually generated and therefore I get nothing from $params and are unable to generate xml. What is the correct way to trigger function and get the invoice data?
×
×
  • Create New...