ajout picto listing
This commit is contained in:
parent
1dce6f94c5
commit
7e029cc2dc
@ -162,11 +162,17 @@ class AdvPicto extends Module
|
|||||||
public function hookDisplayPictogrammesProduct($params)
|
public function hookDisplayPictogrammesProduct($params)
|
||||||
{
|
{
|
||||||
$id_product = $params['id_product'];
|
$id_product = $params['id_product'];
|
||||||
|
$is_listing = $params['is_listing'];
|
||||||
$pictos = AdvPictoClass::getPictosForProductDetails($id_product);
|
$pictos = AdvPictoClass::getPictosForProductDetails($id_product);
|
||||||
|
|
||||||
$this->smarty->assign('pictos', $pictos);
|
$this->smarty->assign('pictos', $pictos);
|
||||||
|
|
||||||
return $this->display(__FILE__, 'product.tpl');
|
if($is_listing)
|
||||||
|
{
|
||||||
|
return $this->display(__FILE__, 'category.tpl');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return $this->display(__FILE__, 'product.tpl');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -183,9 +183,11 @@ class AdvPictoClass extends ObjectModel
|
|||||||
public static function getPictosForProductDetails($id_product = null)
|
public static function getPictosForProductDetails($id_product = null)
|
||||||
{
|
{
|
||||||
$context = Context::getContext();
|
$context = Context::getContext();
|
||||||
|
|
||||||
|
$id_product = (int) $id_product;
|
||||||
if(!empty($id_product) && is_int($id_product))
|
if(!empty($id_product) && is_int($id_product))
|
||||||
{
|
{
|
||||||
|
|
||||||
$query = '
|
$query = '
|
||||||
SELECT DISTINCT(advp.`id_advpicto`), `title`
|
SELECT DISTINCT(advp.`id_advpicto`), `title`
|
||||||
FROM `'._DB_PREFIX_.'advpicto_product` advp
|
FROM `'._DB_PREFIX_.'advpicto_product` advp
|
||||||
|
@ -2874,6 +2874,7 @@ main#categorycms { margin-bottom: 30px }
|
|||||||
font-family: 'pompiere_regular';
|
font-family: 'pompiere_regular';
|
||||||
color: #666666;
|
color: #666666;
|
||||||
}
|
}
|
||||||
|
|
||||||
#product .pictos .picto:nth-child(odd) { padding-right: 5px; }
|
#product .pictos .picto:nth-child(odd) { padding-right: 5px; }
|
||||||
#product .pictos .picto:nth-child(even) { padding-left: 5px; }
|
#product .pictos .picto:nth-child(even) { padding-left: 5px; }
|
||||||
#product .pictos .picto div {
|
#product .pictos .picto div {
|
||||||
|
@ -503,6 +503,21 @@ header.page-heading.order-process { padding: 25px 0 0 0 }
|
|||||||
.product-container .btn {
|
.product-container .btn {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.product-container .pictos {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
.product-container .pictos li {
|
||||||
|
width: auto;
|
||||||
|
margin-right: 1%;
|
||||||
|
display: inline-block;
|
||||||
|
height: 38px;
|
||||||
|
max-width: 30%;
|
||||||
|
}
|
||||||
|
.product-container .pictos li img {
|
||||||
|
max-height: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
.product-container:hover .btn {
|
.product-container:hover .btn {
|
||||||
background: #6ac5bb none repeat scroll 0 0;
|
background: #6ac5bb none repeat scroll 0 0;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
{if $pictos}
|
||||||
|
<ul class="pictos">
|
||||||
|
{foreach from=$pictos item=picto name=picto}
|
||||||
|
{if $picto.hasImg}
|
||||||
|
<li>
|
||||||
|
<img src="{$base_dir}img/picto/{$picto.id_advpicto}.jpg" alt="{$picto.title}" />
|
||||||
|
</li>
|
||||||
|
{/if}
|
||||||
|
{/foreach}
|
||||||
|
</ul>
|
||||||
|
{/if}
|
@ -25,7 +25,8 @@
|
|||||||
<a class="product-img" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">
|
<a class="product-img" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">
|
||||||
<img class="img-responsive" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html':'UTF-8'}" alt="{$product.name|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="image" />
|
<img class="img-responsive" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html':'UTF-8'}" alt="{$product.name|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="image" />
|
||||||
</a>
|
</a>
|
||||||
{hook h='displayPictogrammesCategory' id_product=$product.id}
|
{hook h='displayPictogrammesProduct' id_product=$product.id_product is_listing='true'}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-7 product-infos">
|
<div class="col-md-7 product-infos">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user