Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Australia Post and COD Fee

Australia Post and COD Fee

Locked

Views: 2,774

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
23 Jun 2006, 1:51 AM
#1
drakky avatar

drakky

New Zenner

Join Date:
Jul 2005
Posts:
30
Plugin Contributions:
0

Australia Post and COD Fee

In Australia the basic COD Fee is a flat $9.00

I have the australia Post module installed, to get zen cart to add a flat fee of $9.00 on the totals page using auspost or auspostexpress you set the COD Fee for FLAT in Admin / Modules/ Order Totals

to AU:9.00

then edit file includes/modules/order_total/ot_cod_fee.php

by adding the 2 following lines( I am using only auspost and auspostexpress I presume it will work with other aus post modules, you'll just have to edit the lines for them )
after line 53 ( you will see the code looks similar to the lines immediately above)

if (substr_count($_SESSION['shipping']['id'], 'auspost') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_FLAT);

if (substr_count($_SESSION['shipping']['id'], 'auspostexpress') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_FLAT);

hope this helps someone else, took me long enough to figure it out

23 Jun 2006, 2:12 AM
#2
drakky avatar

drakky

New Zenner

Join Date:
Jul 2005
Posts:
30
Plugin Contributions:
0

Re: Australia Post and COD Fee

whooopsie , scratch the auspostexpress line above I just checked the Australiapost web site you can't have COD with express post , only with the
auspost

sorry

28 Jun 2006, 8:29 PM
#3
drakky avatar

drakky

New Zenner

Join Date:
Jul 2005
Posts:
30
Plugin Contributions:
0

Re: Australia Post and COD Fee

Hi
if anone could help as this is driving me mad lol, I am trying to disable the cod if Auspost express is selected , I have read 1000's of pages in htis forum and the closest I could come up with is this however it doesn't work as it disables cod for austpost parcel post as well , here's the code I edited in cod.php

// disable the module if the order only contains virtual products
if ($this->enabled == true) {
if ($order->content_type != 'physical') {
$this->enabled = false;
}
}
// disable the module if the order is not via auspost
if ($this->enabled == true) {
if ($order->shipping_module_code != 'auspost') {
$this->enabled = false;
}
}
}

on the payment method step 2 page I get regardless if I select auspost or auspost express

Payment Method
This is currently the only payment method available to use on this order.

Direct Bank Deposit

Direct Bank Deposit is the only other method I am wanting to use , could anyone help please?

31 Jul 2006, 9:16 AM
#4
drakky avatar

drakky

New Zenner

Join Date:
Jul 2005
Posts:
30
Plugin Contributions:
0

Re: Australia Post and COD Fee

this code works in oscommerce but not in zencart , I can't understand it the module is basically just the oscommerce one that has been adapted to zencart,
does anyone have any ideas please???

6 Aug 2006, 6:17 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Australia Post and COD Fee

If you were to trace the word: flat in the ot_cod_fee.php ...

You would need to make a clone or matching setting for your code in your auspost.php module ...

Once you have all lines cloned ...

You would need to uninstall and reinstall and reconfigure the Order Totals ... COD Fee ... module so that the new settings can be configured ...

You have to be careful on both spelling and case of the "buzz" word used ...

Peek at how flat or item or usps is done to get a feel for the pattern ...

6 Aug 2006, 6:18 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Australia Post and COD Fee

NOTE: not sure if you are still using these two lines:

if (substr_count($_SESSION['shipping']['id'], 'auspost') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_FLAT);

if (substr_count($_SESSION['shipping']['id'], 'auspostexpress') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_FLAT);

But you should not be using _FLAT in them ... that is for the flat shipping ...

7 Aug 2006, 8:28 AM
#7
drakky avatar

drakky

New Zenner

Join Date:
Jul 2005
Posts:
30
Plugin Contributions:
0

Re: Australia Post and COD Fee

Ajeh:

If you were to trace the word: flat in the ot_cod_fee.php ...

You would need to make a clone or matching setting for your code in your auspost.php module ...

Once you have all lines cloned ...

You would need to uninstall and reinstall and reconfigure the Order Totals ... COD Fee ... module so that the new settings can be configured ...

You have to be careful on both spelling and case of the "buzz" word used ...

Peek at how flat or item or usps is done to get a feel for the pattern ...
ok i added the following lines right after the respecrive FLAT versions

if (substr_count($_SESSION['shipping']['id'], 'auspost') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_AUSPOST);

function keys() {
return array('MODULE_ORDER_TOTAL_COD_STATUS', 'MODULE_ORDER_TOTAL_COD_SORT_ORDER', 'MODULE_ORDER_TOTAL_COD_FEE_FLAT', 'MODULE_ORDER_TOTAL_COD_FEE_AUSPOST', (etc etc)

$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('COD Fee for AUSPOST', 'MODULE_ORDER_TOTAL_COD_FEE_AUSPOST', 'AU:9.00', 'AUSPOST: <Country code>:<COD price>, .... 00 as country code applies for all countries. If country code is 00, it must be the last statement. If no 00:9.99 appears, COD shipping in foreign countries is not calculated (not possible)', '6', '5', now())");

and this code in cod.php but it still doesn't work

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

// disable if shipping is not auspost - start
if ($shipping['id']!="auspost_auspost") {
$this->enabled = false;
}
// disable if shipping is not auspost - end

yet in oscommerce you don't have to edit ot_cod_fee.php you only have to edit the cod.php for it to work correctly

8 Aug 2006, 2:51 AM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Australia Post and COD Fee

You could always go back to osC ... or you can rewrite the COD Fee module if you like ...

8 Aug 2006, 7:03 AM
#9
drakky avatar

drakky

New Zenner

Join Date:
Jul 2005
Posts:
30
Plugin Contributions:
0

Re: Australia Post and COD Fee

Ajeh:

You could always go back to osC ... or you can rewrite the COD Fee module if you like ...

pretty much the answer I'd expected .I think the reason zen cart isn't getting the community that it should have is because of this attitude.

basically zen cart is oscommerce that has had some bits of it rewritten . I'm pretty sure there aren't many differences in the cod.php file, it should work but I have no idea why it won't.
well thanks for your help