Zen Cart Logo
Forums / Addon Shipping Modules / ozpost shipping module

ozpost shipping module

Views: 403,033

Results 2,041 to 2,060 of 2,251
8 Jul 2014, 9:34 AM
#2041
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

ozpost shipping module

Zencart 1.51
Ozpost - V3.6.1

Hi Rod

I'm hoping you can help, when we try to add a 1 kilogram item to the shopping cart and go to checkout, the only shipping options offered are

Australia Post Parcel under 500g
Australia Post 500g Express Satchel

Which seems a bit odd

I have tested this on an old version of the site from when we upgraded a few years ago using an older version of ozpost
Zen - 1.51
Ozpost - V3.4.0
and the option that came up was
Australia Post, 3kg Express Satchel

Which seems correct to me.

Any idea what would cause this

or what information you might need me to provide to help you diagnose it, because I am heartily stumped

8 Jul 2014, 10:03 AM
#2042
rodg avatar

rodg

Deceased

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

Re: ozpost shipping module

nigelt74:

Any idea what would cause this

Check the ozpost weight setting. It's probably either unset, or set for set to gms.

Also check for the 'hide parcel' settings. You've possibly got the 'Hide parcel rates if Satchel sized' set to 'yes'.

If this doesn't help please provide a link to the 1kg product that is showing the problem.

Cheers
RodG

8 Jul 2014, 11:04 AM
#2043
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: ozpost shipping module

RodG:

Check the ozpost weight setting. It's probably either unset, or set for set to gms.

Cheers I think thats got it, it wasn't set so i set it to kgs,

odd that it worked ok in the old version but not the new, something must have corrupted when i was moving the database from test to actual store, will do a bit more testing and see if i can figure what happened

Thanks heaps, i had looked and didn't even think to check that

8 Jul 2014, 2:03 PM
#2044
rodg avatar

rodg

Deceased

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

Re: ozpost shipping module

nigelt74:

Cheers I think thats got it, it wasn't set so i set it to kgs,

odd that it worked ok in the old version but not the new, something must have corrupted when i was moving the database from test to actual store, will do a bit more testing and see if i can figure what happened

Thanks heaps, i had looked and didn't even think to check that

Don't waste any time looking for the cause. There was a bug in a couple of the earlier versions of the code that caused this setting to become unset with some of the later updates. Unless you've observed other problems that is most likely to be the cause.

Cheers
Rod.
ps. I got your pm's and was able to verify my diagnosis, but you'd already got back to me before I was able to confirm.

14 Jul 2014, 12:55 AM
#2045
peter_homann avatar

peter_homann

Zen Follower

Join Date:
Jun 2006
Location:
Melbourne, VIC
Posts:
106
Plugin Contributions:
0

Re: ozpost shipping module

Hi Rod,

I know your a busy man but.......

I use the copy product quite a bit in Zencart when I have a range of products I entering. It is possible for the Ozpost install to modify zencart to copy the length, width and height when the product is copied?

It's not a big issue, more of an annoyance having to do it manually.

Cheers,

Peter

14 Jul 2014, 8:08 AM
#2046
rodg avatar

rodg

Deceased

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

Re: ozpost shipping module

Peter Homann:

It is possible for the Ozpost install to modify zencart to copy the length, width and height when the product is copied?

Is it possible? Yes.

Will it be something that I'm willing to implement? No, at least not in the foreseeable future.

There are many reasons for this.

  1. The copying/moving of products isn't really function that a shipping module needs to handle.
  2. If added, I can't be assured of future update compatibility.
  3. It involves editing of core files, that may have been edited by other modules.
  4. Lack of time.
  5. Lack of demand (you are the 1st person to ask me for this)

I could probably come up with others, but you get the general idea.

Now, having said that, in theory it should be quite an easy modification to make. First you'll need to identify the file(s) that handle the copying of products.
Next you'll need to locate the lines of code that mange the weight fields, and finally you'll need to replicate these lines 3 times and edit the weight references to length, width & height respectively.

As I say, in theory it should be quite easy (only minimal coding knowledge required). The hardest part is in identifying the file(s) that need to be edited.

Cheers
RodG

16 Jul 2014, 4:22 AM
#2047
my_red_zebra avatar

my_red_zebra

New Zenner

Join Date:
Sep 2011
Location:
Melbourne, Australia
Posts:
31
Plugin Contributions:
0

Re: ozpost shipping module

