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)
-   -   Payment Method - use Smarty var in "Special instructions" ? (https://forum.x-cart.com/showthread.php?t=46254)

carpeperdiem 03-13-2009 11:21 AM

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

geckoday 03-14-2009 05:21 AM

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>


carpeperdiem 03-15-2009 06:53 AM

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

carpeperdiem 11-04-2012 12:32 PM

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.

carpeperdiem 03-08-2013 02:54 PM

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 *}



All times are GMT -8. The time now is 03:53 PM.

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