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

Payment Method - use Smarty var in "Special instructions" ?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-13-2009, 11:21 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Payment Method - use Smarty var in "Special instructions" ?

In the Payment Method screen, I know that we can use html in the "Special instructions" - to place a credit card image or whatever...

http://forum.x-cart.com/showthread.php?p=131711#post131711

What about using a Smarty variable in there? Can a $var be used in the special instructions? How?

I tried {$variable} and simply, $variable, but neither worked.

Help? Thanks.

Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #2  
Old 03-14-2009, 05:21 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: Payment Method - use Smarty var in "Special instructions" ?

You need to use the Smarty eval function in the template to evaluate Smarty variables. Try changing this in checkout.tpl:
Code:
<td>{$payment_methods[payment].payment_details|default:"&nbsp;"}</td>
To this:
Code:
{eval var=$payment_methods[payment].payment_details assign="paydtls"} <td>{$paydtls|default:"&nbsp;"}</td>
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote

The following user thanks geckoday for this useful post:
carpeperdiem (03-15-2009)
  #3  
Old 03-15-2009, 06:53 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Payment Method - use Smarty var in "Special instructions" ?

Quote:
Originally Posted by geckoday
You need to use the Smarty eval function in the template to evaluate Smarty variables. Try changing this in checkout.tpl

Hi Ralph,

THANK YOU. This worked perfectly.

BTW, in case anyone else is searching for this in the future, I put this into /skin1/modules/Checkout_One/checkout_one.tpl instead of checkout.tpl, and used smarty vars in the payment method special instructions -- same result. Perfect!

Thanks,

Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #4  
Old 11-04-2012, 12:32 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Payment Method - use Smarty var in "Special instructions" ?

I searched for this in the future...

IN 4.5.4, edit file:

/common_files/modules/One_Page_Checkout/payment_methods.tpl

find:

Code:
{$payment.payment_details} {if $payment.processor eq "cc_mbookers_wlt.php"}

replace with:

Code:
{* BEGIN var in payment details mod *} {* {$payment.payment_details} *} {eval var=$payment.payment_details assign="paydtls"} {$paydtls} {* END var in payment details mod *} {if $payment.processor eq "cc_mbookers_wlt.php"}

(looks like $payment_methods[payment].payment_details became $payment.payment_details sometime between 4.1 and 4.5)

Hope this helps someone (possibly me?) in the future.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #5  
Old 03-08-2013, 02:54 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Payment Method - use Smarty var in "Special instructions" ?

It's the future...

Checkout One version 2 made some changes to the template structure.
In version 2.0.2

file:
/skin/common_files/modules/Checkout_One/checkout_one_payment_methods.tpl

FIND:
{$v.payment_details}

REPLACE WITH:
Code:
{* BEGIN var in payment details mod *} {* {$v.payment_details} *} {eval var=$v.payment_details assign="paydtls"} {$paydtls} {* END var in payment details mod *}
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
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 01:26 PM.

   

 
X-Cart forums © 2001-2020