Hi Rod, I don't think this has been raised in the past, but with over 200 pages alone on this thread, I might have missed something. We are a user of your Ozpost module and it's going really well for us on our shops. However, now we have a need where one of our customers uses Pickerings to pick up goods (these can be a box, a few boxes, a pallet or a number of pallets) from the producer and delivers them to a metro Depot in each states main city. They then deliver from Depot to Door.

Are you aware of a way that we can cost this into ZenCart or (you) build into Ozpost? I'm sure we wouldn't be the only user out there that does this sort of things.

Basically, we have a minimum cost for collection (based on 5 boxes), then we add a cost per pallet (one price for the first pallet, then a different for two or more pallets). Then we have to add the Depot to Door costs as well.

I'm not sure if this can be done within ZenCart as it stands "out of the box" or how we can work this one. Are you able to offer any advice?

Many thanks
Tanya (at My Red Zebra).

16 Jul 2014, 8:34 AM
#2048
rodg avatar

rodg

Deceased

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

Re: ozpost shipping module

My_Red_Zebra:

Are you aware of a way that we can cost this into ZenCart or (you) build into Ozpost?
No. Something like this will probably never be built into ozpost. I'm really not clever enough to handle the math involved. That's why ozpost doesn't support the concept of 'boxes' or 'parcel splitting'.
> My_Red_Zebra:

I'm sure we wouldn't be the only user out there that does this sort of things.
The problem isn't about calculating shipping costs, it's more about 'parcel packing' , and although many 'solutions' have been tried and implemented (with various different shopping carts) I don't know of any that have the perfect balance of what is theroetically possible and what is humanly possible.
> My_Red_Zebra:

Basically, we have a minimum cost for collection (based on 5 boxes), then we add a cost per pallet (one price for the first pallet, then a different for two or more pallets). Then we have to add the Depot to Door costs as well. I'm not sure if this can be done within ZenCart as it stands "out of the box" or how we can work this one. Are you able to offer any advice? Many thanks Tanya (at My Red Zebra).
I suspect that the only way this would be remotely possible is with custom coding that is uniquly specific to your store, and only then if all your products are the same size.
Cheers
RodG

16 Jul 2014, 7:55 PM
#2049
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: ozpost shipping module

Rod, are there any changes planned/required to make Ozpost play nice with Zen Cart v1.5.3?

1 Aug 2014, 1:03 PM
#2050
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: ozpost shipping module

I just installed ozpost 3.6.0 (upgraded to 3.6.2) in an XAMPP test account (Windows 7, PHP 5.4.8, Zen Cart v1.5.3) and receive the following message when I attempt to install the shipping module:

Unable to create temporary files. ClickNSend will be non functional and you will be unable to enter product dimensions until this is rectified

Looking in my logs folder, I saw some log files and added a bit to the ozpost.php file to try to see what's going on:

[01-Aug-2014 22:47:20 Australia/Victoria] writeTempFile (C:\xampp\htdocs\zen_new\admin_name/, includes/modules/product/, collect_info.php): C:/xampp/htdocs/zen_new/cache/ozpost/C:\xampp\htdocs\zen_new\admin_name/ : C:/xampp/htdocs/zen_new/cache/ozpost/C:\xampp\htdocs\zen_new\adminsdoc/includes/modules/product/

[01-Aug-2014 22:47:20 Australia/Victoria] PHP Warning:  mkdir(): Invalid argument in C:\xampp\htdocs\zen_new\includes\modules\shipping\ozpost.php on line 3087

The part I added shows the parameters passed to the writeTempFile function, followed by the $cachefolder value, followed by the $myFolder value. You can see why mkdir was throwing a warning!

Any guidance would be much appreciated.

1 Aug 2014, 4:20 PM
#2051
rodg avatar

rodg

Deceased

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

Re: ozpost shipping module

lat9:

I just installed ozpost 3.6.0 (upgraded to 3.6.2) in an XAMPP test account (Windows 7, PHP 5.4.8, Zen Cart v1.5.3)

<gulp> I've been kind of dreading the day that someone decided to try ozpost on a windows based server because I've had strong suspicions for several years now that it wouldn't work without modifications due to some rather slack coding in a few places.

lat9:

The part I added shows the parameters passed to the writeTempFile function, followed by the $cachefolder value, followed by the $myFolder value. You can see why mkdir was throwing a warning!

Any guidance would be much appreciated.

The problem(s) as I see it, is because *nix based systems uses forward slashes for its folder/path separators and windows uses back\slashes.
The ozpost module has several places where the forward slashes are hardcoded, so these will need to be replaced with backslashes.

