A Friendlier Stock Display

A Friendlier Stock Display

You could display the stock in product pages in a more friendlier way. For example, instead of displaying the stock quantity, it will simply display "more than 10".

To display this information, please follow these steps:

1. Open product template files (eg. tmp_product.htm & tmp_productinvent.htm).

2. Locate the following code:

$ <span class="productinfolabel">[getlang langproductstock]</span><span class="productinfodetails">[cstock]</span><div class="cb"></div>

3. Change it into the following code:

$ <span class="productinfolabel"></span><span class="productinfodetails">[formatproductcstock]</span><div class="cb"></div>

4. Save the file and open shopfileio.asp.

5. Locate the following code under ProcessKeyword sub-routine:

end select
end sub

6. Change it into the following code:

case "FORMATPRODUCTCSTOCK"
Handle_productstock value,parsearray, parseRS
rc=0

end select
end sub

7. Locate the following code at the end of the file:

%>

8. Change it into the following code:

sub Handle_productstock (value, parsearray,parseRS)
dim cstockvalue
dim cstock
cstockvalue = parseRS("cstock")
if isnull(cstockvalue) then cstockvalue = 0
if cdbl(cstockvalue) >= 10 then
response.write "  more than 10"
else
response.write cstockvalue
end if
end sub

%>

9. Save the file and check your product pages for the changes.


Times Viewed:
1914
Added By:
anggar
Date Created:
9/22/2014
Last Updated:
9/22/2014