Jump to content


Photo

Extra information products


  • Please log in to reply
16 replies to this topic

#1 totti240282

totti240282

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts

Posted 27 November 2014 - 08:30 AM

How can I add the information of stock as in this picture ?

Attached Files



looking for the best presta addons with outstanding support? check this: PrestaShop Modules

#2 totti240282

totti240282

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts

Posted 10 January 2015 - 01:19 PM

Where should put exactly?

Thank You.



#3 totti240282

totti240282

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts

Posted 14 January 2015 - 10:40 PM

Help ?



#4 vekia

vekia

    Advanced Member

  • Members
  • PipPipPip
  • 10166 posts

Posted 19 January 2015 - 12:38 AM

Hello,

 

product-list.tpl

 

right below:

<img class="replace-2x img-responsive" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html':'UTF-8'}" alt="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" title="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} itemprop="image" />

paste this:

{if $product.quantity >0}<div class='instock'>{l s='in stock'}</div>{else}<div class='outofstock'>{l s='in stock'}</div>{/if}

 

.instock {

background:green;

color:white;

padding:5px 10px;

position:absolute;

bottom:0px;

right:0px;

}

 

.outofstock {

background:red;

color:white;

padding:5px 10px;

position:absolute;

bottom:0px;

right:0px;

}

 

effect:

m8QXN8y.png


free tutorials, free templates, free addons, prestashop modules MndfRK4.png  lpHMrZ5.png  gtKHYO7.png  google-48.png


#5 totti240282

totti240282

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts

Posted 19 January 2015 - 10:41 AM

Many Many Many Thankssssssssssssssssss !



#6 vekia

vekia

    Advanced Member

  • Members
  • PipPipPip
  • 10166 posts

Posted 19 January 2015 - 11:00 AM

i added there information about out of stock too (it will appear with red background)

if you want to remove it, just remove code:
 

{else}<div class='outofstock'>{l s='in stock'}</div>

free tutorials, free templates, free addons, prestashop modules MndfRK4.png  lpHMrZ5.png  gtKHYO7.png  google-48.png


#7 totti240282

totti240282

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts

Posted 19 January 2015 - 11:13 AM

is perfect, even if I would like to add us free shipping ?



#8 totti240282

totti240282

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts

Posted 19 January 2015 - 11:16 AM

or even better, since it is not expected to PS, how can I make the products not available in light gray ?



#9 vekia

vekia

    Advanced Member

  • Members
  • PipPipPip
  • 10166 posts

Posted 19 January 2015 - 11:23 AM

you mean that you want to do somethnig like:
ppKMqxJ.png

(but for out of stock products) 

 

?


free tutorials, free templates, free addons, prestashop modules MndfRK4.png  lpHMrZ5.png  gtKHYO7.png  google-48.png


#10 totti240282

totti240282

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts

Posted 19 January 2015 - 11:51 AM

Esatto !!!

 

For out of stock products !



#11 vekia

vekia

    Advanced Member

  • Members
  • PipPipPip
  • 10166 posts

Posted 19 January 2015 - 12:16 PM

it's easy ;-)
edit product-list.tpl file again

 

there is a line like:
 

<li class="ajax_block_product{if $page_name == 'index' || $page_name == 'product'} col-xs-12 col-sm-4 col-md-3{else} col-xs-12 col-sm-6 col-md-4{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLine == 0} last-in-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLine == 1} first-in-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModulo)} last-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 0} last-item-of-tablet-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 1} first-item-of-tablet-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 0} last-item-of-mobile-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 1} first-item-of-mobile-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModuloMobile)} last-mobile-line{/if}">

change it to:

<li class="{if $product.quantity > 0}product_in_stock{else} product_out_of_stock{/if} ajax_block_product{if $page_name == 'index' || $page_name == 'product'} col-xs-12 col-sm-4 col-md-3{else} col-xs-12 col-sm-6 col-md-4{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLine == 0} last-in-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLine == 1} first-in-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModulo)} last-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 0} last-item-of-tablet-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 1} first-item-of-tablet-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 0} last-item-of-mobile-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 1} first-item-of-mobile-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModuloMobile)} last-mobile-line{/if}">


in css styles file (global.css) add this:

.product_out_of_stock {
  opacity:0.3;
}

free tutorials, free templates, free addons, prestashop modules MndfRK4.png  lpHMrZ5.png  gtKHYO7.png  google-48.png


#12 totti240282

totti240282

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts

Posted 19 January 2015 - 01:13 PM

 

it's easy ;-)
edit product-list.tpl file again

 

there is a line like:
 

<li class="ajax_block_product{if $page_name == 'index' || $page_name == 'product'} col-xs-12 col-sm-4 col-md-3{else} col-xs-12 col-sm-6 col-md-4{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLine == 0} last-in-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLine == 1} first-in-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModulo)} last-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 0} last-item-of-tablet-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 1} first-item-of-tablet-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 0} last-item-of-mobile-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 1} first-item-of-mobile-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModuloMobile)} last-mobile-line{/if}">

change it to:

<li class="{if $product.quantity > 0}product_in_stock{else} product_out_of_stock{/if} ajax_block_product{if $page_name == 'index' || $page_name == 'product'} col-xs-12 col-sm-4 col-md-3{else} col-xs-12 col-sm-6 col-md-4{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLine == 0} last-in-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLine == 1} first-in-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModulo)} last-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 0} last-item-of-tablet-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 1} first-item-of-tablet-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 0} last-item-of-mobile-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 1} first-item-of-mobile-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModuloMobile)} last-mobile-line{/if}">

in css styles file (global.css) add this:

.product_out_of_stock {
  opacity:0.3;
}

Thanks, but it also serves this class ?

 

.product_in_stock {
opacity:1;
}



#13 vekia

vekia

    Advanced Member

  • Members
  • PipPipPip
  • 10166 posts

Posted 19 January 2015 - 01:16 PM

yes, i added it as a complex solution

with this class you can add additional things to block of product that is in stock.


free tutorials, free templates, free addons, prestashop modules MndfRK4.png  lpHMrZ5.png  gtKHYO7.png  google-48.png


#14 totti240282

totti240282

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts

Posted 19 January 2015 - 01:18 PM

Thanks.



#15 totti240282

totti240282

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts

Posted 20 January 2015 - 11:26 AM

I noticed a bug though.
In the list of products if there are three attributes, one of which is available the reports as missing.

 

Here



#16 totti240282

totti240282

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts

Posted 22 January 2015 - 06:57 AM

There is a chance to find out if there is at least one for each combination product ?



#17 totti240282

totti240282

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts

Posted 04 February 2015 - 08:36 PM

Any news ?