I honestly don't know the extent of the changes needed to make it work because I'd always figured that I'd wait until someone actually finds it to be a problem before delving into it. I guess that after all these years that time has finally come.

The main issue for me at the moment is that I'm heavily involved in doing ozpost updates for other eCommerce systems (to bring them up to the same level of features and functionality that ZenCart merchants enjoy) so it could be a while before I can get back to this...

Just to compound matters, if it were almost anyone other than you reporting the issue I'd be giving it a lot higher priority than I'm going to. The reason being is that I know that you are pretty clued up in regards to PHP coding (In fact you have taken me a little by surprise that you even use XAMPP) and I don't think you'll have any headaches in locating and making the needed changes yourself. Of course, the easiest solution would be to use a *nix server rather than a windows server.

I suppose that now this cat is out of the bag I don't have much option than to take Windows users into consideration with future updates. I have enjoyed a very good run without having to do this though. I suspect it will take a few more weeks to get onto it though, which leaves you with the choice of putting your own skills to use for a fast resolution, waiting a few weeks for a windows compatible version, or installing it on a *nix based server instead.

Cheers
RodG

1 Aug 2014, 4:36 PM
#2052
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: ozpost shipping module

Rod, it's only a local XAMPP installation that I use for testing various configurations. I figured that it was a *nix vs Windoze directory-naming convention after I thought about it for a bit and I can provide a work-around!

1 Aug 2014, 4:55 PM
#2053
rodg avatar

rodg

Deceased

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

Re: ozpost shipping module

lat9:

I figured that it was a *nix vs Windoze directory-naming convention after I thought about it for a bit and I can provide a work-around!

I have no doubts about it. :)

Cheers
Rod

1 Aug 2014, 6:06 PM
#2054
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: ozpost shipping module

