Cleanup
This commit is contained in:
parent
46cfa2b8f3
commit
75c06c7853
@ -68,48 +68,26 @@ class HTMLTemplateOffredefideliteCore extends HTMLTemplate
|
|||||||
// die();
|
// die();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the template's HTML content
|
|
||||||
* @return string HTML content
|
|
||||||
*/
|
|
||||||
public function getItemsProducts2()
|
|
||||||
{
|
|
||||||
// if(Tools::getValue('id_product'))
|
|
||||||
// $id_product=Tools::getValue('id_product');
|
|
||||||
// $id_shop = $this->context->shop->id;
|
|
||||||
$id_lang = Context::getContext()->language->id;
|
|
||||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
|
||||||
SELECT distinct(p.`id_product`), pl.name, pl.link_rewrite,cl.name as categoryName,c.id_category,p.id_category_default
|
|
||||||
FROM '._DB_PREFIX_.'product p
|
|
||||||
LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_lang = '.(int)$id_lang.' and p.id_product = pl.id_product)
|
|
||||||
LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_lang = '.(int)$id_lang.' and p.id_category_default = cl.id_category)
|
|
||||||
LEFT JOIN '._DB_PREFIX_.'category c ON (cl.id_category = c.id_category)
|
|
||||||
WHERE c.id_category!=12
|
|
||||||
and c.id_category!=13
|
|
||||||
and c.id_category!=14
|
|
||||||
and c.id_category!=15
|
|
||||||
and c.id_category!=16
|
|
||||||
and c.id_category!=17
|
|
||||||
ORDER BY c.position asc,pl.name asc');
|
|
||||||
}
|
|
||||||
public function getItemsProducts()
|
public function getItemsProducts()
|
||||||
{
|
{
|
||||||
$id_lang = Context::getContext()->language->id;
|
$id_shop = $this->context->shop->id;
|
||||||
$sql='
|
$id_lang = $this->context->language->id;
|
||||||
|
$id_category = Configuration::get('PS_CATEGORY_FIDELITY');
|
||||||
|
$sql = '
|
||||||
SELECT distinct(p.`id_product`), pl.name, pl.link_rewrite,cl.name as categoryName,c.id_category,p.id_category_default
|
SELECT distinct(p.`id_product`), pl.name, pl.link_rewrite,cl.name as categoryName,c.id_category,p.id_category_default
|
||||||
FROM '._DB_PREFIX_.'category_product cp
|
FROM '._DB_PREFIX_.'category_product cp
|
||||||
LEFT JOIN '._DB_PREFIX_.'category c ON (cp.id_category = c.id_category)
|
LEFT JOIN '._DB_PREFIX_.'category c ON (cp.id_category = c.id_category)
|
||||||
LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_lang = '.(int)$id_lang.' and c.id_category = cl.id_category)
|
LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_lang = '.(int)$id_lang.' and c.id_category = cl.id_category)
|
||||||
LEFT JOIN '._DB_PREFIX_.'product p ON (p.id_product = cp.id_product)
|
LEFT JOIN '._DB_PREFIX_.'product p ON (p.id_product = cp.id_product)
|
||||||
LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_lang = '.(int)$id_lang.' and p.id_product = pl.id_product)
|
LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_lang = '.(int)$id_lang.' and p.id_product = pl.id_product)
|
||||||
WHERE cp.id_category=3
|
WHERE c.id_category = '.(int)$id_category.'
|
||||||
or cp.id_category=4
|
AND p.active = 1
|
||||||
ORDER BY cl.name desc,cp.position asc,pl.name asc';
|
ORDER BY cl.name desc,cp.position asc,pl.name asc';
|
||||||
$products= Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
|
||||||
// echo $sql;
|
$products = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||||
// print_r($products);
|
return $products;
|
||||||
return $products;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getContent()
|
public function getContent()
|
||||||
{
|
{
|
||||||
// $country = new Country((int)$this->order->id_address_invoice);
|
// $country = new Country((int)$this->order->id_address_invoice);
|
||||||
@ -128,7 +106,7 @@ class HTMLTemplateOffredefideliteCore extends HTMLTemplate
|
|||||||
'days' => $days
|
'days' => $days
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->smarty->assign('generationProduits',self::getItemsProducts());
|
$this->smarty->assign('productFidelity', self::getItemsProducts());
|
||||||
// print_r($this->offredefidelite);
|
// print_r($this->offredefidelite);
|
||||||
// die();
|
// die();
|
||||||
$this->smarty->assign(
|
$this->smarty->assign(
|
||||||
|
@ -95,22 +95,6 @@ class OffrefideliteControllerCore extends FrontController
|
|||||||
' AND hss.`en_avant` = 1
|
' AND hss.`en_avant` = 1
|
||||||
ORDER BY hss.position');
|
ORDER BY hss.position');
|
||||||
}
|
}
|
||||||
public function getItemsProducts2()
|
|
||||||
{
|
|
||||||
// if(Tools::getValue('id_product'))
|
|
||||||
// $id_product=Tools::getValue('id_product');
|
|
||||||
$id_shop = $this->context->shop->id;
|
|
||||||
$id_lang = $this->context->language->id;
|
|
||||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
|
||||||
SELECT distinct(p.`id_product`), pl.name, pl.link_rewrite,cl.name as categoryName,c.id_category,p.id_category_default
|
|
||||||
FROM '._DB_PREFIX_.'product p
|
|
||||||
LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_lang = '.(int)$id_lang.' and p.id_product = pl.id_product)
|
|
||||||
LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_lang = '.(int)$id_lang.' and p.id_category_default = cl.id_category)
|
|
||||||
LEFT JOIN '._DB_PREFIX_.'category c ON (cl.id_category = c.id_category)
|
|
||||||
WHERE c.id_category = 31
|
|
||||||
AND active = 1
|
|
||||||
ORDER BY c.position asc,pl.name asc');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getItemsProducts()
|
public function getItemsProducts()
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,11 @@
|
|||||||
</table>
|
</table>
|
||||||
<p><br/><br/><strong>{l s='- Cochez votre indice de satisfaction sur les produits que vous avez testés :'}</strong>
|
<p><br/><br/><strong>{l s='- Cochez votre indice de satisfaction sur les produits que vous avez testés :'}</strong>
|
||||||
<br/>{l s='1 = Très satisfaite, 2 = Satisfaite, 3 = Assez satisfaite, 4 = Pas du tout satisfaite'}</p>
|
<br/>{l s='1 = Très satisfaite, 2 = Satisfaite, 3 = Assez satisfaite, 4 = Pas du tout satisfaite'}</p>
|
||||||
{if $generationProduits|@count>0}
|
{if $productFidelity|@count>0}
|
||||||
{assign var=idCategory value=0}
|
{assign var=idCategory value=0}
|
||||||
<table class="produits">
|
<table class="produits">
|
||||||
<tbody>
|
<tbody>
|
||||||
{foreach from=$generationProduits item=produit}
|
{foreach from=$productFidelity item=produit}
|
||||||
{if $idCategory!=$produit.id_category}
|
{if $idCategory!=$produit.id_category}
|
||||||
{assign var=idCategory value=$produit.id_category}
|
{assign var=idCategory value=$produit.id_category}
|
||||||
<tr>
|
<tr>
|
||||||
|
Loading…
Reference in New Issue
Block a user