创建模块 prestashop 1.7 在客户端验证订单后启动

create module prestashop 1.7 launch after the client validate the order

我想知道如何在客户端验证订单并在数据库中插入 id_order 和 order_state 后创建模块 prestashop 1.7 启动这是我现在尝试的但仅用于测试我尝试使用验证顺序,但是钩子验证顺序没有任何 $parms 然后请你帮忙,抱歉我的英语不好

<?php

if (!defined('_PS_VERSION_'))
{
  exit;
}


class VanmieghemFlux extends Module
{

  public function __construct()
  {
      $this->name = 'vanmieghemflux';
      $this->tab = 'front_office_features';
      $this->version = '1.0.0';
      $this->author = ' DK group';
      $this->need_instance = 0;
      $this->ps_versions_compliancy = array('min' => '1.7.0.0', 'max' => _PS_VERSION_);
      $this->bootstrap = true;

      parent::__construct();

      $this->displayName = $this->l('vanmieghemflux');
      $this->description = $this->l('Automatisation des flux');

      $this->confirmUninstall = $this->l('Êtes-vous sur de vouloir désinstaller?');


  }

  public function install()
  {
    if (!parent::install() || !$this->registerHook('displayLeftColumn'))
      return false;
    return true;
  }

  public function uninstall()
  {
    if (!parent::uninstall())
      return false;
    return true;
  }

  public function getContent()
  {

      return "test return";
  }

  public function hookdisplayLeftColumn($params)
  {


    return "test return";
  }


}

?>

你必须使用hookActionValidateOrder,在$params中有你需要的一切:

public function hookActionValidateOrder($params)
{
    $cart = $params['cart']; // The cart object
    $order_status = $params['orderStatus']; // The order status
    $order = $params['order']; // And the order object

    $order->id; // This is the id order
}

检查 CartOrder class 以了解您可以使用该对象做什么。

希望对您有所帮助:)