X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   custom add to cart button (https://forum.x-cart.com/showthread.php?t=54655)

balinor 07-19-2010 11:15 AM

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.

ARW VISIONS 07-19-2010 11:18 AM

Re: custom add to cart button
 
yes that is possible.

ARW VISIONS 07-19-2010 06:57 PM

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.

Tdeviant 07-21-2010 03:00 AM

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.

ARW VISIONS 07-21-2010 08:45 AM

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.

Tdeviant 07-21-2010 01:34 PM

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?

Shamun 07-21-2010 01:42 PM

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.

ARW VISIONS 07-21-2010 01:45 PM

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

Tdeviant 07-21-2010 02:08 PM

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!!

Shamun 07-21-2010 02:26 PM

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.


All times are GMT -8. The time now is 10:38 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.