| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
button graphics | ||||
|
|
Thread Tools | Search this Thread |
#21
|
|||||||
|
|||||||
Re: button graphics
i dont know why but x-cart or addon skins not have image source (psd), its really necessary for change botton "go" "live help" "special offer" for example.
i buy software with all source.
__________________
Gonzalo Astudillo Pizarro | https://about.me/gonzaloastudillo |
|||||||
#22
|
|||||||||
|
|||||||||
Re: button graphics
Bump.
I'm looking for an easy way to change the 3-button sliced up buttons with one-button. Is there an easy way to do that? Buttons I want to change: 'add to cart' on the product detail and shopping cart page. I'd also like to add a new button for the 'click to enlarge' product image preview popup on the product detail page. TIA
__________________
XCART 4.1.8 [Linux] |
|||||||||
#23
|
|||||||||
|
|||||||||
Re: button graphics
OK, I've changed the 'add to cart' button on the product detail page (product.tpl). Here's how to do it:
Change this code on skin1/buttons/button.tpl on or near line 25: Quote:
to this: Quote:
Make sure your new image has been uploaded to /skin1/images Still working on the other stuff... feel free to submit your comments. Thanks.
__________________
XCART 4.1.8 [Linux] |
|||||||||
#24
|
|||||||||
|
|||||||||
Re: button graphics
OK, so the above directions unfortunately also changed the search button, so now my 'add to cart' button is also now my search button, which sucks. Hmm, help anyone?
__________________
XCART 4.1.8 [Linux] |
|||||||||
#25
|
|||||||||
|
|||||||||
Re: button graphics
I have not done exactly what you are trying to do, I've only added a couple of button styles - so I can't give you precise directions, but maybe this will help. You will have to experiment.
The button.tpl is shared - you will see many instances of buttons that use button.tpl (that does not suck - it is shared code - more efficient, hopefully) - so if you are going to make changes in there for only certain buttons, you need to use {if} based on the variables you pass in with the include from the originating file (product.tpl in your case). Perhaps you could set the $style or the $button_title and/or other variables to something. You can figure out how xcart is using those variables, then modify their code, or do your own thing with an {if}. in product.tpl: {include file="buttons/button.tpl" button_title=$lng.lbl_pconf_add_to_configuration style="MY_HAPPY_BUTTON" href="javascript:if (FormValidation()) `$ldelim`document.orderform.productid.value='`$sma rty.get.pconf`';document.orderform.action='pconf.p hp';document.orderform.submit()`$rdelim`" style="MY_HAPPY_BUTTON_STYLE" button_style="WHATEVER_I_WANT"} Then, in button.tpl: {if $button_style eq "WHATEVER_I_WANT"} do cool stuff {/if} etc. If this works - you can replace what they did with non-sliced buttons, or css or whatever you need. If it works - post back - I may want to duplicate it! If that is too complex, have you tried just replacing the include for button.tpl in product.tpl to use your button code instead? Look at what that call to button.tpl would have included in product.tpl, and replace it with your code.
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold (CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module) |
|||||||||
#26
|
|||||||||
|
|||||||||
Re: button graphics
Quote:
Thanks gb2. You're definately on to something, unfortunately for me, the 'if' statement wont work here. since the 'if' statement is already used. It needs to be an 'else' statement instead. I've tried some stuff but failed so far. I'll post my success should that happen.
__________________
XCART 4.1.8 [Linux] |
|||||||||
#27
|
|||||||
|
|||||||
Re: button graphics
Another option you could use is to replace the graphics with the default form buttons... This way you don't have to create any new graphics and I personally feel that the default buttons are much more clear to unexperienced users.
How to do this; go to buttons\button.tpl and replace: Code:
Code:
__________________
www.qualitylamps.eu X-Cart Gold 4.1.8, PHP 5.2.6, MySQL 5.0.51a, Apache 2.2.9 www.vervangjelamp.nl X-Cart Gold 4.2.0, PHP 5.2.6, MySQL 5.0.37-standard, Apache/2 Sorry for the weird user name, I registered it by mistake |
|||||||
#28
|
|||||||||
|
|||||||||
Re: button graphics
The change the add to cart button you edit add_to_cart.tpl.
change: {include file="buttons/button.tpl" button_title=$lng.lbl_add_to_cart href=$href title=$title style=$style} to: {include file="buttons/atcButton.tpl" button_title=$lng.lbl_add_to_cart href=$href title=$title style=$style} Ok so atcButton.tpl does not yet exist, so you open button.tpl with your text editor and save a copy of it as atcButton.tpl NOTE: make sure you don't save over button.tpl. Make the appropriate changes to you new file and upload the add_to_cart.tpl and the new atcButton.tpl to the buttons folder and you've got it. you can check out www.affordableimrpint.com to see it in action. I have changed all of the buttons. You can also make them change when hovered over.
__________________
xcart 5.1.2 |
|||||||||
#29
|
|||||||||
|
|||||||||
Re: button graphics
If you want the buttons to change whn hovered over use this.
in your product.tpl find and change: <tr> <td>{include file="buttons/add_to_cart.tpl" style="button" href="javascript: if(FormValidation()) document.orderform.submit();"}</td> <td> &nbs p;</td> <td> {if ($login ne "" || $config.Wishlist.add2wl_unlogged_user eq 'Y') && $active_modules.Wishlist ne ""} {include file="customer/add2wl.tpl"} {/if} </td> </tr> to: <tr> <td align="center"><a href="javascript: document.orderform.submit();" onmouseover="document.atcButton.src='skin1/images/atcButton2.gif';" onmouseout="document.atcButton.src='skin1/images/atcButton.gif';"> <img name="atcButton" src="skin1/images/atcButton.gif" width ="200px" height="37px" /> </a> </td> <td> &nbs p;</td> <td> {if ($login ne "" || $config.Wishlist.add2wl_unlogged_user eq 'Y') && $active_modules.Wishlist ne ""} {include file="customer/add2wl.tpl"} {/if} </td> </tr> Now make the images you want to use as your 'out' and 'hover' buttons. Once you have them made upload them and the new product.tpl and you are good to go.
__________________
xcart 5.1.2 |
|||||||||
#30
|
|||||||||
|
|||||||||
Re: button graphics
Thanks Ashley, that worked great!
__________________
XCART 4.1.8 [Linux] |
|||||||||
|
|||
X-Cart forums © 2001-2020
|