shutiri Posted November 7, 2010 Posted November 7, 2010 Hello, I'd like to add the 5.5% that 2CO charges me per transaction at the end of the payment process. Is that possible? Further Explanation: If a customer buys a products that cost $100, 2CO will charge me $5.5 I'd like to have several payment options, but if the customers chooses 2CO, he would have to pay $105.5 for that order, instead of $100 (with a disclaimer at the end of the payment process of course, before the customer moves forward with that payment). Is that possible ? Thx ! Quote
Guest Posted November 7, 2010 Posted November 7, 2010 Shutiri, There currently isn't a 'fee' contribution for 2C0, however there is one for the PayPal Fee which you might be able to use as a reference to create one for the 2C0 payment gateway. Chris Quote
tokke Posted August 18, 2012 Posted August 18, 2012 Yea, but this module doesnt work for me probably because i'm using 2.3 Quote
♥FWR Media Posted August 18, 2012 Posted August 18, 2012 Just write a new order totals module then enable it in the correct order in admin. Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
♥FWR Media Posted August 18, 2012 Posted August 18, 2012 (edited) Here you go: - Save this as file catalog/includes/modules/order_total/ot_2co.php <?php class ot_2co { var $title, $output; function ot_2co() { $this->code = 'ot_2co'; $this->title = MODULE_ORDER_TOTAL_2CO_TITLE; $this->description = MODULE_ORDER_TOTAL_2CO_DESCRIPTION; $this->enabled = ( (MODULE_ORDER_TOTAL_2CO_STATUS == 'true') ? true : false); $this->sort_order = MODULE_ORDER_TOTAL_2CO_SORT_ORDER; // 2co charge percentage $this->charge_percent_2co = 5.5; // The EXACT name of the payment module code e.g. $this->code = '2co'; in the payment class file $this->payment_code_2co = '2co'; $this->output = array(); } function process() { global $order, $currencies, $payment; if ( ( $payment != $this->payment_code_2co ) ) return; $percentage = $order->info['total'] / 100 * $this->charge_percent_2co; $order->info['total'] = ( $order->info['total'] + $percentage ); $this->output[] = array('title' => $this->title . ':', 'text' => $currencies->format($percentage, true, $order->info['currency'], $order->info['currency_value']), 'value' => $percentage); } function check() { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_2CO_STATUS'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } function keys() { return array('MODULE_ORDER_TOTAL_2CO_STATUS', 'MODULE_ORDER_TOTAL_2CO_SORT_ORDER'); } 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 ('Display 2CO charge', 'MODULE_ORDER_TOTAL_2CO_STATUS', 'true', 'Do you want to display the 2co charge?', '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', 'MODULE_ORDER_TOTAL_2CO_SORT_ORDER', '1', 'Sort order of display.', '6', '2', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } } ?> Then the following as catalog/includes/languages/english/modules/order_total/ot_2co.php <?php define('MODULE_ORDER_TOTAL_2CO_TITLE', '2CO Charge'); define('MODULE_ORDER_TOTAL_2CO_DESCRIPTION', 'Additional charge by 2CO'); ?> Now . .with the first file see ( line 14 ): $this->payment_code_2co = '2co'; I haven't the foggiest idea what the real code is for this payment module so guessed one up. Check the payment class file for the correct code and change the file before attempting to use. Go to admin>Modules>Order Total install the module and set the sort order before tax if you want the percentage added before tax and after for the opposite. This is thoroughly untested as I had never heard of 2co but it looks ok :) Edited August 18, 2012 by FWR Media Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
♥FWR Media Posted August 18, 2012 Posted August 18, 2012 Ahhh I believe I found it.. $this->payment_code_2co = 'pm2checkout'; Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
♥FWR Media Posted August 18, 2012 Posted August 18, 2012 (edited) So the order_total module file should be .. <?php class ot_2co { var $title, $output, $charge_percent_2co, $payment_code_2co; function ot_2co() { $this->code = 'ot_2co'; $this->title = MODULE_ORDER_TOTAL_2CO_TITLE; $this->description = MODULE_ORDER_TOTAL_2CO_DESCRIPTION; $this->enabled = ( (MODULE_ORDER_TOTAL_2CO_STATUS == 'true') ? true : false); $this->sort_order = MODULE_ORDER_TOTAL_2CO_SORT_ORDER; // 2co charge percentage $this->charge_percent_2co = 5.5; // The EXACT name of the payment module code e.g. $this->code = '2co'; in the payment class file $this->payment_code_2co = 'pm2checkout'; $this->output = array(); } function process() { global $order, $currencies, $payment; if ( ( $payment != $this->payment_code_2co ) ) return; $percentage = $order->info['total'] / 100 * $this->charge_percent_2co; $order->info['total'] = ( $order->info['total'] + $percentage ); $this->output[] = array('title' => $this->title . ':', 'text' => $currencies->format($percentage, true, $order->info['currency'], $order->info['currency_value']), 'value' => $percentage); } function check() { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_2CO_STATUS'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } function keys() { return array('MODULE_ORDER_TOTAL_2CO_STATUS', 'MODULE_ORDER_TOTAL_2CO_SORT_ORDER'); } 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 ('Display 2CO charge', 'MODULE_ORDER_TOTAL_2CO_STATUS', 'true', 'Do you want to display the 2co charge?', '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', 'MODULE_ORDER_TOTAL_2CO_SORT_ORDER', '1', 'Sort order of display.', '6', '2', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } } ?> Edited August 18, 2012 by FWR Media Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.