Forums / Addon Shipping Modules / ozpost shipping module

ozpost shipping module

Views: 403,745

Results 21 to 40 of 2,251
29 Mar 2009, 5:40 AM
#21
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

ozpost shipping module

remoteone:

\includes\modules\shipping\ not /includes/languages/english/modules/shipping/ as I understand it

I should also mention that the back slashes \ are for the Windows path names. Apache uses the forward slashes / for the URL paths.

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

29 Mar 2009, 6:24 AM
#22
remoteone avatar

remoteone

Zen Follower

Join Date:
Jan 2009
Location:
Macclesfield, South Australia
Posts:
104
Plugin Contributions:
0

Re: ozpost shipping module

I created an empty ozpost.php file in /includes/languages/english/modules/shipping/ (the / vs \ path symbolism is simply a case of me pasting the text as is)

The first errors have gone but still getting this error:
in** admin> modules >shipping**

Warning: Missing argument 4 for template_func::get_template_dir(), called in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zc1\includes\modules\shipping\ozpost.php on line 67 and defined in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zc1\includes\classes\template_func.php on line 42

Warning: Missing argument 4 for template_func::get_template_dir(), called in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zc1\includes\modules\shipping\ozpost.php on line 69 and defined in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zc1\includes\classes\template_func.php on line 42

Warning: Missing argument 4 for template_func::get_template_dir(), called in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zc1\includes\modules\shipping\ozpost.php on line 70 and defined in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zc1\includes\classes\template_func.php on line 42

Warning: Missing argument 4 for template_func::get_template_dir(), called in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zc1\includes\modules\shipping\ozpost.php on line 97 and defined in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zc1\includes\classes\template_func.php on line 42

Warning: Missing argument 4 for template_func::get_template_dir(), called in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zc1\includes\modules\shipping\ozpost.php on line 97 and defined in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zc1\includes\classes\template_func.php on line 42

Warning: Missing argument 4 for template_func::get_template_dir(), called in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zc1\includes\modules\shipping\ozpost.php on line 97 and defined in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zc1\includes\classes\template_func.php on line 42

These last lines are repeated many times.

Thats a serious beard you've got going there by the way !
Thanks

The Poor Pay Twice.........remoteone.com.au

29 Mar 2009, 6:49 AM
#23
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: ozpost shipping module

remoteone:

The first errors have gone but still getting this error:
in** admin> modules >shipping**

Warning: Missing argument 4 for template_func::get_template_dir(), called in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zc1\includes\modules\shipping\ozpost.php on line 67 and defined in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zc1\includes\classes\template_func.php on line 42

Still clutching at straws, but could you please try editing /modules/shipping/ozpost.php

Locate the line that reads

global $order, $db, $template, $ipath, $ipath2 ;

and add $current_page_base as another global.

Thanks,
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

29 Mar 2009, 8:28 AM
#24
lowlyworm avatar

lowlyworm

New Zenner

Join Date:
Mar 2009
Posts:
19
Plugin Contributions:
0

Re: ozpost shipping module

Hello,
I created a blank ozpost.php in the appropriate location (/var/www/includes/languages/english/modules/shipping/ozpost.php) and that solved the first one.

Next is the parameter problem "Missing argument 4 for template_func::get_template_dir()"

The method is declared in template_func.php as:

function get_template_dir($template_code, $current_template, $current_page, $template_dir, $debug=false)

But is being called in ozpost.php as

$template->get_template_dir('ozpost_del.jpg', $ipath,$ipath2)

Your old AustPost module makes the call with 4 params.. How is get_template_dir declared in your version of Zen Cart? (I have the latest version installed 1.3.8a).. If I add a default blank parameter it's happy, but that might be masking something else..

Anyway, with those fixes it seems to install correctly and works :-)

A Registered International Parcel option would be awesome (now available for parcels up to 2 kg)

Thanks for your effort in supplying this,
David

29 Mar 2009, 10:12 AM
#25
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: ozpost shipping module

LowlyWorm:

Hello,
I created a blank ozpost.php in the appropriate location (/var/www/includes/languages/english/modules/shipping/ozpost.php) and that solved the first one.

Next is the parameter problem "Missing argument 4 for template_func::get_template_dir()"

The method is declared in template_func.php as:

function get_template_dir($template_code, $current_template, $current_page, $template_dir, $debug=false)

But is being called in ozpost.php as

$template->get_template_dir('ozpost_del.jpg', $ipath,$ipath2)

