New Zenner
- Join Date:
- May 2008
- Posts:
- 30
- Plugin Contributions:
- 0
Cash On Delivery and Fees
Hi all,
I'm having some issues with COD and cod fee modules:
-
Cash On Delivery always show as first selection even if order is 999
Note that I've only paypal and cod enabled (and paypal is set to 0) -
Cod is available only to a certain country and with some shipping method (not all)
I added some code to cod.php that disables it when the shipping method selected isn't right.
So the whole update_status function looks like :
// class methods
function update_status() {
global $order, $db;
if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_COD_ZONE > 0) ) {
$check_flag = false;
if (IS_ADMIN_FLAG === false) {
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_COD_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
} else {
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_COD_ZONE . "' order by zone_id");
}
while (!$check->EOF) {
if ($check->fields['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
}
$check->MoveNext();
}
if (! ( ($order->info['shipping_module_code'] == 'celere3_celere3') || ($order->info['shipping_module_code'] == 'celere1plus_celere1plus') ) ) {
$this->enabled = false;
$check_flag = false;
/* COD available only on poste Italiane (UGLY!!!) */
}
if ($check_flag == false) {
$this->enabled = false;
}
}
But it happens (not always) that a customer selecting courier (and then not celere3 or celere1plus is presented to pay the cod_fee
shouldn't cod be disabled by my change if a customer don't select the needed shipping modules ?
- where I've to write the piece of code that update the checkout_payment page when the user change the selected payment ? I'd like to show the differences in the price to customer without having them to reload the page
I mean if I select paypal as payment there won't be the cod fee and so the order total will be less than when selecting COD.
I want to update (via javascript/DOM) the order total (and the lines) without having the customer to submit the form.