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

Payment methods - Special instructions - HTML - call .tpl coding help
 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #1  
Old 07-09-2007, 02:31 AM
 
ITVV ITVV is online now
 

X-Adept
  
Join Date: Nov 2006
Location: UK
Posts: 924
 

Default Payment methods - Special instructions - HTML - call .tpl coding help

Hi Guys,

I have altered my Payment method as per fearnothing's excellent suggestion as at http://forum.x-cart.com/showthread.php?t=22197&page=4 article #37.

Got the gif's showing fine and the HTML working great, however I would now like to do the following:

Based on which currency the customer has selected (We have the Ruby Mods Currency mod) when the checkout page opens I would like the payment methods instructions for say Cheques to include a file to display. Along the lines of

if $ruby_store_currency = GBP then
display check_details_GBP.html (This page would show details and address for GBP cheques)
if $ruby_store_currency = USD then
display check_details_USD.html (This page would show details and address for USD cheques)

etc etc.


Could somebody point me in the right direction please?

Many thanks in advance

Nick
__________________
X-Cart Pro 4.6.6 Active and working great!
X-Cart Pro 4.1.7 Retired after 9 years of first class service

Server: CloudLinux (LiteSpeed)
Apache: 2.4.27
PHP: 7.0.21
MySQL: 10.0.31-MariaDB-cll-lve
Arch: x86_64
Reply With Quote
  #2  
Old 07-09-2007, 02:54 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,460
 

Default Re: Payment methods - Special instructions - HTML - call .tpl coding help

You mean something like this:
Code:
{if $payment_data.paymentid eq 16} {include file="some_template.tpl"} {/if}

(paymentid 16 is for cheque)

Regards

:sK
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #3  
Old 07-09-2007, 03:03 AM
 
ITVV ITVV is online now
 

X-Adept
  
Join Date: Nov 2006
Location: UK
Posts: 924
 

Default Re: Payment methods - Special instructions - HTML - call .tpl coding help

Quote:
Originally Posted by chamberinternet
You mean something like this:
Code:
{if $payment_data.paymentid eq 16} {include file="some_template.tpl"} {/if}

(paymentid 16 is for cheque)

Regards

:sK

Hi,

Thanks for that.

The variable that we are using (have used it in other pages so I know that it is there) is $ruby_store_currency which can be either "GBP" or "USD".

So using your above example I change your code to: -


{if $ruby_store_currency eq GBP} {include file="skin1/modules/Fast_Lane_Checkout/itvv_pay.tpl"} {/if}
If I paste your code into the Payment method : Special instructions : Cheques in Admin and then view the checkout page as a customer it just displays that whole code section i.e.


{if $ruby_store_currency eq GBP} {include file="skin1/modules/Fast_Lane_Checkout/itvv_pay.tpl"} {/if}
Is this because I have changed the page to display HTML?

Many thanks and kind regards

Nick
__________________
X-Cart Pro 4.6.6 Active and working great!
X-Cart Pro 4.1.7 Retired after 9 years of first class service

Server: CloudLinux (LiteSpeed)
Apache: 2.4.27
PHP: 7.0.21
MySQL: 10.0.31-MariaDB-cll-lve
Arch: x86_64
Reply With Quote
  #4  
Old 07-09-2007, 03:09 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,460
 

Default Re: Payment methods - Special instructions - HTML - call .tpl coding help

Yes ... if it's a .html page you're showing it wont understand smarty code.

Shafiq :sK
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #5  
Old 07-09-2007, 03:11 AM
 
ITVV ITVV is online now
 

X-Adept
  
Join Date: Nov 2006
Location: UK
Posts: 924
 

Default Re: Payment methods - Special instructions - HTML - call .tpl coding help

Quote:
Originally Posted by chamberinternet
Yes ... if it's a .html page you're showing it wont understand smarty code.

Shafiq :sK

Thanks,

Any suggestions or thoughts on how I might achieve this?

Regards

Nick
__________________
X-Cart Pro 4.6.6 Active and working great!
X-Cart Pro 4.1.7 Retired after 9 years of first class service

Server: CloudLinux (LiteSpeed)
Apache: 2.4.27
PHP: 7.0.21
MySQL: 10.0.31-MariaDB-cll-lve
Arch: x86_64
Reply With Quote
  #6  
Old 07-09-2007, 03:18 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,460
 

Default Re: Payment methods - Special instructions - HTML - call .tpl coding help

Not 100% sure ... Using javascript is a possibility maybe ?

Is there a reason to why you're displaying the page in .html formar rather than in .tpl ?

Regards

Shafiq :sK
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #7  
Old 07-10-2007, 12:14 AM
 
ITVV ITVV is online now
 

X-Adept
  
Join Date: Nov 2006
Location: UK
Posts: 924
 

Default Re: Payment methods - Special instructions - HTML - call .tpl coding help

Hi Guys,

Just to explain a little more about the mod I did to the Checkout page.

I did the mod as per Fearnothing's excellent suggestion at http://forum.x-cart.com/showthread.php?t=22197&page=4 article #37.

This mod allows you to use the "Special Instructions" box on the Payment meathods page in Admin to display .gif images of credit cards as per the following screen shot contained in the attachment xcart-payment-001.jpg.

Notice the Visa and MasterCard gif's along with the PayPal gif.

