Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] NEW Australia Post Shipping Modules for osC 2.3.x


auzStar

Recommended Posts

@ce7

This question has already been answered. It's not compatible with BS version.

cheers

 

 

My Add-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

17 hours ago, auzStar said:

@ce7

This question has already been answered. It's not compatible with BS version.

cheers

Hi auzStar,

 

Thank you for the prompt reply. OK I understand. However regardless the compatibility the setting of the time, like after 2pm and max number as 13, is there a way to change the setting. I did install this addon on 2.3.1 version and facing the same issue. I need to be able to show the Australia post estimate fee all the time even after 2pm and the delivery can be manage to be delivery the next day.  thanks!  Lyn

17 hours ago, auzStar said:

 

 

 

Link to comment
Share on other sites

@ce7

No, it's not possible to change this setting for the "Australia Post - Courier Post" module. It needs a cutoff time to use this shipping module because the lodgement cutoff time at Australia Post is 2pm for next day Courier Post delivery. So the max setting is 1pm to give you enough time to get the package to Auspost.

"Australia Post - Express Post" and "Australia Post - Parcel Post" shipping modules don't have this setting so they will still appear as a shipping option.

cheers

My Add-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

  • 4 months later...

Hello Dominic @auzStar,

Trying to use the old international shipping modules on a new 2.3.4.1 BS EDGE store latest version, I get the following error:

ERROR: We apologise, we are unable to obtain a valid quote from the Australia Post Server.
If you would like to use this option as your shipping method, please contact us.

The same module works on an old 2.2 store with the same settings and configuration.

The new store runs PHP 7.2 locally and 7.1 on server. I also tried going down until PHP 5.5.

The other domestic modules work fine.

Modules are:

domestic: aprego.php (and others) => works fine

relevant code:

		$header = array("AUTH-KEY:".$APIKEY);

		//$url = "https://auspost.com.au/api/postage/parcel/domestic/calculate.xml?suboption_code=AUS_SERVICE_OPTION_EXTRA_COVER&from_postcode=$frompcode&to_postcode=$topcode&length=10&width=10&height=10&weight=$sweight&service_code=AUS_PARCEL_REGULAR&option_code=AUS_SERVICE_OPTION_REGISTERED_POST&extra_cover=$extra_cover";
$url = "https://auspost.com.au/api/postage/parcel/domestic/calculate.xml?from_postcode=$frompcode&to_postcode=$topcode&length=10&width=10&height=10&weight=$sweight&service_code=AUS_PARCEL_REGULAR&option_code=AUS_SERVICE_OPTION_SIGNATURE_ON_DELIVERY&extra_cover=";
		$auspost_xml = $this->get_auspost_api( $url, $header );

		$xml = simplexml_load_string($auspost_xml);
		
		$charge = (float) $xml->total_cost;

		$apreg_error = $xml->errorMessage;

		$days = '';

Inernational: insuredauspostair.php (and others) => throws above error

