Thread: button graphics
View Single Post
  #25  
Old 12-19-2007, 08:53 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default 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)
Reply With Quote