![]() |
custom add to cart button
Does anyone know how to replace the defult 'add to cart' and 'add to wishlist' buttons with custom images?
|
Re: custom add to cart button
Welcome to the X-Cart forums! Please start by reading the following thread, which will help you get started and hopefully make your experience here a positive one:
http://forum.x-cart.com/showthread.php?t=23970 Please note that this link is not an answer to your question, but we need you to update your signature with your X-Cart version so that we can answer your questions correctly. Thanks! :) |
Re: custom add to cart button
It a multi step process, involving editing a few different .tpls.
Want to try and tackle it. Could be a pain!! |
Re: custom add to cart button
Yes please, I have been editing .tpls for days now
|
Re: custom add to cart button
ok, so 4.3.2 is a bit different than older version since it has all the ajax functions.
The button now has 3 states, the default state, the being added, and added states. Do you want to change all 3? Just color or size and color? |
Re: custom add to cart button
I have a single image, but will make more for the other 2 states
http://sleepywings.co.uk/new/images/add_cart.gif |
Re: custom add to cart button
Sry, busy with these dare customers ;)
I'll write this up a bit later, after I get all my work done. |
Re: custom add to cart button
Thank you very much. This is my first X-cart project and I have a few other questions regarding the way x-cart works/doesn't work with my css etc, perhaps you could help me with these few little problems. May even be able to give you something for your trouble.
|
Re: custom add to cart button
I along with others here are happy to answer any questions we can.
The only reason I need to take some some on the buttons is because, believe it or not, it's rather complicated. And I haven't actually done a 4.3.2 button set yet. |
Re: custom add to cart button
Thank you once again. Is it possibe to make one gif and use css positioning to manuever the gif
|
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.
|
Re: custom add to cart button
yes that is possible.
|
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. |
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.
|
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. |
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? |
Re: custom add to cart button
Code:
{if $main neq 'need_login'} 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. |
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 |
Re: custom add to cart button
I kinda understand,
This would be normal code: <div class="nav_bottom"> </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!! |
Re: custom add to cart button
Code:
<div class="nav_bottom"> </div> Try that out. |
Re: custom add to cart button
Thanks, but It needs to be,
IF THIS HTML - <div class="nav_bottom"> </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> ELSE - 'Nothing' as the style is shoming up unless this whole section is in the statement. |
Re: custom add to cart button
Sorry, I added it inside because I figured it was just overlayed. Though, I'm a bit iffy because it has the poweredby.tpl file included there? I don't think that's by default so I'll just assume you added it in there.
Try this one: Code:
{if $main neq 'need_login'} |
Re: custom add to cart button
Thank you Tal, works perfectly, your a legend!
|
Re: custom add to cart button
Quote:
roger that |
Re: custom add to cart button
Quote:
Im using 4.3.2, and my button only seems to have one state. Anyone any ideas if there is there a setting I need to change for this? |
All times are GMT -8. The time now is 10:39 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.