Ciao a tutti quanto segue è un modulo creato per aggiungere se si selezione un pagamento con paypal una tassa aggiuntiva, io vorrei che questo avvenga anche con altre forme di pagamento come ad esempio contrassegno o bonifico bancario.
Non si riesce a modificare questa contrib in se acquistano dall'italia aggiungi queste spese extra oltre all'iva?
files con modifiche paypal
in \catalog\includes\modules\order_total\ot_cc_fee.php
questo è il codice:
<?php
/*
$Id: ot_cc_fee.php,v 1.00 2002/11/30 17:02:00 harley_vb Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2002 osCommerce
Released under the GNU General Public License
*/
class ot_cc_fee {
var $title, $output;
function ot_cc_fee() {
$this->code = 'ot_cc_fee';
$this->title = MODULE_ORDER_TOTAL_CC_TITLE;
$this->description = MODULE_ORDER_TOTAL_CC_DESCRIPTION;
$this->enabled = ((MODULE_ORDER_TOTAL_CC_STATUS == 'true') ? true : false);
$this->sort_order = MODULE_ORDER_TOTAL_CC_SORT_ORDER;
$this->output = array();
}
function process() {
global $order, $currencies, $shipping;
if (MODULE_ORDER_TOTAL_CC_STATUS == 'true') {
$tax = tep_get_tax_rate(MODULE_ORDER_TOTAL_CC_TAX_CLASS);
if ($GLOBALS['payment'] == 'paypal_ipn') {
$ricarico= MODULE_ORDER_TOTAL_CC_RICARICO;
} else {
//COD selected, but no shipping module which offers COD
}
$order->info['tax'] += tep_calculate_tax($ricarico, $tax);
$order->info['tax_groups']["{$tax}"] += tep_calculate_tax($ricarico, $tax);
$order->info['total'] += $ricarico + tep_calculate_tax($ricarico, $tax);
$this->output[] = array('title' => $this->title . ':',
'text' => $currencies->format(tep_add_tax($ricarico, $tax), true, $order->info['currency'], $order->info['currency_value']),
'value' => tep_add_tax($ricarico, $tax));
}
}
function check() {
if (!isset($this->_check)) {
$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_CC_STATUS'");
$this->_check = tep_db_num_rows($check_query);
}
return $this->_check;
}
function keys() {
return array('MODULE_ORDER_TOTAL_CC_STATUS', 'MODULE_ORDER_TOTAL_CC_SORT_ORDER', 'MODULE_ORDER_TOTAL_CC_RICARICO', 'MODULE_ORDER_TOTAL_CC_TAX_CLASS');
}
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 COD', 'MODULE_ORDER_TOTAL_CC_STATUS', 'true', 'Do you want this module to display?', '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 ('Ordinamento', 'MODULE_ORDER_TOTAL_CC_SORT_ORDER', '4', 'Sort order of display.', '6', '2', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Ricarico Fisso', 'MODULE_ORDER_TOTAL_CC_RICARICO', '3.00', 'Inserire il valore di ricarico', '6', '3', 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 ('Tassa', 'MODULE_ORDER_TOTAL_CC_TAX_CLASS', '0', 'Usa questa tassa.', '6', '11', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
}
function remove() {
$keys = '';
$keys_array = $this->keys();
$keys_size = sizeof($keys_array);
for ($i=0; $i<$keys_size; $i++) {
$keys .= "'" . $keys_array[$i] . "',";
}
$keys = substr($keys, 0, -1);
tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in (" . $keys . ")");
}
}
?>
in catalog\includes\languages\italian\modules\order_total\ot_cc_fee.php
il codice è il seguente:
<?php
/*
$Id: ot_cod_fee.php,v 1.2 2004/03/25 22:10:00 chris@bluenoteweb.com Exp $
Designed for:
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
*/
define('MODULE_ORDER_TOTAL_CC_TITLE', 'Supplemento per pagamento con Pay Pal IVA compresa');
define('MODULE_ORDER_TOTAL_CC_DESCRIPTION', 'Supplemento per pagamento con Pay Pal IVA compresa');
?>
Tasse aggiuntive su tutti i metodi di pagamento esempio payp
Moderatore: mod Generali