Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding Information to Payment Modules


deansmar

Recommended Posts

i am using Osc 2.3.4 everything works fine.

 

in my old store 2.3.1

I had information showing under the Payment Modules..in "checkout_payment.php" 

it seams I can not find or remember what I did in my 2.3.1 shop to add this information...

 

I do not want to add the information to the "Title" as that would be shown every where and Description has enough to do...

 

could some one point me in the right direction.. !

 

for example:,

I have an extra line in the language file 'MODULE_PAYMENT_EU_BANKTRANSFER_TEXT_INFO':

define('MODULE_PAYMENT_EU_BANKTRANSFER_TEXT_TITLE', 'European Bank Transfer');
define('MODULE_PAYMENT_EU_BANKTRANSFER_TEXT_INFO', '(<font color="red">Euros Only</font>) <img src="images/ccards/sepa.gif" border="0" title=" SEPA " alt="SEPA" align="center">');
define('MODULE_PAYMENT_EU_BANKTRANSFER_TEXT_DESCRIPTION',
	'Please transfer the total amount to the following bank account.' . '<br />'.
	'Enter your name and your invoice number in the subject field' . '<br /><br />'.
	'Account: ' . MODULE_PAYMENT_EU_ACCOUNT_HOLDER . '<br />'.
	'Account IBAN: ' . MODULE_PAYMENT_EU_IBAN . '<br />'.
	'BIC / SWIFT code: ' . MODULE_PAYMENT_EU_BIC . '<br />'.
	'Bank: ' . MODULE_PAYMENT_EU_BANKNAME . '<br /><br />'.
	'We will ship your order as soon as we receive your payment.' . '<br />');

in the payment module this has been defined ....

$this->code = 'eubanktransfer';
$this->title = MODULE_PAYMENT_EU_BANKTRANSFER_TEXT_TITLE;
$this->info = MODULE_PAYMENT_EU_BANKTRANSFER_TEXT_INFO;
$this->description = MODULE_PAYMENT_EU_BANKTRANSFER_TEXT_DESCRIPTION;

and included it in the Array ...

