View Single Post
  #34  
Old 11-13-2005, 09:48 AM
  1CNS's Avatar 
1CNS 1CNS is offline
 

Advanced Member
  
Join Date: Mar 2004
Location: Los Angeles, CA, USA
Posts: 45
 

Default Good idea, Hamid

Quote:
Originally Posted by hamid
I just added an "Availability" label on my product pages (product.tpl), and next to it put:

{if $product.avail gt 100}
IN STOCK MESSAGE
{else}
OUT OF STOCK MESSAGE
{/if}

So, if the stock level goes under 100, customers see the "out of stock message", otherwise they see the "in stock message".

Thanks Hamid, for this very simple and useful work-around. I used a constant of 10000 to make inventories over 100 more readable, and I also added a message beside out-of-stock items in the cart. For the cart mod, the code update in customer\main\cart.tpl is essentially the same as Hamid's update in customer\main\product.tpl, but instead of:

Code:
$product.avail

use

Code:
$products[product].avail

My implemenation of the cart portion of the mod was to update cart.tpl by replacing:

Code:
{include file="buttons/edit_product_options.tpl" href="javascript:window.open('`$catalogs.customer`/ [etc. ... line too long to show here] {/if} {/if} </DIV> </TD></TR> <TR><TD colspan="2"><HR size="1" noshade></TD></TR> {/if} {/section}

with

Code:
{include file="buttons/edit_product_options.tpl" href="javascript:window.open('`$catalogs.customer`/ [etc. ... line too long to show here] {/if} {/if} </DIV> {* VJ add: follwing div is added out of stock notice; items with inventory under 10000 *} {if $products[product].avail le 10000} <div align="left"> <table border="0" cellspacing="0" width="400" bgcolor="#C0C0C0"> <tr> <td width="100%"> <div align="left"> <table border="0" cellpadding="4" cellspacing="0" width="100%" bgcolor="#F9F9F9"> <tr> <td width="100%"> <span class=dr10b>THIS ITEM IS ON BACKORDER </span><span class=dg10>You can still order this item now, but it will ship later than the rest of your order, generally by 1 to 3 weeks. If this delay is not acceptable, you may </span><span class=bu10b>delete this item</span><span class=dg10> from your order.</span> </td> </tr> </table> </div> </td> </tr> </table> </div> {/if} {* VJ end *} </TD></TR> <TR><TD colspan="2"><HR size="1" noshade></TD></TR> {/if} {/section}

I have some CSS font styles in there. You can change or delete those, or add this code to your css file:

Code:
.dr10b { font-size: 10px; line-height: 12px; font-weight: bold; color: #990000; } .dg10 { font-size: 10px; line-height: 12px; color: #444444; }
__________________
www.funkymart.com
x-cart 4.2.1 [linux]
Reply With Quote