SearchFit - Ecommerce Platform Live Chat Call Us Today! 888.398.4703

How to Add View Cart Button

 
Post new topic   Reply to topic    searchfit.us.com Forum Index -> SearchFit Questions or Suggestions
View previous topic :: View next topic  
Author Message
pampered
2


Joined: 21 Jan 2004
Posts: 401

PostPosted: Wed Oct 01, 2008 6:44 pm GMT    Post subject: How to Add View Cart Button Reply with quote

I wish to replace the link text for "View Cart" with a button image (chkout.jpg) in the code below:

<script language="JavaScript" src="tool_dynamic.php?action=get_cart_info"></script>
<script language="JavaScript" type="text/javascript">
if (typeof scart_order_qty_str != 'undefined') {
document.write("Items: <b>" + scart_order_qty_str + "</b> [ ");
document.write("<b>$" + scart_order_subtotal_str + "</b> ] ");
document.write("<a href='tool_view_scart.php' title='View Cart and/or Checkout'>View Cart</a>");
}
</script>

How do I do this? I can't seem to make it work. Thanks.
_________________
John
Back to top
View user's profile Send private message Visit poster's website
pampered
2


Joined: 21 Jan 2004
Posts: 401

PostPosted: Wed Oct 01, 2008 6:47 pm GMT    Post subject: Reply with quote

Also, how to I increase the font size being displayed by the script?
_________________
John
Back to top
View user's profile Send private message Visit poster's website
ed@searchfit
2


Joined: 27 Sep 2004
Posts: 173

PostPosted: Thu Oct 02, 2008 6:00 am GMT    Post subject: Reply with quote

Here is a code sample that will do what you are asking:

Code:
<p class="cart"><script language="JavaScript" src="tool_dynamic.php?action=get_cart_info"></script>
<script language="JavaScript" type="text/javascript">
if (typeof scart_order_qty_str != 'undefined') {
document.write("Items: <b>" + scart_order_qty_str + "</b> [ ");
document.write("<b>$" + scart_order_subtotal_str + "</b> ] ");
}
</script>

<a href="tool_view_scart.php"><img src="images_templ/name_of_image.extension" alt="checkout"></a></p>


Notes about the above code:

I moved the checkout link out of the JavaScript (It is a 'plain old link' and doesn't need to be rendered with JavaScript).

I added a paragraph tag around your code with a class of cart. You should create rules on your style sheet for "p.cart" and "p.cart a" in order to change the size of the elements as desired.

Change the "name_of_image.extension" to the name of your image.
Back to top
View user's profile Send private message
pampered
2


Joined: 21 Jan 2004
Posts: 401

PostPosted: Thu Oct 02, 2008 2:33 pm GMT    Post subject: Reply with quote

Thank you.
_________________
John
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    searchfit.us.com Forum Index -> SearchFit Questions or Suggestions All times are GMT - 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum