Jump to content

Display template


Recommended Posts

public function hookdisplayProductAdditionalInfo($params)
  {
    $ajaxUrl = $this->context->link->getAdminLink("AdminModules")."&configure=".$this->name;
    $estado = null;
    //Verifico si está configurada la opción de mostrar el stock de tiendas desde la BD
    $sql = "SELECT valor FROM "._DB_PREFIX_."syncbsale_configuracion
    WHERE atributo = 'showStockStore' ";
    if ($fila = Db::getInstance()->getRow($sql))
    {
      $estado = $fila['valor'];
    }

    //Si esa toda la configuración correcta, se despliega el stock
    if($estado == 1)
    {
      $this->context->smarty->assign('idProduct', Tools::getValue('id_product'));
      $this->context->smarty->assign('baseUrl', __PS_BASE_URI__);
      $this->context->smarty->assign('ajaxUrl', $ajaxUrl);

      $variant = false;
      //Veo si tiene variantes
      $product = new Product(
        (int)Tools::getValue('id_product'),
        true,
        Configuration::get('PS_LANG_DEFAULT')
      );

      $variants = $product->getAttributeCombinations($this->context->language->id);

      if(sizeof($variants) > 0)
      {
        $variant = true;
      }

      $this->context->smarty->assign('variant', $variant);


      //return $this->display(__FILE__, 'stockstoreproduct.tpl');
      return $this->setTemplate('module:syncModule/views/templates/hook/stockstoreproduct.tpl');     // THIS LINE TO DISPLAY TEMPLATE BUT IN FRONT END CANT SEE NOTHING IN PS 1.7
    }                                                                                                                                                                                                         // IN PS 1.6 WORK OK
  }

 

 

MODULE SHOW STOCK AVAILABILITY

 

image.thumb.png.793c5bf1a454128556b9cb227c716088.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...