relevant code:

            $newtopcode = str_replace(" ", "", $topcode);
            /**
* Initialize the cURL session
*/
$ch = curl_init();
/**
* Set the URL of the page or file to download.
*/
curl_setopt($ch, CURLOPT_URL,
"http://drc.edeliver.com.au/ratecalc.asp?Pickup_Postcode=$frompcode&Destination_Postcode=$newtopcode&Country=$dest_country&Weight=$sweight&Service_Type=AIR&Height=$sheight&Width=$swidth&Length=$slength&Quantity=$shipping_num_boxes");
/**
* Ask cURL to return the contents in a variable
* instead of simply echoing them to the browser.
*/
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
/**
* Execute the cURL session
*/
$contents = curl_exec ($ch);
/**
* Close cURL session
*/
curl_close ($ch);
                               $vals = preg_split("/\n/", $contents);
                                foreach ($vals as $value) {

                                                $bits = preg_split("/=/" ,$value);
                                                $$bits[0] = $bits[1];
                                }
      
           if ($charge <= 0) {
            $error = true;
           } else {

 

1. is this a known issue with 2.3.4.1 BS

2. Which auz post modules are recommended to be used with latest 2.3.4BS EDGE

 

Thanks in advance

Rainer

Link to comment
Share on other sites

One more hint:

In the old store 2.2 if I echo the response array:

                               $vals = preg_split("/\n/", $contents);
                                foreach ($vals as $value) {
    echo '$bits ' . print_r($bits) ;  

                                                $bits = preg_split("/=/" ,$value);
                                                $$bits[0] = $bits[1];
                                }

I get this: $bits 1Array ( [0] => charge [1] => 21.48 ) $bits 1Array ( [0] => days [1] => 0 ) $bits 1

In the new 2.3.4.1 BS store I get:

Array ( [0] => charge [1] => 0 ) $bits 1Array ( [0] => days [1] => 0 ) $bits 1Array ( [0] => err_msg [1] => Please enter a valid Service code. )

Link to comment
Share on other sites

Hi @raiwa

This shipping contribution was created to run on non-BS versions. I'm pretty sure I worked on this before the BS version started to become mainstream and never got around to creating a BS version. There are a lot of code changes that are required to install this module so it needs a complete rethink to code it up to BS "no core changes" policy. The core changes are mainly to do with the way the shipping quotes are displayed in "checkout shipping" i.e. there are multiple shipping quotes for a given shipping option. And also a lot of the copy/paste replace code is using tables and cells as opposed to divs.

I don't know what could be causing the error you mention with international shipping other than to say that this contribution is in-compatible with the BS version as already mentioned. As far as I know it all works OK on the non-BS versions. At the moment I don't have a lot of time to look at this, but if I get a chance I will. The modules are very complex and I would need to study the code again because it's been a while :). But going by the error " Please enter a valid Service code" suggests that the service codes aren't being sent to the Auspost server correctly. Something do to with the way the data (that is to be sent) is being handled and compiled initially.

cheers

Edited by auzStar

My Add-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

Hello Dominic @auzStar,

First of all thank you for your help and answer.

I did several research and testing. Please note that I'm all the time referring to the old modules, not the new modules which require a lot of core file changes. The old modules I refer to are standard shipping modules which should work just copying the module incl. languge files and installing the module.

Here the package:

https://apps.oscommerce.com/0mp8t&australian-shipping-module

I tried now in standard 2.3.4.1, 2.2rc2a under php 5.4 aand 7.1 and 7.2 with all the same result: err_msg [1] => Please enter a valid Service code.

on the original store installation it works, I compared involved files, setup, configuration, language, currencies etc. I couldn't find any significant difference.

This is present: Your host must have " libcurl/7.14.0 OpenSSL/0.9.8 zlib/1.2.3 " installed on the server

and the working store is under the same php 5.4 local xampp installation like the test store which do not work.

Any clue in which direction to continue?

Thank you

Rainer

Edited by raiwa
Link to comment
Share on other sites

Hello Dominic @auzStar and other users of the australian shipping modules,

I found the fixes.

Tere were 2 different problems:

1. I missed to fill in the correct settings in admin=> configure=> Shipping/Packaging

The shipping modules need Australia as country of origin and a valid Australia Post Code.

This change made the module correct working under PHP5.5 and 5.6, but under PHP7 the error was still showing up.

2. Under PHP7 the variables assign needed an update:

          $$bits[0] = $bits[1];

needs to be changed to:

          ${$bits[0]} = $bits[1];

Now all works ok

Better a generic error message than a specific error message pointing in the wrong direction :sleep:

I added some other updates for 2.3.4.1 BS and PHP7 and will upload the updated modules soon.

Hope this helps other aust post users

Edited by raiwa
Link to comment
Share on other sites

found a more stable/better solution:

           foreach ($vals as $value) {
             $bits = preg_split("/=/" ,$value);
             $values[$bits[0]]= $bits[1];
           }
           extract( $values, EXTR_OVERWRITE);  

 

Link to comment
Share on other sites

Hi Rainer @raiwa

Glad you got it sorted out. Appreciate your efforts as many others would also.

Sorry that I misunderstood that you referred to older modules.

Just to confirm that this applies to other older Australia Post shipping modules, not this contribution since the code above does not exist. But this contribution is still to be tested on PHP7, and not recommended for osC BS version.

cheers

My Add-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

  • 10 months later...

Hi,

Great add-on.  I've set this up and works well.  I just have a query about international.  When I install the module for international standard for example I obviously choose the shipping zone.  However i'm provided with just three options (NZ, Australia and the rest of the world).  If I choose NZ it won't how up for customers in the USA.  More importantly if I set it to rest of world customers in NZ don't get a postage option.  I may have missed something, but I can't find how to make the optional applicable to both NZ and rest of world

Cheers

Link to comment
Share on other sites

  • 3 months later...

Hi  Dominic,

Been using the AUS  POST 1.1 for some time and working very well.  In the last few months though I have been trimming all aspects of the site RAB HOBBIES to speed the page load times to under 1 second and failing miserably. Thinned the images and killed other non-useful add-ons in the hope of faster page load times. 
Customers have kept me informed as to the load times as a reference. 
The issue has been plaguing the site still. In the end, the script for 1.1 had been calling am IP address constantly, slowing the site page load times.  Below is the reply from my Hosting company after they did a test.

"
Hello Rens,

We appreciate you again for answering the call back earlier. Please refer on the details below provided by our Administrators.

In regards to slowness experienced, we have done a trace and it appears to be due to the website calling this address auspost.com.au 52.222.138.160 repeatedly, the website loads much faster without this.

sample logs.
setsockopt(8, SOL_TCP, TCP_NODELAY, [1], 4) = 0
connect(8, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr("52.222.138.160")}, 16) = -1 EINPROGRESS (Operation now in progress)
getsockopt(8, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
getpeername(8, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr("52.222.138.160")}, [16]) = 0