I got ozpost to install (step #1) with the following changes to /includes/modules/shipping/ozpost.php:

private function _get_cache_folder($folder) {
        $cachefolder = DIR_FS_SQL_CACHE. "/ozpost/";
          if ($folder == DIR_FS_ADMIN) { 
//-bof-20140801-lat9-Drive letter fix
          if (preg_match('/^[A-Z]:/i', $folder)) {
            $folder = substr ($folder, 3);
          }
//-eof-20140801-lat9
            $elements = explode("/", $folder);
            $cachefolder .= $elements[sizeof($elements) - 2] . "/";
        }
return $cachefolder ;
}

private function writeTempFile($folder, $subfolder, $filename, $data) {
$err = false;
        
       $oldperm = $this->_changePerms(DIR_FS_SQL_CACHE) ;
       $cachefolder = $this->_get_cache_folder($folder) ; 

//-bof-20140801-lat9-Fix for drive letter
       if (preg_match('/^[A-Z]:/i', $subfolder)) {
         $subfolder = substr ($subfolder, 3);
       }
       $myFolder = $cachefolder . $subfolder;
       
//-eof-20140801-lat9
        if (!is_dir($myFolder)) {
            if (!mkdir($myFolder, 0775, true))  $err = true; }

        if (!$err) { // no error, write file 
            $file = $myFolder . $filename;
            if (!(file_put_contents($file, $data)))  $err = true; }
            
if ( isset($oldperm) && ("$oldperm" < "0775")) chmod(DIR_FS_SQL_CACHE , octdec($oldperm)) ;

return $err;
 }

The basic idea was to remove the drive letter (and its colon and following forward- or trailing-slash) from a passed folder name if the name starts with a drive-letter followed by a colon.

I've still got a bunch of PHP warnings (all similar to the following) but I'm thinking that they're safe to ignore:

[02-Aug-2014 03:53:36 Australia/Victoria] PHP Warning:  filemtime(): stat failed for C:/xampp/htdocs/zen_new/images/icons/ozpost/ozpost_regi.gif in C:\xampp\htdocs\zen_new\includes\modules\shipping\ozpost.php on line 4473
3 Aug 2014, 9:17 AM
#2055
rodg avatar

rodg

Deceased

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

Re: ozpost shipping module

lat9:

I got ozpost to install (step #1) with the following changes to /includes/modules/shipping/ozpost.php:

Thanks for that. You've saved me a couple of hours work, so in return, if you are running ozpost on a test/demo site please let me know the name of the site for a perpetual free ozpost subscription. (This actually applies to any developer that runs a site w/ozpost for demo purposes only).

If you have done this for a customer/client, again, please advice me of the name of the store for an additional 3 months of ozpost server access.

lat9:

I've still got a bunch of PHP warnings (all similar to the following) but I'm thinking that they're safe to ignore:

[02-Aug-2014 03:53:36 Australia/Victoria] PHP Warning: filemtime(): stat failed for C:/xampp/htdocs/zen_new/images/icons/ozpost/ozpost_regi.gif in C:\xampp\htdocs\zen_new\includes\modules\shipping\ozpost.php on line 4473



Yes, those are safe to ignore.  You should be able to avoid the error messages by setting the 'Icons style' option to 'None'.  

FYI, what is happening here is that the later versions of ozpost are no longer packaged with the icons for the carriers or methods. With over 600 of them now possible, and only a fraction of them used by any given installation/configuration these are now being downloaded from the ozpost servers on an 'as needed' basis. They are then stored in the images/icons/ozpost folder for faster access with subsequent requests.  If the icons are disabled this part of the code should be skipped. 

Cheers, and thanks again for the code update. 

RodG
11 Aug 2014, 1:27 AM
#2056
peter_homann avatar

peter_homann

Zen Follower

Join Date:
Jun 2006
Location:
Melbourne, VIC
Posts:
106
Plugin Contributions:
0

Re: ozpost shipping module

Hi Rod,

Ozpost is offering a 1Kg pack and track option to the USA for an item weighing 3.8Kg

With debugging turned on, the query sent is;

QueryString
http://svr1.ozpost.net/postage.php?weight=3990&height=95&width=95&length=125&value=84&fromcode=3190&Osub=HIGHETT&destcode=US&flags=&host=Homann+Designs&storecode=3190&version=3.6.0&ef=0&deadline=7&maildays=25&AllSat=1

The server returned;

<pre>SimpleXMLElement Object
(
    [quote] => Array
        (
            [0] => SimpleXMLElement Object
                (
                    [id] => PATPPS
                    [cost] => 35.70
                    [days] => 9
                    [description] => Pack and Track 1kg Prepaid Satchel
                )

            [1] => SimpleXMLElement Object
                (
                    [id] => SEA
                    [cost] => 59.00
                    [days] => 64
                    [description] => Sea
                )

            [2] => SimpleXMLElement Object
                (
                    [id] => SEAi
                    [cost] => 68.60
                    [days] => 64
                    [description] => Insured Sea
                )

            [3] => SimpleXMLElement Object
                (
                    [id] => AIR
                    [cost] => 88.30
                    [days] => 9
                    [description] => Air
                )

            [4] => SimpleXMLElement Object
                (
                    [id] => EPI
                    [cost] => 95.30
                    [days] => 9
                    [description] => Express Post International
                )

            [5] => SimpleXMLElement Object
                (
                    [id] => AIRi
                    [cost] => 97.90
                    [days] => 9
                    [description] => Insured Air
                )

            [6] => SimpleXMLElement Object
                (
                    [id] => EPIi
                    [cost] => 104.90
                    [days] => 9
                    [description] => Express Post International Insured
                )

            [7] => SimpleXMLElement Object
                (
                    [id] => EPIP5
                    [cost] => 111.00
                    [days] => 5
                    [description] => Express Post International 5kg Prepaid Box
                )

            [8] => SimpleXMLElement Object
                (
                    [id] => ECIP5k
                    [cost] => 134.65
                    [days] => 5
                    [description] => Express Courier International 5kg Prepaid Box
                )

            [9] => SimpleXMLElement Object
                (
                    [id] => ECIm
                    [cost] => 134.65
                    [days] => 5
                    [description] => ECI Merchandise
                )

            [10] => SimpleXMLElement Object
                (
                    [id] => ECImi
                    [cost] => 144.25
                    [days] => 5
                    [description] => Express Courier International Insured
                )

            [11] => SimpleXMLElement Object
                (
                    [id] => EPIP10
                    [cost] => 189.50
                    [days] => 5
                    [description] => Express Post International 10kg Prepaid Box
                )

            [12] => SimpleXMLElement Object
                (
                    [id] => ECIp
                    [cost] => 195.25
                    [days] => 2
                    [description] => ECI Platinum
                )

            [13] => SimpleXMLElement Object
                (
                    [id] => ECIpi
                    [cost] => 204.85
                    [days] => 2
                    [description] => Express Platinum Insured
                )

            [14] => SimpleXMLElement Object
                (
                    [id] => ECIP10
                    [cost] => 211.80
                    [days] => 5
                    [description] => Express Courier International 10kg Prepaid Box
                )

            [15] => SimpleXMLElement Object
                (
                    [id] => EPIP20
                    [cost] => 346.50
                    [days] => 5
                    [description] => Express Post International 20kg Prepaid Box
                )

            [16] => SimpleXMLElement Object
                (
                    [id] => ECIP20
                    [cost] => 386.25
                    [days] => 5
                    [description] => Express Courier International 20kg Prepaid Box
                )

        )

    [information] => SimpleXMLElement Object
        (
            [servername] => svr1.ozpost.net
            [serverIP] => 199.16.184.178
            [serververs] => 11-July-2014
            [timestamp] => Mon Aug 11, 2014 10:52 (SA Server Time)
            [requesttime] => 11:22 (VIC Store Time)
            [postdate] => Thu 14th of Aug
            [insurance] => 9.60
            [surcharge] => 0.00
            [egoinsurance] => 0.00
            [stainsurance] => 0.00
            [cplinsurance] => 0.00
            [skpinsurance] => 0.00
            [trdfwinsurance] => 0.00
            [trdaeinsurance] => 0.00
            [trdtiinsurance] => 0.00
            [trdtpinsurance] => 0.00
            [trdcpinsurance] => 0.00
            [trdmfinsurance] => 0.00
            [trdnlinsurance] => 0.00
            [registration] => 0.00
            [sod] => 2.95
            [fromsuburb] => HIGHETT
            [destsuburb] => SimpleXMLElement Object
                (
                    [0] =>  
                )

            [zone] => 4
            [tnt_response_time] => 0
            [fw_response_time] => 0
            [trd_response_time] => 0
            [ego_response_time] => 0
            [cpl1_response_time] => 0
            [cpl2_response_time] => 0
            [sms_response_time] => 0
            [sta_response_time] => 0
            [skp_response_time] => 0
            [origstate] => VIC
            [expires] => 107
        )

)

Is this a problem with something I've done? I'm using the latest 3.6.0

Cheers,

Peter

11 Aug 2014, 2:39 PM
#2057
rodg avatar

rodg

Deceased

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

Re: ozpost shipping module

Peter Homann:

Is this a problem with something I've done? I'm using the latest 3.6.0

This was a bug in the server code. Apparently I managed to delete a line of code with in one of the later updates.

All fixed now.

Cheers
RodG

13 Aug 2014, 12:59 AM
#2058
peter_homann avatar

peter_homann

Zen Follower

Join Date:
Jun 2006
Location:
Melbourne, VIC
Posts:
106
Plugin Contributions:
0

Re: ozpost shipping module

Hi Rod,

Thanks for that.

Cheers,

Peter

29 Aug 2014, 11:24 AM
#2059
cherylam1103 avatar

cherylam1103

New Zenner

Join Date:
Sep 2009
Posts:
29
Plugin Contributions:
0

Re: ozpost shipping module

Hi,
I finally decided to update ozpost and pay the subscription but before I do that I want to test out on local server site before touching my live version. All was good with it until I changed suggested files for ozpost upgrade and then it disappeared from my Admin/modules/shipping. I have tried deleting and re-copying files, searched forum for solution all with no luck. Currently stuck with cache error "[29-Aug-2014 13:09:54] PHP Fatal error: Call to undefined function curl_init() in C:\Zen\xampp\htdocs\aescrap\includes\modules\shipping\ozpost.php on line 2989".

I am using zen v1.3.9h and of course the latest version of ozpost v3.6.0. Can you please advise what files I need to remove in order to then try a fresh install of ozpost as per the readme instructions...or is there some other solution to this problem of the module not showing up in admin anymore. Thanks Cheryl.

29 Aug 2014, 2:19 PM
#2060
rodg avatar

rodg

Deceased

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

Re: ozpost shipping module

cherylam1103:

Can you please advise what files I need to remove in order to then try a fresh install of ozpost as per the readme instructions...or is there some other solution to this problem of the module not showing up in admin anymore. Thanks Cheryl.

To install the ozpost module on a windows based server you'll need to make the code changes that have been kindly provided by lat9.

http://www.zen-cart.com/showthread.php?122637-ozpost-shipping-module&p=1254572#post1254572
(post#2055 in this thread if the link doesn't work properly)

cherylam1103:

Call to undefined function curl_init()

This error is unrelated to ozpost itself. It suggests that you don't have cURL installed on your Windows machine.

Cheers
RodG