Jump to content

Shopping Cart Product Line Mod


Genuetic

Recommended Posts

Hi, 
 
i made a little mod to the shopping-cart-product-line.tpl file in order to have 2 new labels other than "In Stock" and "Out o Stock"
 
I added the "waiting for supply" label for products with quantity <= 0 but with available.later date, and a "checking availability" for products with quantity <=5
 
This is my code:
 

{if $PS_STOCK_MANAGEMENT}
		<td class="cart_avail"><span class="label{if $product.quantity_available <= 0} label-danger{elseif $product.quantity_available <= 5 } label-warning{else} label-success{/if}">
		{if $product.quantity_available <= 0}
			{if isset($product.allow_oosp) && $product.allow_oosp}
					{if isset($product.available_later) && $product.available_later}{$product.available_later}
					{else}
					{l s='Waiting for supply'}
					{/if}
				{else}
					{l s='Out of stock'}
			{/if}
		{else}
		{*
		* Modifica "Verfifica Magazzino"
		*}
		{if $product.quantity_available <= 5}
					{l s='Checking for Stock'}
			{else}	
		{if $product.quantity_available > 5}				
		{if isset($product.available_now) && $product.available_now}{$product.available_now}
				{else}
				{l s='In Stock'}
		{/if}
		{/if}
		{/if}
		{/if}
		{else}
		</span>{if !$product.is_virtual}{hook h="displayProductDeliveryTime" product=$product}{/if}</td>
	{/if} 

I'm not a php developer, and maybe this is not the right way to make this mod, but it works!! :D

My only problem is that the system doesn't translate the "In Stock" label anymore, any advice on which could be the problem?

Thanks in advance

G.

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...