Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Add-ons for VP-ASP
 Pre-selling products
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

CMF
Starting Member

USA
8 Posts

Posted - April 24 2010 :  12:16:43  Show Profile  Visit CMF's Homepage  Reply with Quote
This should be quite simple but being technology handicapped leaves me challenged.

I sell products that are often not in stock but customers can pre-ordered.
The product display page 'tmp_productformat.htm' has the following lines to display product availability;
============
[formatquantity sub]
[formatbutton sub]<br>[cstock] Available</td>
</tr>
============
I would like to change to something like the following with an IF-THEN-ELSE;
============
IF [cstock] = 0 THEN
[formatbutton sub] <br> Pre-Order available
ELSE
[formatquantity sub]
[formatbutton sub]<br>[cstock] Available
End If
</td>
</tr>
============
As you can see, I want to remove the cstock var if cstock count is zero and print 'Pre-orders available' instead of 'Available'.

But I am not sure how to make this happen without messing up the function or code.

RWG

Steve2507
VP-CART Expert

590 Posts

Posted - April 25 2010 :  12:15:58  Show Profile  Reply with Quote
Hi,

First off you are working in the wrong file for what you want.

You will need to create 2 tmp_productformat files (on for available and one for pre-order) and then where they are referenced in the asp code you will need to put some sort of if else statement which calls the template needed.


Steve
Sex toys from a UK sex shop including vibrators and dildos.
Go to Top of Page

CMF
Starting Member

USA
8 Posts

Posted - April 25 2010 :  12:57:11  Show Profile  Visit CMF's Homepage  Reply with Quote
Hello Steve, Thank you for your reply.

You may be correct that i am also working in the wrong file, but i also believe this file needs some changes.

The only difference between 'Available' and 'Pre-order' is the stock quantity [cstock] is '0' (zero) so I do not believe that separate templates are necessary, but it is possible that the conditions set with the IF-THEN-ELSE need be elsewhere (in another file) and this '[formatbutton sub]<br>[cstock] Available</td>' or something near this may have to be modified to reflect the condition.

RWG
Go to Top of Page

carfin
VP-CART Expert

United Kingdom
948 Posts

Posted - April 26 2010 :  10:44:16  Show Profile  Reply with Quote
Hi,

if you are using v6.50 then the following solution should work (I use a more complex case than this one) Open the file shopfileio.asp in a text or html editor and find the routine Sub DoSpecialFormating (approx line 580)

Add this following brown code immediately before the lines end select end sub

case "FORMATSTOCK"
if value > 0 then
value = "Available"
else
value = "Pre Order"
end if
if getconfig("xdisplayprices") <> "No" then
if (getconfig("xpriceloggedinonly") = "Yes") AND (getsess("Login") = "") then
value=""
else
value = value
end if
end if


End Select
end sub


This will only apply if you have xcheckstocklevel set to no, otherwise the order button will not show if an item is out of stock.
If you are using the new v7.0 then I cannot guarantee this will work.

Regards,

Carrol
www.deanston-electrical.co.uk

Edited by - carfin on April 26 2010 10:46:49
Go to Top of Page

CMF
Starting Member

USA
8 Posts

Posted - April 26 2010 :  12:44:18  Show Profile  Visit CMF's Homepage  Reply with Quote
Hello Carrol Finlay,

Thank you for your suggestions. Yes I am using 6.50. An interesting approach. This, FORMATSTOCK, would be a new condition as it does not currently exist in the shopfileio.asp.

I visited your website and see that one must log in to view stock levels and prices.

Does this new condition replace the actual value in the stock level field with the words "Available" or "Pre Order"? or the word(s) currently in the 'tmp_productformat.htm' template which has "[formatquantity sub]" and "[formatbutton sub]<br>[cstock] Available".?

I can see if the value is replaced, it would not be necessary to make any modifications to this template, but 'FORMATSTOCK' does not currently exist in 'tmp_productformat.htm' template. I assume that one would have to include [formatstock] somewhere in this template.

Look forward to your comments.

RWG
Go to Top of Page

carfin
VP-CART Expert

United Kingdom
948 Posts

Posted - April 27 2010 :  03:43:48  Show Profile  Reply with Quote
Hi,

my apologies, yes you will have to add [formatstock cstock] to your tmp_productformat.htm and tmp_product.htm.
This will replace the numeric value of your stock with 'available' or 'pre-order'

Regards,

Carrol
www.deanston-electrical.co.uk

We are a trade only wholesaler and you have to be a registered account holder with our company to view prices and stock levels on our website, but if you would like temporary access to view our stock/order/pre-order display you can contact me through our website

Edited by - carfin on April 27 2010 05:46:34
Go to Top of Page

CMF
Starting Member

USA
8 Posts

Posted - April 27 2010 :  11:06:32  Show Profile  Visit CMF's Homepage  Reply with Quote
Hello Carroll,

Thank you for the reply. Your insight have been invaluable.

I think I will have to use a variation of this code. When something is in stock, many of my customers want to know how many I have available for immediate delivery. Otherwise if not in stock, this will let them know that the item can be 'Pre Ordered'.

Your consideration of the following code:

case "FORMATSTOCK"
if value > 0 then
' value = "Available" >>> Here I would want to use the existing code if stock available <<<<
else
value = "Pre Order"
end if
if getconfig("xdisplayprices") <> "No" then
if (getconfig("xpriceloggedinonly") = "Yes") AND (getsess("Login") = "") then
value=""
else
value = value
end if
end if

End Select
end sub


Just need to know how to branch out of this Sub in place of (value = "Available").

RWG
Go to Top of Page

CMF
Starting Member

USA
8 Posts

Posted - April 27 2010 :  11:09:42  Show Profile  Visit CMF's Homepage  Reply with Quote
Carroll,

PS: May not be a branch from this routine, I may need to replace code with original function.

RWG
Go to Top of Page

carfin
VP-CART Expert

United Kingdom
948 Posts

Posted - April 28 2010 :  03:48:45  Show Profile  Reply with Quote
Hi,

If you want to show the actual quantity in stock, but keep the pre-order if out of stock, then just replace
if value > 0 then
value="Available"


with
if value>0 then
value=value


Regards,

Carrol
www.deanston-electrical.co.uk
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00