Author |
Topic  |
|
bully456
Starting Member
United Kingdom
21 Posts |
Posted - September 20 2014 : 11:42:06
|
Hi,
Have done lots of searching around the forums and Helpnotes but cannot find an answer that relates to the exact problem.
I''m using version 7.02.3.
We have a shop where we keep lots of certain products in stock, and I would like to change it so that instead of saying ''546 in stock'' in would just say ''more than 10'' for example.
Does anybody know if there is a way to do this please? As i say I have found solutions for different versions, but I can''t seem to get them to work.
Thanks to anyone who can help and hopefully want I am asking makes sense!
James |
|
support
Administrator
    
4679 Posts |
Posted - September 22 2014 : 00:39:58
|
Hi James,
This would require a new function to be written to check the stock items in the system and to display the relevant message depending on how many you have.
Will have a quick look to see if simple enough to post something here.
Thanks
Ali VPASP Support |
 |
|
bully456
Starting Member
United Kingdom
21 Posts |
Posted - September 22 2014 : 05:21:39
|
Thanks Ali.
|
 |
|
carfin
VP-CART Expert
  
United Kingdom
948 Posts |
Posted - September 22 2014 : 06:17:08
|
Here''s what I did for our site. It shows 20+ in stock if stock is more than 20. You can change the 20+ text to "more than 10 for your site. If the stock level is more than zero but less than or equal to 20 it shows the actual value.
Open and save a copy of shopfileio.asp
Find the line - case "FORMATIMAGE"
Create a space above this line so that you can paste in the following custom code:
''******Dec 2008 - Carrol Finlay - CUSTOM formatting of current stock display case "FORMATSTOCK" if value > 20 then value = "20+" else if value >0 and value <= 20 then value = value else if value <0 then value = "0" else value = "0" end if end if end if if getconfig("xdisplayprices") <> "No" then if (getconfig("xpriceloggedinonly") = "Yes") AND (getsess("Login") = "") then value="" else value = value end if end if ''********** End of custom code
Please note that the forum displays a '' instead of a single apostrophe at the start of a line that you need to comment out in your code Save the file, upload and test.
Still works fine in our version 7
Hope this helps.
Regards,
Carrol www.deanston-electrical.co.uk
|
 |
|
bully456
Starting Member
United Kingdom
21 Posts |
Posted - September 22 2014 : 07:25:12
|
Thanks a lot Carrol, will give it a go and report back. |
 |
|
serjtankian
VP-CART Super User
 
Armenia
378 Posts |
Posted - September 22 2014 : 08:34:58
|
thanks Carol, will try on my test store
*serj* |
 |
|
diegomilito
VP-CART Expert
  
Argentina
779 Posts |
Posted - October 18 2014 : 05:17:28
|
has anybody try carfin code ? i did but giving me error. just would ask the other members if can or not. diego |
 |
|
carfin
VP-CART Expert
  
United Kingdom
948 Posts |
Posted - October 20 2014 : 04:13:08
|
Sorry Diego,
I should have added that you need to place the call to the Case formatstock statement in your product display templates.
Where your template says cstock you need to replace it with [formatstock cstock]
(the same logic as [formatcustomerprice cprice] etc.)
Regards,
Carrol www.deanston-electrical.co.uk |
Edited by - carfin on October 20 2014 04:13:32 |
 |
|
diegomilito
VP-CART Expert
  
Argentina
779 Posts |
Posted - October 25 2014 : 00:43:53
|
that is good. suggestion looks working. diego. |
 |
|
bluesky
VP-CART Super User
 
304 Posts |
Posted - October 29 2014 : 05:34:14
|
Aye carrol is a bit of star :-) , i have stolen , errr I mean , borrowed , errr I mean used , many of his/her little bits of wisdom and code over the years
Wish admins would STICKY , or create a separate thread for all the known , working code mods so there was one repository to view etc
Thank carroll |
 |
|
bully456
Starting Member
United Kingdom
21 Posts |
Posted - December 10 2014 : 10:47:56
|
It has been a while but I have managed to sit down and get the code to work, Thank you Carrol! |
 |
|
|
Topic  |
|