osCommerce Malaysia shipping modules – all updated

November 4th, 2009 | by Sean |

These old shipping modules no longer work since Pos Malaysia’s last website change in January 2011. I’ve replaced them all with a single shipping module that should give your customers a faster response, be more reliable and more flexible. See Shipping widget module page at spider.my and the original (now slightly out of date) blog entry Spider.my shipping modules for Pos Malaysia.

The osCommerce Malaysian shipping modules (malaysiastate, poslaju, posmyair) have all been updated. The new versions are available from http://lolyco.com/contributions/

Malaysiastate v0.03

Users of the malaysiastate shipping module (for local deliveries) will be pleased to see I’ve finally solved the ‘failed to open stream: No such file or directory‘ problem in malaysiastate. I had always thought I didn’t have this problem, but while looking at the error log while working on the other two modules, I saw the error! Actually, it’s only a warning on my server, so that’s why I didn’t see it before.

The malaysiastate error is caused by osCommerce seeing the “.inc.php” file which contains the shipping prices and interpreting it as a shipping module, so it tries to find a language file for it. There’s no language file (unless you told me about the problem and  I recommended you create an empty one to make the error go away!), hence the error. The new version is exactly the same as the previous version, but the shipping prices file is now just “.inc” on the end (minus the .php).

If you want to update your previously installed version to v0.03, all you have to do is:

  1. rename your existing malaysiastate.example.inc.php and malaysiastate.inc.php files to remove the ‘.php’ from the end of the filename.
  2. copy the v0.03 shipping module into your includes/modules/shipping/ directory. No need to ‘remove/install’, unless you absolutely don’t want a visitor to see a ‘cannot quote’ message while you’re half way through updating.

Poslaju v0.10 v0.11* and Posmyair v0.11

Howard Sim from www.cigs-mart.com reported that his GoDaddy hosting didn’t support the page-fetching methods I’d used previously in the shipping modules. He sent me a recommendation he’d found to use the cURL libraries. I use cURL all the time from the command line, but for some reason didn’t think of it when I originally wrote the shipping modules. I’ve added cURL support to these two modules as an editable option on the shipping module admin page.

To upgrade your existing versions of posmyair and poslaju, you’ll have to:

  1. make a note of your existing module settings
  2. remove the modules using your admin panel (because the editable module options have changed)
  3. copy the posmyair.php or poslaju.php file into your includes/modules/shipping/
  4. install and edit the module settings. Choose cURL or PHPv5 if you can (see below), or PHPv4 if you absolutely have to.

User-Agent change

I’ve changed the User-Agent that’s reported to Pos Malaysia’s webserver by posmyair and poslaju. Unless you use the PHPv4 setting, the shipping modules send two (extra) items of data to Pos Malaysia’s webserver. One is the URL of your website as “Referer” – something like “http://fantasticmalaysianeshoppe.com/”. The other is the “User-Agent“. I’ve added my email address at lolyco.com to the end of the User-Agent string, so it now looks like:

“osCommerce posmyair Shipping Module (sean(a)lolyco.com)”

or

“osCommerce poslaju Shipping Module (sean(a)lolyco.com)”

Previously, it was the same but without my email address. You’ll never see the User-Agent string, only Pos Malaysia’s web admin will see it. I’ve added my email (instead of yours) in case the admin gets upset about the way the shipping module fetches the data from his server. Rather than she sends an angry email to you, and you not know Whiskey Tango Foxtrot she is talking about, she can send it to me instead.

I would be prepared to make the email address overridable, so that you can send your shop admin email address, just in case you want to receive the angry emails instead of me. Let me know your opinion on that one.

* Howard Sim pointed out a careless copy-and-paste in poslaju, so one more version!

  1. 3 Responses to “osCommerce Malaysia shipping modules – all updated”

  2. By Ariffshah on Feb 12, 2011 | Reply

    Hi Sean,

    I have checked today your contribution for Pos Laju International Parcel Quote v0.9 at my website. Normaly it’s work for my international customer to track the shipping charges to their country. However, there is something wrong with the quote and it said ‘This is currently the only shipping method available to use on this order.

    Pos Malaysia Pos Laju Express
    Unable to obtain a Pos Laju shipping quote. Please inform the store owner.’

    I realized poslaju had change their website layout recently and it might be the problem.

    Do you know what is happening.

    Thanks and regards

  3. By Sean on Feb 12, 2011 | Reply

    Hello Ariff – I’ve sent you an email reply using your sales@ address. The old shipping modules no longer work since Pos Malaysia changed its website in January 2011. I had expected to release a new shipping module which should permanently address the problem of Pos Malaysia’s random website changes a little later, but I’ve made my ‘development’ version available for download here: http://spider.my/about/shipping/Shipping_modules.xhtml

  1. 1 Trackback(s)

  2. Nov 4, 2009: osCommerce Malaysia Shipping Modules updated - Webmaster Malaysia Forum

Post a Comment