Your old AustPost module makes the call with 4 params.. How is get_template_dir declared in your version of Zen Cart? (I have the latest version installed 1.3.8a).. If I add a default blank parameter it's happy, but that might be masking something else..

Anyway, with those fixes it seems to install correctly and works :-)

A Registered International Parcel option would be awesome (now available for parcels up to 2 kg)

Thanks for your effort in supplying this,
David

Great. I do believe we are getting somewhere :-)

Unless I'm mistaken the 'missing parameter' is supposed to be supplied by the $ipath variable. IOW, $ipath is supposed to expand to
"value1, $value2" (without the quotes), but it appears it is being seen as a single value (same data, but with quotes).

I'm not sure why it is working correctly on my system(s), perhaps it is due to a subtle difference between Linux and Windows?

As for the Registered International parcels, I'd swear blind that I'd catered for that. I guess this also warrants further investigation. On the plus side, even if it hasn't been catered for, the way this version is designed it is actually quite a trivial task to add new methods, so this WILL be supported (or fixed) in the very near future.

Quick question, where did you add the blank parameter in order to get it working? (between the two $ipaths? before them? or after them?)
Trying to save myself a little work :-)

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

29 Mar 2009, 10:51 AM
#26
lowlyworm avatar

lowlyworm

New Zenner

Join Date:
Mar 2009
Posts:
19
Plugin Contributions:
0

Re: ozpost shipping module

Hi,
I made the modification to /var/www/includes/classes/template_func.php purely to see if everything else worked correctly by hiding that 4th param error.

Changed

function get_template_dir($template_code, $current_template, $current_page, $template_dir, $debug=false)

to

function get_template_dir($template_code, $current_template, $current_page, $template_dir = '', $debug=false)

I'm not a PHP coder (only started looking through it yesterday), and all this dynamic typing scares me a little compared to strongly typed lanugages which I'm used to. It seems much harder to tell what you are dealing with when you have a variable i.e. I have to look up to try and find what was assigned to it.. anyway, I'm getting side tracked about PHP!

I'm interested in what you mention about $ipath expanding, is that a feature of PHP where a variable can expand to fill more than one parameter? What type does the variable have to be?

By the way, I have the latest version of PHP5 installed (or very close to).

David

29 Mar 2009, 12:06 PM
#27
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: ozpost shipping module

LowlyWorm:

Hi,
I made the modification to /var/www/includes/classes/template_func.php purely to see if everything else worked correctly by hiding that 4th param error.
Changed
function get_template_dir($template_code, $current_template, $current_page, $template_dir, $debug=false)
to
function get_template_dir($template_code, $current_template, $current_page, $template_dir = '', $debug=false)

I'd strongly advise against changing that particular file (other than for debugging purposes). The reason being is that is one of the core zencart files and it can possibly cause lots of unforeseen problems because lots of modules, perhaps all them them will be dependent on it.
It also means it'll need to be repatched any time zencart gets an upgrade.

LowlyWorm:

I'm not a PHP coder (only started looking through it yesterday), and all this dynamic typing scares me a little compared to strongly typed lanugages which I'm used to.

I could argue that if you are used to strongly typed lanquages, the PHP should be a PoP (piece of pxss) <grin>

LowlyWorm:

It seems much harder to tell what you are dealing with when you have a variable i.e. I have to look up to try and find what was assigned to it.. anyway, I'm getting side tracked about PHP!

LOL.

LowlyWorm:

I'm interested in what you mention about $ipath expanding, is that a feature of PHP where a variable can expand to fill more than one parameter? What type does the variable have to be?

Actually, 'expanding' was probably a poor choice of words, and not really correct.

Suppose we needed to pass two parameters to a function, we would typically use something like:

thisfunction(valueA, valueB)

Or in a strongly typed language

thisfunction(int integerA, string stringA)

What I have done (trying to avoid retyping the same thing in several different places) is to create a 3rd variable called $ipath (for IconPath)
that concats the two paramters to be passed to the function. In other words, using the examples above
$ipath = valueA + "," + valueB

or, strongly typed, it would be:

$ipath = "int " + integerA + "," + "string" + stringA

So now when I call the function, instead of
thisfunction(int integerA, string stringA) I am simply using
thisfunction($ipath)

In most cases/programs this technique would be useless/pointless, but since the icon path never changes during the programs execution it seemed like a practical thing to do.
When I said 'expansion' I was implying that the function being called wouldn't be seeing "$ipath" as a single parameter, it would be recieving it as two separate values ie, valueA, comma, valueB.

This clearly works on my system(s), but for some reason or another it isn't working on yours and at least two others (all windows based)

