Jump to content

How to add last quantities warning for combinations on product.tpl


Recommended Posts

Hi,

 

I'm trying to do the following:

 

1) I allow sales with stock 0 and under

2) When stock is 0 so presta writes availability text for products available later. Till here all works perfect.

 

Now I want to assign on product.tpl, because this is missing, if a combination of a product already has stock -1,

the extra line of OOS warning, which is

 

	<p class="warning_inline" id="last_quantities"{if ($product->quantity > $last_qties OR $product->quantity > 0) OR $allow_oosp OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if} >{l s='Warning: Last items in stock!'}</p>

 

I tried to include this line on <!-- number of item in stock OR isset($combination.list)--> stright after the last span

	<span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='items in stock'}</span>    

 

by replacing it:

 

	<span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='items in stock'}</span> {else}                                                                              
<span {if ($product->quantity > 0} style="display: none;"{/if} >{l s='Warning: Last items in stock!'}</span>  

It comes a smarty error.

 

I also tried:

 

	<span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='items in stock'}</span> {else}                                                                              
<span {if ($product->quantity > 0} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='Warning: Last items in stock!'}</span>  

 

and this one

 

<span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='items in stock'}</span>
               <span {if ($product->quantity > 0} class="warning-inline" {/if}</span>

 

Too Smarty error.

 

Can somebody please help me ?

  • Like 1
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...