function selection() {
return array(
	'id' => $this->code,
	'module' => $this->title, 
        'icon' => $this->info);

do I have to declare anything else, anywhere else...  for example in the Classes or Functions..??

what have I forgotten..??

 

help in this matter would be very much appreciated.

thanks

 

Link to comment
Share on other sites

sorted this Problem out my self.....

 

just changed the Array to read like this..

function selection() {
return array(
	'id' => $this->code,
	'module' => $this->title . $this->info);

and in the Language assosiated file add a <BR> if you would like to start the text under the payment method or add some spaces "   " for the text to start a little further away from the payment method

 

hope this helps any one else that would like to accieve this affect

post-189932-0-54947900-1426002428_thumb.jpg

Link to comment
Share on other sites

  • 2 weeks later...

Can you help me with this one :

<?php
/*
  $Id: mobilepay.php,v 1.1 2003/11/23

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  class mobilepay {
    var $code, $title, $description, $enabled;

// class constructor
    function mobilepay() {
        global $order;

      $this->code = 'mobilepay';
      $this->title = MODULE_PAYMENT_MOBILEPAY_TEXT_TITLE;
      $this->info = MODULE_PAYMENT_MOBILEPAY_TEXT_INFO;
      $this->description = MODULE_PAYMENT_MOBILEPAY_TEXT_DESCRIPTION;
      $this->email_footer = MODULE_PAYMENT_MOBILEPAY_TEXT_EMAIL_FOOTER;
      $this->sort_order = MODULE_PAYMENT_MOBILEPAY_SORT_ORDER;
      $this->enabled = ((MODULE_PAYMENT_MOBILEPAY_STATUS == 'True') ? true : false);

      if ((int)MODULE_PAYMENT_MOBILEPAY_ORDER_STATUS_ID > 0) {
        $this->order_status = MODULE_PAYMENT_MOBILEPAY_ORDER_STATUS_ID;
      }

      if (is_object($order)) $this->update_status();
    }

// class methods
    function update_status() {
      global $order;

      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_MOBILEPAY_ZONE > 0) ) {
        $check_flag = false;
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_MOBILEPAY_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
        while ($check = tep_db_fetch_array($check_query)) {
          if ($check['zone_id'] < 1) {
            $check_flag = true;
            break;
          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
            $check_flag = true;
            break;
          }
        }

        if ($check_flag == false) {
          $this->enabled = false;
        }
      }

// disable the module if the order only contains virtual products
      if ($this->enabled == true) {
        if ($order->content_type == 'virtual') {
          $this->enabled = false;
        }
      }
    }

    function javascript_validation() {
      return false;
    }

    function selection() {
      return array('id' => $this->code,
                   'module' => $this->title); . $this->info);
    }

    function pre_confirmation_check() {
      return false;
    }

    function confirmation() {
      return array('title' => MODULE_PAYMENT_MOBILEPAY_TEXT_DESCRIPTION);
    }

    function process_button() {
      return false;
    }

    function before_process() {
      return false;
    }

    function after_process() {
      return false;
    }

    function get_error() {
      return false;
    }

    function check() {
      if (!isset($this->_check)) {
        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_MOBILEPAY_STATUS'");
        $this->_check = tep_db_num_rows($check_query);
      }
      return $this->_check;
    }

    function install() {
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable MobilePay Module', 'MODULE_PAYMENT_MOBILEPAY_STATUS', 'True', 'Do you want to accept Australian Bank Deposit payments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_MOBILEPAY_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Telefon nummer.', 'MODULE_PAYMENT_MOBILEPAY_ACCNUM', '1234567890', 'telefonnummer.', '6', '1', now());");

      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shop Name', 'MODULE_PAYMENT_MOBILEPAY_ACCNAM', 'Butiks Navn', 'Konto Indehaver Navn', '6', '1', now());");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Bank Name', 'MODULE_PAYMENT_MOBILEPAY_BANKNAM', 'The Bank', 'Bank Name', '6', '1', now());");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_MOBILEPAY_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_MOBILEPAY_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
   }


      function remove() {
      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
    }

    function keys() {
      return array('MODULE_PAYMENT_MOBILEPAY_STATUS', 'MODULE_PAYMENT_MOBILEPAY_ACCNAM', 'MODULE_PAYMENT_MOBILEPAY_ACCNUM', 'MODULE_PAYMENT_MOBILEPAY_REG', 'MODULE_PAYMENT_MOBILEPAY_BANKNAM', 'MODULE_PAYMENT_MOBILEPAY_ZONE', 'MODULE_PAYMENT_MOBILEPAY_ORDER_STATUS_ID', 'MODULE_PAYMENT_MOBILEPAY_SORT_ORDER');

    }
  }
?>

<?php
/*
  $Id: dkbank.php,v v 1.2 2006/02/19

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  define('MODULE_PAYMENT_MOBILEPAY_TEXT_TITLE', 'MobilePay');
  define('MODULE_PAYMENT_MOBILEPAY_TEXT_INFO', '<img src="images/icons/mobilepay.png" border="0" title=" MOBILEPAY " alt="MOBILEPAY" align="center">');
  define('MODULE_PAYMENT_MOBILEPAY_TEXT_DESCRIPTION', 'Bruge følgende information til at lave <br>MobilePay overførsel:<br><br>Bank: <b>' . MODULE_PAYMENT_MOBILEPAY_BANKNAM . '</b><br>Kontoindehavers navn: <b>' . MODULE_PAYMENT_MOBILEPAY_ACCNAM . '</b><br>Mobil nummer: <b>' . MODULE_PAYMENT_MOBILEPAY_ACCNUM . '</b><br><br>Din ordre vil blive ekspederet når vi har registreret din indbetaling!');
  define('MODULE_PAYMENT_MOBILEPAY_TEXT_EMAIL_FOOTER', "Bruge følgende information til at lave <br>MobilePay overførsel:\n\nBank: " . MODULE_PAYMENT_MOBILEPAY_BANKNAM . "\nKontoindehavers navn: " . MODULE_PAYMENT_MOBILEPAY_ACCNAM . "\nMobil nummer: " . MODULE_PAYMENT_MOBILEPAY_ACCNUM . "\n\nDin ordre vil blive ekspederet når vi har registreret din indbetaling!");
?>

Best regard 

Dennis 

Link to comment
Share on other sites

  • 1 month later...

you still have a bracket to much..!

remove the bracket after "title"

so it looks like the below

function selection() {
return array(
	'id' => $this->code,
	'module' => $this->title . $this->info);
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...