What I am trying to do is write some code for the "Cheque" payment method that takes the value of $ruby_store_currency and then displays information in that box based on the currency set, along the following lines: -

{if $ruby_store_currency eq GBP}
{include file="skin1/modules/Fast_Lane_Checkout/GBP_pay.tpl"}
{if $ruby_store_currency eq USD}
{include file="skin1/modules/Fast_Lane_Checkout/USD_pay.tpl"}
{/if}

In the above example if $ruby_store_currency = GBP it would include a file called GBP_pay.tpl with the following HTML code: -

Please make cheque payable to anycompany.com and send to: -

Anycompany.com
Any Street Road
Any Town
Any Country
Any Zip Code
UK

Cheques must be in Pound Sterling

In the next example if $ruby_store_currency = USD it would include a file called USD_pay.tpl with the following HTML code: -

Please make cheque payable to anycompany.com and send to: -

Anycompany.com
Any Street Road
Any Town
Any Country
Any Zip Code
United States

Cheques must be in United States Dollars

But when I click on "Checkout" as in the first step to complete your order and are taken to the Payment Method screen, the url shows: -

https://whatevercompany.com/cart.php?mode=checkout

All I am getting is the actual code that I have written in the Cheque (Admin - Payment Methods - Special instructiosn box) box, as contained in the attachment xcart-payment-002.jpg

Any thoughts on how I can achieve this please?

Many thanks in advance and kind regards to all

Nick
Attached Thumbnails
Click image for larger version

Name:	xcart-payment-001.jpg
Views:	29
Size:	36.5 KB
ID:	455  Click image for larger version

Name:	xcart-payment-002.jpg
Views:	22
Size:	23.7 KB
ID:	456  
__________________
X-Cart Pro 4.6.6 Active and working great!
X-Cart Pro 4.1.7 Retired after 9 years of first class service

Server: CloudLinux (LiteSpeed)
Apache: 2.4.27
PHP: 7.0.21
MySQL: 10.0.31-MariaDB-cll-lve
Arch: x86_64
Reply With Quote
  #8  
Old 07-10-2007, 02:56 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,460
 

Default Re: Payment methods - Special instructions - HTML - call .tpl coding help

I've never actually used this mod before ...

Been looking and wondering if the following will help:

- Open up /skin1/customer/main/checkout.tpl

- Find the following line:
Code:
{$payment_methods[payment].payment_details|default:" "}

- Replace with the following:
Code:
{if $payment_methods[payment].paymentid eq 16} {if $ruby_store_currency eq GBP} {include file="skin1/modules/Fast_Lane_Checkout/GBP_pay.tpl"} {elseif $ruby_store_currency eq USD} {include file="skin1/modules/Fast_Lane_Checkout/USD_pay.tpl"} {/if} {else} {$payment_methods[payment].payment_details|default:" "} {/if}

Hope this helps ?

Regards

Shafiq :sK
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #9  
Old 07-10-2007, 03:50 AM
 
ITVV ITVV is online now
 

X-Adept
  
Join Date: Nov 2006
Location: UK
Posts: 924
 

Default Re: Payment methods - Special instructions - HTML - call .tpl coding help

Quote:
Originally Posted by chamberinternet
I've never actually used this mod before ...

Been looking and wondering if the following will help:

- Open up /skin1/customer/main/checkout.tpl

- Find the following line:
Code:
{$payment_methods[payment].payment_details|default:" "}

- Replace with the following:
Code:
{if $payment_methods[payment].paymentid eq 16} {if $ruby_store_currency eq GBP} {include file="skin1/modules/Fast_Lane_Checkout/GBP_pay.tpl"} {elseif $ruby_store_currency eq USD} {include file="skin1/modules/Fast_Lane_Checkout/USD_pay.tpl"} {/if} {else} {$payment_methods[payment].payment_details|default:" "} {/if}

Hope this helps ?

Regards

Shafiq :sK

Hi Shafiq :sK,

Tried your code/mod but the page displays nothing - no errors or anything.

Any other thoughts?

Thanks again for your help and time.

Regards

Nick
__________________
X-Cart Pro 4.6.6 Active and working great!
X-Cart Pro 4.1.7 Retired after 9 years of first class service

Server: CloudLinux (LiteSpeed)
Apache: 2.4.27
PHP: 7.0.21
MySQL: 10.0.31-MariaDB-cll-lve
Arch: x86_64
Reply With Quote
  #10  
Old 07-10-2007, 08:14 AM
 
ITVV ITVV is online now
 

X-Adept
  
Join Date: Nov 2006
Location: UK
Posts: 924
 

Default Re: Payment methods - Special instructions - HTML - call .tpl coding help

Hi Shafiq,

Please find attached my checkout.tpl as per you pm.

Hope that you can shed some light on this as I am now confused!!

Once again many thanks for your help and time on this.

Kind regards

Nick
Attached Files
File Type: tpl checkout.tpl (6.8 KB, 12 views)
__________________
X-Cart Pro 4.6.6 Active and working great!
X-Cart Pro 4.1.7 Retired after 9 years of first class service

Server: CloudLinux (LiteSpeed)
Apache: 2.4.27
PHP: 7.0.21
MySQL: 10.0.31-MariaDB-cll-lve
Arch: x86_64
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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:42 PM.

   

 
X-Cart forums © 2001-2018