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

Buttons - CSS v.4.0.x

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-22-2008, 12:31 PM
  clik's Avatar 
clik clik is offline
 

Advanced Member
  
Join Date: Mar 2006
Location: Canada
Posts: 30
 

Post Buttons - CSS v.4.0.x

I used many ads-on posted in this forum and I decided to make a donation. Everybody who tried to modify buttons design knows that it▓s tricky. I created CSS buttons with mouse-over effect. Here is the page sample:
http://www.clikinternational.com/free/buttons/sample.html

There are 10 color variations. These CSS classes can be applied to <a>, <table>, <div>, <span> tags. And the best part is that they work with <table> based buttons onClick event.
How to add buttons in x-cart:

1. Download the files:
http://www.clikinternational.com/free/buttons/ColorButtons.zip
2. Copy CSS code from buttons.css file and ad to your skin1.css file.
3. Upload buttons folder into your skin1/images/
4. Modify skin1/buttons/button.tpl file:

Replace:
Code:
<TABLE border="0" cellspacing="0" cellpadding="0" onclick="{$js_link}" style="cursor: pointer;" valign="middle"{if $title ne ''} title="{$title}"{/if}> <TR><TD><{$img_type} src="{$ImagesDir}/but1.gif" width="7" height="14" border="0"{if $title ne ''} title="{$title}"{/if}></TD> <TD class="Button" valign="middle" nowrap><FONT class="Button">&nbsp;{$button_title}&nbsp;</FONT></TD> <TD><IMG src="{$ImagesDir}/but2.gif" width="7" height="14" border="0"{if $title ne ''} title="{$title}"{/if}></TD></TR> </TABLE>

with
Code:
<TABLE border="0" cellspacing="0" cellpadding="0" onclick="{$js_link}" class="ButtonRed" {if $title ne ''} title="{$title}"{/if}> <TD nowrap>&nbsp;{$button_title}&nbsp;</TD> </TABLE>
You can change class="ButtonRed" on other class from the CSS code.

Buttons look perfect in Firefox and Safari (Mac). Please let me know if there are any problems with other browsers. I used this code for my online store that is 4.0.11. (I know it's old version but it works.) I hope it works in new version of x-cart.
Anyways, you are free to use these CSS styles for your other projects.

Question to experts (I'm just a designer with some knowledge of coding):
How to apply different classes to different buttons? For example:
Add to cart -> ButtonRed
Add to wish list -> ButtonGrey,
etc...
Thank you.
__________________
__________________
XC5: 5.3.4.4
PHP: 7.0.26
MySQL server: 5.5.56-MariaDB
Reply With Quote
  #2  
Old 07-22-2008, 02:22 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: Buttons - CSS v.4.0.x

The best way in my opinion to pass the custom class, is in the include of button.tpl:

Use a custom ButtonGrey class:

Code:
{include file="buttons/button.tpl" customclass="ButtonGrey" ... }

Use the default class -

Code:
{include file="buttons/button.tpl" ... }

Then in your buttons/button.tpl:

Code:
<table border="0" cellspacing="0" cellpadding="0" onclick="{$js_link}" class="{$customclass|default:"ButtonRed"}" {if $title ne ''} title="{$title}"{/if}> <td nowrap>&nbsp;{$button_title}&nbsp;</td> </table>
Reply With Quote
  #3  
Old 07-22-2008, 03:20 PM
  clik's Avatar 
clik clik is offline
 

Advanced Member
  
Join Date: Mar 2006
Location: Canada
Posts: 30
 

Default Re: Buttons - CSS v.4.0.x

Thank you Jon! It works!
__________________
__________________
XC5: 5.3.4.4
PHP: 7.0.26
MySQL server: 5.5.56-MariaDB
Reply With Quote
  #4  
Old 07-22-2008, 03:56 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: Buttons - CSS v.4.0.x

Glad to help. I'm sure this will help many members. Please check your PM.
Reply With Quote
  #5  
Old 01-23-2009, 08:08 AM
 
gargonzo gargonzo is offline
 

Senior Member
  
Join Date: Nov 2004
Posts: 171
 

Default Re: Buttons - CSS v.4.0.x

clik -- this is pretty cool.. anyone get it to work on any newer versions of xcart?

i tried with the latest and it did *not* work.
__________________
xcart ver 4.xx/linux/php
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 03:28 PM.

   

 
X-Cart forums © 2001-2020