Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Easy 2 image css button.tpl replacement

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 04-25-2008, 07:57 AM
  deadzebrainc's Avatar 
deadzebrainc deadzebrainc is offline
 

Advanced Member
  
Join Date: Apr 2008
Posts: 45
 

Post Easy 2 image css button.tpl replacement

Hey All,

I'm working to replace all those wacky tables all over the place with css, today I replaced the default buttons (add to cart, add to wishlist, etc) with a simple two-image css rollover button (based on the dynamicdrive sliding doors button). It uses the same basic dimensions as default x-cart buttons for easy swapping in.

NOTE: Changing the simple link GO buttons was a quick afterthought, might get back to that later. Also doesn't replace other GO button uses like search, etc.
This may not be something that works well for your particular setup, I just thought I'd share.



Instructions:
1. Put css_button_left.gif and css_button_right.gif in skin1\images.
(Button source PSD attached, mine are very light so alter to suit. Top is regular state, bottom is rollover active state)

2. Replace \buttons\button.tpl in skin1\buttons with attached file.
(BACK UP YOUR OLD FILE!)

3. Add CSS below to skin1.css, customize as needed

Code:
/* BEGIN BUTTON CSS, adjust as needed */ a.cssbutton{ background: transparent url('images/css_button_left.gif') no-repeat top left; display: block; float: left; font: normal 10px Verdana, Arial, Helvetica, sans-serif; line-height: 10px; /* This value + top and bottom padding of SPAN must equal height of button */ height: 14px; /* Height of button background height */ padding-left: 7px; /* Width of left menu image */ text-decoration: none; } a:link.cssbutton, a:visited.cssbutton, a:active.cssbutton{ color: #000; /*button text color*/ } a.cssbutton span{ background: transparent url('images/css_button_right.gif') no-repeat top right; display: block; padding: 2px 7px 2px 0; /*Set 11px below to match value of 'padding-left' value above*/ } a.cssbutton:hover{ /* Hover state CSS */ background-position: bottom left; } a.cssbutton:hover span{ /* Hover state CSS */ background-position: bottom right; color: #900; } .cssbuttonwrapper{ /* Container you can use to surround a CSS button to clear float */ overflow: hidden; width: 100%; } .csssimplebutton{ /* for simple text buttons without background images */ font: bold 10px Verdana, Arial, Helvetica, sans-serif; float:left; display:block; } a.csssimplebutton:hover{ color: #900 } /* END BUTTON CSS */
Attached Thumbnails
Click image for larger version

Name:	css_button_right.gif
Views:	240
Size:	660 Bytes
ID:	907  
Attached Images
 
Attached Images
File Type: psd css_button.psd (34.7 KB, 214 views)
Attached Files
File Type: tpl button.tpl (2.9 KB, 151 views)
__________________
DEAD ZEBRA, INC shop
X-cart 4.1.9
Reply With Quote
  #2  
Old 06-06-2008, 05:20 AM
 
roblen roblen is offline
 

Senior Member
  
Join Date: Oct 2004
Posts: 114
 

Default Re: Easy 2 image css button.tpl replacement

Thank you.. this worked perfect for us.
__________________
X-Cart version 4.1.9
PHP 5.2.13 Details >>
GD bundled (2.0.34 compatible)
MySQL server 5.0.77-log
MySQL client 5.0.77
Web server Apache/2.2
Operation system Linux
Perl not found
XML parser (expat) found
Reply With Quote
  #3  
Old 11-08-2008, 08:15 PM
 
whsu716 whsu716 is offline
 

Senior Member
  
Join Date: Jun 2005
Posts: 168
 

Default Re: Easy 2 image css button.tpl replacement

An excellent mod - thank you!
__________________
...
v 4.0.18; 4.1
Reply With Quote
  #4  
Old 11-10-2008, 03:28 PM
 
whsu716 whsu716 is offline
 

Senior Member
  
Join Date: Jun 2005
Posts: 168
 

Default Re: Easy 2 image css button.tpl replacement

Would anyone know why the following would happen?

1) Add to cart works in Firefox but not in IE

2) The buttons for a) submitting registration b) sending to friend c) write review are all not functioning.

Add to cart, sign in, sign up, check out and others are working fine.
__________________
...
v 4.0.18; 4.1
Reply With Quote
  #5  
Old 11-10-2008, 05:47 PM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: Easy 2 image css button.tpl replacement

It probably has something to do with the "image verification" spambot module. All 3 of them, and "subscribe" to newsletter use it, or have the option to use it.
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #6  
Old 09-27-2010, 02:31 AM
 
xtech xtech is offline
 

X-Adept
  
Join Date: Jun 2010
Posts: 605
 

Default Re: Easy 2 image css button.tpl replacement

Will it work on 4.3 Versions???
__________________
X-cart Platinum
4.6.1
Reboot template
Reply With Quote
  #7  
Old 02-13-2012, 08:33 AM
 
fcut27 fcut27 is offline
 

Member
  
Join Date: Jan 2011
Posts: 13
 

Default Re: Easy 2 image css button.tpl replacement

Any idea why the links for the buttons would be messed up using this script? My 'Add to Cart' buttons and 'Buy Now' buttons don't point to any certain page. I am using version 4.4.1.
__________________
version 4.4.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:15 PM.

   

 
X-Cart forums © 2001-2020