I think I'll take the 'safe' way in fixing this one and pass the parameters in the more traditional manner rather than saving a few bytes of typing (which has now been 'wasted' in trying to sort out what the heck has gone wrong).

Live and learn. (and frustate a few people in the process).

Cheers, and thanks heaps for all the debugging. I'll try to get an updated release out in the next few days, after I've figured out what the heck happened to the registered overseas parcels.

Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

29 Mar 2009, 12:59 PM
#28
lowlyworm avatar

lowlyworm

New Zenner

Join Date:
Mar 2009
Posts:
19
Plugin Contributions:
0

Re: ozpost shipping module

RodG:

I'd strongly advise against changing that particular file (other than for debugging purposes). The reason being is that is one of the core zencart files and it can possibly cause lots of unforeseen problems because lots of modules, perhaps all them them will be dependent on it.
It also means it'll need to be repatched any time zencart gets an upgrade.
Rod

Hi Rod,

I'd agree, I only changed it for debugging purposes (live server will be a fresh install when I've worked out all my mods etc :-))

Thanks for the other info. You can't construct a string representing the combined parameters as they'd look at compile time and pass it at runtime in C++, Java etc. (as I'm sure you know :)).. however PHP seems to be a complete free for all.. ! hehe ;-)

Let me know if I can do anything to help,
Thanks!
David

29 Mar 2009, 1:35 PM
#29
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: ozpost shipping module

LowlyWorm:

Thanks for the other info. You can't construct a string representing the combined parameters as they'd look at compile time and pass it at runtime in C++, Java etc. (as I'm sure you know :))

I do, just as I'm sure you know by now that unlike C++, Java, etc, which are compiled, PHP is little more than a script.

LowlyWorm:

.. however PHP seems to be a complete free for all.. ! hehe ;-)
David

I'm never really sure if this is a blessing or a curse. As you say, it makes it a free for all, which makes it a pretty easy language to learn, but it also allows the ability to create lots of buggy code that simply couldn't exist in a strictly typed language.

Mind you, PHP isn't the worst in this regard. Have you ever looked into Pyhon? It is the only language that I know where you can do something like:

variable = "Hello World"
print variable * 2
and it will dutifully print out "Hello World Hello World".

Now THAT's a free for all, but even odder is that Python is actually compiled and still allows this.

Cheers
Rod. (heading off to bed)

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

29 Mar 2009, 5:17 PM
#30
remoteone avatar

remoteone

Zen Follower

Join Date:
Jan 2009
Location:
Macclesfield, South Australia
Posts:
104
Plugin Contributions:
0

Re: ozpost shipping module

I should be in bed also,
Looks like you've got a bit of work to do there Rod...
I'm gonna wait 'till the ozpost module is all figured out... as if any module is ever "all figured out".. this is free-open-source
Thanks for your efforts ...

The Poor Pay Twice.........remoteone.com.au

1 Apr 2009, 7:01 AM
#31
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: ozpost shipping module

LowlyWorm:

Let me know if I can do anything to help,
Thanks!
David

Hi David, I'd appreciate your help :-)

Attached to this message (hopefully) is a .zip file called ozpost_test.zip

Within it you will find two files, an update of the ozpost.php file, and a small jpeg for the overseas registered parcels.

Place the jpeg file in with the other ozpost jpegs.

Replace the modules/includes/shipping/ozpost.php with this one.
Log into admin, hit the 'remove' button to remove the existing ozpost module, then immediately hit the 'install' button to reinstall. This action is required to enable the overseas registered function. It appear that I did code for it on the server side, but it fell through the cracks on the client side.

I've updated the icon path stuff so you shouldn't need to hack anything to get it to install (in fact this is what I really need you to test for me).

As long as I get positive feedback from you I'll create another full package and upload it to the zencart downloads area for others.

For anyone else reading this, please be advised that the attachment is NOT a full distribution, so don't expect to download it it and have it just 'work'. You are however free to download the original archive from the downloads area and follow the instructions above.

[Attachment no longer available]

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

1 Apr 2009, 7:42 AM
#32
lowlyworm avatar

lowlyworm

New Zenner

Join Date:
Mar 2009
Posts:
19
Plugin Contributions:
0

Re: ozpost shipping module

Hi Rod,
No problem, thanks for the update. I was just heading out for a little but will check it out as soon as I get back. Will let you know how I go :)

David

1 Apr 2009, 1:53 PM
#33
lowlyworm avatar

lowlyworm

New Zenner

Join Date:
Mar 2009
Posts:
19
Plugin Contributions:
0

Re: ozpost shipping module

