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

custom add to cart button

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #11  
Old 07-19-2010, 11:15 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: custom add to cart button

Each button has multiple pieces and classes - it is meant to be a dynamic button - scales up or down based on the size of the text. You can't just add a graphic without re-coding the whole template. So in order to change the buttons globally, you'd need to slice up your button into the appropriate graphics and then change the CSS as well.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #12  
Old 07-19-2010, 11:18 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: custom add to cart button

yes that is possible.
__________________
xcart 5.1.2
Reply With Quote
  #13  
Old 07-19-2010, 06:57 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: custom add to cart button

The atc button he wants to use is quite a bit bigger than the other buttons.

it's possible to just make the atc button bigger tho, just need to change the CSS to accommodate the size, but will also need to change button.tpl to call the appropriate classes.
__________________
xcart 5.1.2
Reply With Quote
  #14  
Old 07-21-2010, 03:00 AM
 
Tdeviant Tdeviant is offline
 

Member
  
Join Date: Jul 2010
Posts: 25
 

Default Re: custom add to cart button

I could make the buttons smaller, to fit the size, but its the font styles I would like to keep.
__________________
Helping the world turn
X-Cart version 4.3.2
Reply With Quote
  #15  
Old 07-21-2010, 08:45 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: custom add to cart button

if you want to keep the font style, you might as well make them bigger too.

So basically you need to add a custom style to each button. Do this in the customer/buy_now.tpl

The add an if statement to customer/button.tpl for the new style.

You can change the html in teh buttons.tpl to whatever you want. Here you add your new styles for each state of the buttons.

You will need to figure out what classes are currently controlling the buttons, and mimic them with new names, then adjust the styles accordingly.

Try it out, and let me know your progress. I'll help as much as I can.
__________________
xcart 5.1.2
Reply With Quote
  #16  
Old 07-21-2010, 01:34 PM
 
Tdeviant Tdeviant is offline
 

Member
  
Join Date: Jul 2010
Posts: 25
 

Default Re: custom add to cart button

Hi

Thanks for the help, we have been tweaking them all day using firebug to find the correct styles, very awkwardly set out, but we are nearly there, you can have a look here:

http://sleepywings.co.uk

Once getting into if statement, i get a little confused

There is one problem we are finding troublesome:
http://sleepywings.co.uk/error_message.php?need_login

The log in box on the right is is still showing, is it possible to write an 'if' statement to use one set of html normally and another for this page? if so how could we do this?
__________________
Helping the world turn
X-Cart version 4.3.2
Reply With Quote
  #17  
Old 07-21-2010, 01:42 PM
 
Shamun Shamun is offline
 

X-Adept
  
Join Date: Jun 2009
Location: North Carolina
Posts: 841
 

Default Re: custom add to cart button

Code:
{if $main neq 'need_login'} Show the login {/if}

Goes in the .tpl file where it calls the auth box.
Be sure the replace the stuff inside the {if}{/if} with the code that calls the auth box.
__________________
- Shane Munroe
Reply With Quote
  #18  
Old 07-21-2010, 01:45 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: custom add to cart button

Looks like you are getting it.
Yes it is possible to have thing only show on certain parts of the site.

There is a varable called main.

so it would go like this..

{$main eq 'certain-section'}
html
{if}

or

{$main eq 'certain-section'}
certain-section html
{elseif $main eq 'different-section'
dif-sedtion html
{else}
html on all pages here
{if}

you can look in home_main.tpl to find many of the sections.

I believe you are looking for {if main eq 'need_login'} tho
__________________
xcart 5.1.2
Reply With Quote
  #19  
Old 07-21-2010, 02:08 PM
 
Tdeviant Tdeviant is offline
 

Member
  
Join Date: Jul 2010
Posts: 25
 

Default Re: custom add to cart button

I kinda understand,

This would be normal code:

<div class="nav_bottom">&nbsp;</div>
</div>

<div id="login">
<div class="nav">
<div class="nav_main" style="min-height:35px;">
{if $login eq "" }
{include file="customer/auth.tpl" }
{else}
{include file="customer/authbox.tpl" }
{/if}
{include file="customer/news.tpl" }
{if $active_modules.XAffiliate && $config.XAffiliate.partner_register eq 'Y' && $config.XAffiliate.display_backoffice_link eq 'Y'}
{include file="partner/menu_affiliate.tpl" }
{/if}
{if $active_modules.Interneka}
{include file="modules/Interneka/menu_interneka.tpl" }
{/if}
{include file="poweredby.tpl" }
</div>
</div>



There would be nothing for error_message.php?need_login

Gonna have to play with it tomorrow now, been at it 15 hours today

Thanks for your help!!
__________________
Helping the world turn
X-Cart version 4.3.2
Reply With Quote
  #20  
Old 07-21-2010, 02:26 PM
 
Shamun Shamun is offline
 

X-Adept
  
Join Date: Jun 2009
Location: North Carolina
Posts: 841
 

Default Re: custom add to cart button

Code:
<div class="nav_bottom">&nbsp;</div> </div> <div id="login"> <div class="nav"> <div class="nav_main" style="min-height:35px;"> {if $login eq "" and $main neq 'need_login'} {include file="customer/auth.tpl" } {else} {include file="customer/authbox.tpl" } {/if} {include file="customer/news.tpl" } {if $active_modules.XAffiliate && $config.XAffiliate.partner_register eq 'Y' && $config.XAffiliate.display_backoffice_link eq 'Y'} {include file="partner/menu_affiliate.tpl" } {/if} {if $active_modules.Interneka} {include file="modules/Interneka/menu_interneka.tpl" } {/if} {include file="poweredby.tpl" } </div> </div>

Try that out.
__________________
- Shane Munroe
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 10:35 PM.

   

 
X-Cart forums © 2001-2020