Direct Debit form within checkout / end.php

  • Posts: 72
  • Thank you received: 0
11 years 9 months ago #89473

Hi,

One of the options we'd like to use on our site is the ability for a customer to pay for an item using Direct Debit. This is a payment method in the UK where a customer enters bank details and an automatic payment is made yearly or monthly or whatever time period is necessary.

Now, I know that HikaShop doesn't support a Direct Debit module but we can embed our Direct Debit form into a page using an iframe supplied to us by our Direct Debit provider.

I have edited the existing payment method 'Pay on delivery' and just renamed this to 'Direct Debit'.

I'd like to know if there's a snippet of code i can add to the end.php file that checks to see if the payment method 'Direct Debit' was selected and then displays the iframe at the end of checkout for the customer to enter their details.

If the payment method was selected as something different such as Paypal then the iframe doesn't display within the end.php file.

Currently I've just got the Direct Debit form displaying all of the time but this clearly isn't correct.

<?php
/**
 * @package  HikaShop for Joomla!
 * @version  2.1.0
 * @author  hikashop.com
 * @copyright  (C) 2010-2012 HIKARI SOFTWARE. All rights reserved.
 * @license  GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?>

<?php

echo ('<iframe style="background:#fff; border:1px solid #000;" width="100%" height="100%" src="DIRECT DEBIT FORM ADDRESS">&nbsp;</iframe>');

?>

<?php
if(empty($this->html)){
  echo JText::_('THANK_YOU_FOR_PURCHASE');
}else{
  echo $this->html;

}
$this->nextButton = false;

Last edit: 11 years 9 months ago by daveturner101. Reason: edit sample code

Please Log in or Create an account to join the conversation.

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
11 years 9 months ago #89574

Hi,

If you made a copy of the "collect on delivery" plugin, you can edit the file collectondelivery_end.php (the copy you made of course), and put your code there. No need to edit the end.php file of the checkout.

The following user(s) said Thank You: daveturner101

Please Log in or Create an account to join the conversation.

  • Posts: 72
  • Thank you received: 0
11 years 9 months ago #89832

Thanks, that suggestion appears to have done the job :)

Please Log in or Create an account to join the conversation.

Time to create page: 0.054 seconds
Powered by Kunena Forum