[30-Apr-2019 10:26:16 Australia/Melbourne] PHP Warning:  simplexml_load_string(): { in /home/rabhobbi/public_html/online/includes/modules/shipping/apdomexp.php on line 278
[30-Apr-2019 10:26:16 Australia/Melbourne] PHP Warning:  simplexml_load_string(): ^ in /home/rabhobbi/public_html/online/includes/modules/shipping/apdomexp.php on line 278

"

As a result, i have removed the AUST POST 1.1 modules used and configured a flat rate option for now.  Since this has been done the load times are less than 0.5 sec on any page.

Your thoughts and feedback is greatly appreciated as id prefer the AUST POST modules as these provide a better and confidence booster to customers buying from us.

Hope to hear from you soon.

Regards,

Ren

R.A.B. Hobbies.

Link to comment
Share on other sites

@milkman45

I don't know where you're getting that ip 52.222.138.160 from.

When I ping the Australia Post api server "digitalapi.auspost.com.au" (from inside the file apdomexp.php, shown in you log above) I get this ip 54.230.242.74.

"digitalapi.auspost.com.au" is the only connection used by the module to the Australia Post api server to retrieve the postage rates: $api_server = 'https://digitalapi.auspost.com.au'.

If you look at the attached screen images (which are ip lookups) you'll see that 52.222.138.160 points to some server in India.

54.230.242.74 (the correct one) points to the server in Melbourne.

There is also a trace route (the black screen shot) also confirming this.

Check that you haven't been hacked.

 

 

52-222-138-160.jpg

54-230-242-74.jpg

tracert.jpg

My Add-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

HI,

Well thats surprising.  The info was supplied to me by my hosting company so it's thrown me. I've been meticulous with hacking and have experienced it once.
The question i have is where do i start to look for any hacking.

This has been a constant issue, the slow uploads and page refreshes while using 1.0 and now 1.1.

Mind you i have not been advised by any customer in the past 4 years of any issues with payments or purchases.

I'll look at the back-end tomorrow and see if there were any changes. Any suggestions where to start.

Regards,

Ren


 

Link to comment
Share on other sites

@milkman45

All I can suggest is that you compare your Auspost shipping module files with the original files, and also investigate and do further testing to see if it some other cause. Sorry, but I can't help any further than that.

ip 52.222.138.160 has nothing to do with this module.

Regardless, I have no control over the response times from the Auspost servers in retrieving shipping rates. I'm not sure why though you would be getting excessive delays as you claim. They may sometimes have excesses loads on their servers. I have not tested this lately, sorry but at the moment I don't have time. I would suggest you ask if anyone else is experiencing this issue of maybe contact Australia Post.

cheers

My Add-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

  • 3 months later...

Hi Frank,

I am returning to osCommerce after many years. I chose the Phoenix edition because I wanted a responsive site.

As you already know - a suitable shipping module is vital for any ecommerce site. I have used the old Auspost Shipping module ( sone 12 or so years ago. And that worked fine.

When I saw your shipping module for  the new Auspost edeliver rate calc, I was overjoyed. It seems to be such a comprehensive and full-featured module. However, to my dismay, I find that the install instruction don't work with Phoenix 1.0.1.0.

My questions are:-

1. Is there anything on the horizon for your wonderful Auspost Shipping Module to work n Phoenix?

2. If not, which version of osCommerce should I install so that your modules work seamlessly? and is there a responsive base version of osCommerce that I can use.

I absolutely love osCommerce and its vibrant community, - especially module contributors like your good self. But I would need to use a base version that is responsive.

Any help or advice is greatly appreciated.

I live in Perth W.A.

Thanks in advance

Johann

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...