Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Customization
 Customising the add to cart button
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Steve2507
VP-CART Expert

590 Posts

Posted - September 22 2009 :  09:07:45  Show Profile  Reply with Quote
Okay - where to start.

We have added alt and title tags to the add to basket button on shopdisplayproducts easy enough (see here - http://www.temptationsdirect.co.uk/p/5648/Sexy-Lingerie/Babydolls.html) so that when the button is hovered over it says "add the [product name] to your basket".

We would like to do the same on the shopexd page (http://www.temptationsdirect.co.uk/x/13573/Buy/Snowflake-Patterned-Stretch-Helenka-Mesh-Babydoll.html), however I can't work out how to pull in the cname of the product.

The routine is Sub Add_Button and the part which generates the button is
If myButton="" then
     WriteForm  "<input class=""submitbtn"" type=""submit"" value="""  & mytext & """ name=""Order"">"
else
     WriteForm "<input class=""imgbtn"" src=""" & mybutton & """ type=""image"" alt=""Add to Basket"" title=""Add to Basket"">"
end if

As you can see it's easy enough to bring in static phrases but how can I bring in cname?

Thanks


Steve
Sex toys from a UK sex shop including vibrators and dildos.

carfin
VP-CART Expert

United Kingdom
948 Posts

Posted - September 22 2009 :  11:17:32  Show Profile  Reply with Quote
Hi Steve,
open shopfileio.asp

Find Sub Add_Button (ivalue, parsearray)
Declare a new variable - let's say we call it altname
dim mytext, mybutton, tableflag, altname

Then just before these lines:
if tableflag<>"" then
Response.write TemplateButtonColumn


add the following code:

'******
fieldname="CNAME"
FindInDatabase fieldname, fieldvalue, fieldtype ,rc,parsearray
if fieldvalue<>"" then
altname= fieldvalue
else
altname="Whatever text you want in here"
end if
'******


Now you can call this cname variable in your image button code:

else
WriteForm "<input class=""imgbtn"" src=""" & mybutton & """ type=""image"" alt=""" & altname & """ >"


Your order button should now show the product name as the alt tag.

Regards,

Carrol
www.deanston-electrical.co.uk

Go to Top of Page

Steve2507
VP-CART Expert

590 Posts

Posted - September 22 2009 :  13:36:48  Show Profile  Reply with Quote
Thanks Carrol.

I knew it had something to do with the FindInDatabase routine but just couldn't get it.

You're a star.


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

ironhawker
VP-CART Super User

USA
260 Posts

Posted - September 30 2009 :  21:51:53  Show Profile  Visit ironhawker's Homepage  Reply with Quote
Steve
You could also try some longer text phrases in a pother field in your templates

[cname]-[pother4]
Go to Top of Page

Steve2507
VP-CART Expert

590 Posts

Posted - October 03 2009 :  13:59:59  Show Profile  Reply with Quote
Thanks for that.

We already use extra fields in names, page titles etc.



Steve
Sex toys from a UK sex shop including vibrators and dildos.
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