I've installed the two new files, uninstalled and reinstalled the module (also double checked previous default parameter was removed) and all is looking good on initial inspection i.e. I didn't see any errors etc. I haven't given it a real good bash yet but registered international parcels are certainly there now, great!

Interestingly though, I did notice that it was listing "Express Parcel International" even when it wasn't enabled in the admin section. I tried enabling it and disabling it but shows up either way. Insured Express Parcel International only shows when enabled though. Again, I haven't given it a very thorough work out though, I can have a better look tomorrow.

David

2 Apr 2009, 12:17 AM
#34
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: ozpost shipping module

LowlyWorm:

I've installed the two new files, uninstalled and reinstalled the module (also double checked previous default parameter was removed) and all is looking good on initial inspection i.e. I didn't see any errors etc. I haven't given it a real good bash yet but registered international parcels are certainly there now, great!

Excellent news. :-)

LowlyWorm:

Interestingly though, I did notice that it was listing "Express Parcel International" even when it wasn't enabled in the admin section. I tried enabling it and disabling it but shows up either way. Insured Express Parcel International only shows when enabled though. Again, I haven't given it a very thorough work out though, I can have a better look tomorrow.

David

Thanks. I've just had a look at the EPI showing all the time, and can confirm that it's a bug. I've already taken care of it.

I'll await for any further feedback before I zip the whole thing up again.

Cheers
Rod.

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

3 Apr 2009, 4:49 AM
#35
neridal avatar

neridal

New Zenner

Join Date:
Mar 2009
Posts:
10
Plugin Contributions:
0

Re: ozpost shipping module

Hi,

I just downloaded the new version of OzPost...

There are no files (or directory) for includes/languages/english etc in the zip file I downloaded, so when I installed it I got errors complaining that the files don't exist....

Is there something missing in the download area, or did mine just not download properly?

Thanks for your great work to provide this module, it has saved me many days of work....

Nerida.

3 Apr 2009, 4:57 AM
#36
lowlyworm avatar

lowlyworm

New Zenner

Join Date:
Mar 2009
Posts:
19
Plugin Contributions:
0

Re: ozpost shipping module

neridal:

Hi,

Is there something missing in the download area, or did mine just not download properly?

Nerida.

Hi Nerida,
There is a new version being tested with some fixes Rod has added in, which will no doubt be available soon.

David

3 Apr 2009, 5:04 AM
#37
neridal avatar

neridal

New Zenner

Join Date:
Mar 2009
Posts:
10
Plugin Contributions:
0

Re: ozpost shipping module

Thanks David,
I guess I will wait and see...

:smile:

3 Apr 2009, 11:11 AM
#38
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: ozpost shipping module

neridal:

Hi,

I just downloaded the new version of OzPost...

There are no files (or directory) for includes/languages/english etc in the zip file I downloaded, so when I installed it I got errors complaining that the files don't exist....

Is there something missing in the download area, or did mine just not download properly?

Thanks for your great work to provide this module, it has saved me many days of work....

Nerida.

As David has said, a new update is currently being tested that takes care of this (and a couple of other problems). It should be available in a few days.

Meanwhile, if you you can't wait that long, AND you are running your server on a LINUX based system you should be able to get things working by creating an empty file in the languages directory called 'ozpost.php'.

Please be advised though that there are a couple of other bugs that may or may not affect you, eg, the 'kg/gms' setting doesn't work (it is 'stuck' on gms), and one of the overseas shipping methods is stuck in the 'on' position.

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

6 Apr 2009, 5:52 AM
#39
neridal avatar

neridal

New Zenner

Join Date:
Mar 2009
Posts:
10
Plugin Contributions:
0

Re: ozpost shipping module

Thanks Rod,

I will wait for now, as we are only in the setup phase for our shopping cart with products.

Great to know you are making progress...

cheers,
Nerida.:yes:

9 Apr 2009, 5:52 AM
#40
matthewrossser avatar

matthewrossser

New Zenner

Join Date:
Mar 2009
Posts:
20
Plugin Contributions:
0

Re: ozpost shipping module

Hi There,

Great work on the shipping module !!

I have it installed & operational.

The items in my shop are quite large & I am having problems if shipping more than 1 item as the combined total of all items exceeds the OzPost maximium. It seems it doesn't see the items as being seperate boxes and adds ALL together for 1 global package.
I can not seem to find any facility in your Module or Zencart to split the shipping of the items to be indiviually boxed, packaged.

Using latest Zen & also your module.

Is there a script hack to enable this or is it a core rewrite for the next version ?

Regards
Matt