Jump to content

Edit History

Alexandre Carette

Alexandre Carette

Salut,

public function install()
    {
      if (Shop::isFeatureActive()) {
        Shop::setContext(Shop::CONTEXT_ALL);
      }
    
      if (!parent::install() ||
        !$this->registerHook('footer') ||
        !$this->registerHook('header') ||
		!$this->registerHook('monHook') ||
        !Configuration::updateValue('MYMODULE_NAME', 'my friend')
      ) {
        return false;
      }
    
      return true;
    }
 public function hookDisplayMonHook($params)
    {
      $this->context->smarty->assign(
          array(
              'mavariable' => $this->getMyVariable(),
              
          )
      );
      return $this->display(__FILE__, 'mymodule.tpl');
    }
private function getmavariable(){

  $sql = "SELECT "."_DB_PREFIX_"."order_detail.product_name,"."_DB_PREFIX_"."customer.firstname,"."_DB_PREFIX_"."address.city,"."_DB_PREFIX_"."customer.lastname,DATE_FORMAT("."_DB_PREFIX_"."orders.date_add, '%d/%m/%Y')  
  FROM"."_DB_PREFIX_"."orders
  INNER JOIN"."_DB_PREFIX_"."customer ON "."_DB_PREFIX_"."orders.id_customer= "."_DB_PREFIX_"."customer.id_customer 
  INNER JOIN"."_DB_PREFIX_"."address ON "."_DB_PREFIX_"."orders.id_address_delivery= "."_DB_PREFIX_"."address.id_address 
  INNER JOIN"."_DB_PREFIX_"."order_detail ON "."_DB_PREFIX_"."order_detail.id_order= "."_DB_PREFIX_"."_orders.id_order
  WHERE"."_DB_PREFIX_"."orders.date_add BETWEEN" ."$helper"."and NOW() limit 1";

  return Db::getInstance()->executeS($sql);

}

je ne suis pas sur de la derniere fonction mais teste ca deja

ensuite tu appelle ton hook  dans ton tpl avec {hook h=''monHook}

 

cordialement

Alexandre Carette

Alexandre Carette

Salut,

public function install()
    {
      if (Shop::isFeatureActive()) {
        Shop::setContext(Shop::CONTEXT_ALL);
      }
    
      if (!parent::install() ||
        !$this->registerHook('footer') ||
        !$this->registerHook('header') ||
		!$this->registerHook('monHook') ||
        !Configuration::updateValue('MYMODULE_NAME', 'my friend')
      ) {
        return false;
      }
    
      return true;
    }
 public function hookDisplayMonHook($params)
    {
      $this->context->smarty->assign(
          array(
              'mavariable' => $this->getMyVariable(),
              
          )
      );
      return $this->display(__FILE__, 'mymodule.tpl');
    }
private function getmavariable(){

  $sql = "SELECT "."_DB_PREFIX_"."order_detail.product_name,"."_DB_PREFIX_"."customer.firstname,"."_DB_PREFIX_"."address.city,"."_DB_PREFIX_"."customer.lastname,DATE_FORMAT("."_DB_PREFIX_"."orders.date_add, '%d/%m/%Y')  
  FROM"."_DB_PREFIX_"."orders
  INNER JOIN"."_DB_PREFIX_"."customer ON "."_DB_PREFIX_"."orders.id_customer= "."_DB_PREFIX_"."customer.id_customer 
  INNER JOIN"."_DB_PREFIX_"."address ON "."_DB_PREFIX_"."orders.id_address_delivery= "."_DB_PREFIX_"."address.id_address 
  INNER JOIN"."_DB_PREFIX_"."order_detail ON "."_DB_PREFIX_"."order_detail.id_order= "."_DB_PREFIX_"."_orders.id_order
  WHERE"."_DB_PREFIX_"."orders.date_add BETWEEN" ."$helper"."and NOW() limit 1";

  return Db::getInstance()->executeS($sql);

}

je ne suis pas sur de la derniere fonction mais teste ca deja

ensuite tu appelle ton hook  dans ton tpl avec {hook h=''monHook}

Alexandre Carette

Alexandre Carette

Salut,

public function install()
    {
      if (Shop::isFeatureActive()) {
        Shop::setContext(Shop::CONTEXT_ALL);
      }
    
      if (!parent::install() ||
        !$this->registerHook('footer') ||
        !$this->registerHook('header') ||
		!$this->registerHook('monHook') ||
        !Configuration::updateValue('MYMODULE_NAME', 'my friend')
      ) {
        return false;
      }
    
      return true;
    }
 public function hookDisplayMonHook($params)
    {
      $this->context->smarty->assign(
          array(
              'mavariable' => $this->getMyVariable(),
              
          )
      );
      return $this->display(__FILE__, 'mymodule.tpl');
    }
private function getmavariable(){

  $sql = "SELECT "."_DB_PREFIX_"."order_detail.product_name,"."_DB_PREFIX_"."customer.firstname,"."_DB_PREFIX_"."address.city,"."_DB_PREFIX_"."customer.lastname,DATE_FORMAT("."_DB_PREFIX_"."orders.date_add, '%d/%m/%Y')  
  FROM"."_DB_PREFIX_"."orders
  INNER JOIN"."_DB_PREFIX_"."customer ON "."_DB_PREFIX_"."orders.id_customer= "."_DB_PREFIX_"."customer.id_customer 
  INNER JOIN"."_DB_PREFIX_"."address ON "."_DB_PREFIX_"."orders.id_address_delivery= "."_DB_PREFIX_"."address.id_address 
  INNER JOIN"."_DB_PREFIX_"."order_detail ON "."_DB_PREFIX_"."order_detail.id_order= "."_DB_PREFIX_"."_orders.id_order
  WHERE"."_DB_PREFIX_"."orders.date_add BETWEEN" ."$helper"."and NOW() limit 1";

  return Db::getInstance()->ExecuteS($sql);

}

je ne suis pas sur de la derniere fonction mais teste ca deja

ensuite tu appelle ton hook  dans ton tpl avec {hook h=''monHook}

×
×
  • Create New...