osCommerce shipping modules: Pos Laju, Pos Malaysia Air Parcel

August 24th, 2008 | by Sean |

osCommerceMy old-style shipping modules are broken after Pos Malaysia’s last (January 2011) site update. I’m no longer maintaining them, but have replaced them with a single shipping module (now based on an API at shipping-quote.net which is more versatile, faster, more reliable and simpler. See here:

http://blog.lolyco.com/sean/2011/01/19/spider-my-shipping-modules-v0-3-for-oscommerce-zen-cart-pos-malaysia/

Just updated these two shipping modules to fix a problem introduced by Pos Malaysia – a change of URL for the postage rates calculator. No change to the calculator, just to the URL. If you’re Pos Malaysia’s web programmer (or you know Pos Malaysia’s web programmer) can you do me a favour and (ask them to) consider the effect of changes on clients? Thanks. That would be lovely.

Download shipping module poslaju v0.08

Download shipping module posmyair v0.09

If you’re using older versions of these modules – they are now broken, and you’ll have to replace them with these updated ones. I occasionally consider providing a more reliable back end for the Pos Malaysia shipping modules – maybe pos.lolyco.com, but I’d want to charge for doing that. But think about it – you’d get something reliable, without arbitrary business-breaking changes, and with responses from a real person, that would make sense. It wouldn’t cost much, maybe just RM20 a year or something. It wouldn’t cost me much either. And then I could offer a shipping module that I don’t have to fix every few months because somebody makes random useless changes to the backend. I could even easily make it faster and more reliable than Pos Malaysia’s version! It could be so good.

Enough ranting, enjoy the new modules!

  1. 23 Responses to “osCommerce shipping modules: Pos Laju, Pos Malaysia Air Parcel”

  2. By ApOgEE on Aug 25, 2008 | Reply

    hi Sean, nice blog!

  3. By Raymond on Oct 22, 2008 | Reply

    Hi Sean…

    I would like to thank you for your wonderful OSC contribution…
    however i experience problem using this contrib with a template monster OSC 2.2 MS2
    any idea how to fix this?

  4. By Sean on Oct 22, 2008 | Reply

    @Raymond:
    You’ll have to be more specific!
    You could try a page I wrote at lolyco.com about the contributions or a news thread with some problems discussed.

  5. By ixiel on Nov 6, 2008 | Reply

    Hi Sean,

    I replaced the modules today (6/11/2008) and now my site no longer working as usual. It can’t fetch the data from pos malaysia site.

    How to debug ya?.. It looks like the poslaju url in the files is correct when i try to manually key in the URL in the browser with the ?negara= etc.. i didnt change anything, just upload and replace..

    confused.

  6. By Sean on Nov 6, 2008 | Reply

    I just tried an order at your site, and got the “Unable to obtain…” quote response. The modules you downloaded are identical to those in use at Lolyco.com, and they’re working fine there. The modules do print some helpful messages to your site’s error log. If you can read your error log, that may tell you what is going wrong. Alternatively (and it’s not ideal for a production site) you can edit includes/modules/shipping/posmyair.php and remove the ‘@’ signs from the front of the network functions. If the problem is with them, you may see error messages printed to your checkout page.
    Did you try the ‘PHPv4/v5’ option in the admin panel? cURL tells me your host is PHP v5.2.6, so you should be okay with default settings.

  7. By ixiel on Nov 6, 2008 | Reply

    Hi Sean,

    Thanx for the fast reply. 🙂 Here the error msg i get after removing the @ sign:

    Warning: fopen(http://www.pos.com.my/V1/main2.asp?c=/v1/tariff/parcel/parcelRatedb1.asp&negara=Italy&berat=0.66) [function.fopen]: failed to open stream: Connection timed out in /home/batikcraft/domains/batikcraftcollection.com/public_html/includes/modules/shipping/posmyair.php on line 159

    and at the server logs:

    [Thu Nov 06 06:48:10 2008] [error] [client 203.92.154.36] poslaju.php failed to get http://www.pos.com.my/V1/main2.asp?c=/v1/tariff/poslaju/EmsRatedb1.asp&negara=Indonesia&berat=0.22 (file_get_contents returned false), referer: http://www.batikcraftcollection.com/checkout_shipping_address.php

    But if i copy paste the url at the browser, the poslaju site open properly. Can you help me what to do? Thanx.

  8. By Sean on Nov 6, 2008 | Reply

    Your host is on TM’s network, http://www.pos.com.my is on Time Telekom – loading a webpage should be very fast. I think you should ask your host for a solution – it could be they have a badly configured nameserver or router.

    I’m interested to know how you get on. A network timeout is an awkward problem – by the time you could trap it in the module, your customer is already annoyed by the long delay.

  9. By ixiel on Nov 10, 2008 | Reply

    I noticed my hosting company disable the php ‘allow_url_fopen’ function. So after they enable it, everything works fine..

    thank you

  10. By Boon on Jul 24, 2009 | Reply

    i noticed this module is available when shipping address is outside malaysia. How if i want to ship inside malaysia?

  11. By Sean on Jul 25, 2009 | Reply

    Sorry for the slow reply – I’ve been a bit distracted. At lolyco.com, we use another module for deliveries inside Malaysia. It’s much simpler to just use your own table of shipping costs for Malaysian deliveries, quicker and more reliable too: there’s no lookup to Pos Malaysia’s website. You can get the “Malaysia State” shipping module from the lolyco contributions page.

  12. By Boon on Aug 13, 2009 | Reply

    Thanks sean..

  13. By spacebaby on Aug 21, 2009 | Reply

    Hey Sean,
    Thanks for the awesome module! I was wondering if this is easy to port over to use with another shopping cart written in php also?

  14. By Sean on Aug 21, 2009 | Reply

    easy to port over?

    I don’t see why not! Everything you need to actually retrieve the quote from Pos’ website is in _getQuote() and country_list() (I must check to see if Pos have updated their country list). The quote() function just handles currencies, taxes, packaging etc. I imagine another ecommerce project would do seomthing similar, it’s just a matter of copying another module from the new ecommerce software and transplanting _getQuote() and country_list().

    Good luck!

  15. By Boon on Sep 10, 2009 | Reply

    Hi Sean,

    Its me again, the contribution is working perfectly for local delivery(malaysia state), however i dont really understand the fuel surcharge of the pos laju did you? Please advice on configuring the rate of post laju. Thanks Sean.

  16. By Sean on Sep 10, 2009 | Reply

    Hi Boon. It’s a long time since I looked at this problem, but I notice it’s still the same. See my article:
    http://blog.lolyco.com/sean/2009/02/25/pos-laju-fuel-surcharge-breaking-business-automation-again/
    If you go through a PosLaju quote manually, you’ll see a note on Pos Malaysia’s site that says:

    The above amount is not inclusive of 10% fuel surcharge, 10% handling charges and 5% GST

    That is a stupid thing for a website to do! There’s no way I can write a program to look for arbitrary surcharges in the page text, so I added the ‘random surcharge’ field as a way of coping with it.
    What Pos Malaysia have done makes it impossible to give accurate shipping quotes, so you’ll have to set the ‘random surcharge%’ field to a figure that takes into account the extra money (on top of the quoted price) they’ll charge you on your bill. The surcharges currently add up to 25%, so 25% is probably a good value to start at – but you must do your own calculations!
    I hope that helps!

  17. By Boon on Sep 10, 2009 | Reply

    Thanks sean for fast reply. I get confuse with the pos laju option with “between penisular n sabah or sarawak”, and “within penisular/sabah/sarawak”

    what is the different between them? you have any experiance on it?

  18. By Sean on Sep 10, 2009 | Reply

    I guess the ‘within’ option is deliveries that are local to any one of the three areas: a delivery originating and terminating within Sabah, for example.

    Are you thinking of developing a local version of the Pos Laju module? The conversion between osCommerce’s addresses and Pos Laju’s zones might be the trickiest part. When I looked at it, it didn’t seem worth the effort.

  19. By Jim on Apr 15, 2010 | Reply

    I’ve try to install the package, as a buyer i cannot see the postlaju options in the checkout_shipping page.

  20. By Sean on Apr 15, 2010 | Reply

    Hello Jim – did you use a Malaysian delivery address? The shipping modules will quote only for non-Malaysian delivery addresses. For local deliveries, I suggest you use fixed-price shipping or use the “malaysia-state” shipping module which allows you to charge by weight / state within Malaysia.

    (your home w3c xhtml validator button currently says “13 errors”)

  21. By Chris on Jan 25, 2011 | Reply

    Good day.

    Do you have the shipping module of poslaju & parcel M’sia for OSC V2.3.1 ?

    Thank you !

  22. By Sean on Jan 25, 2011 | Reply

    Hello Chris. I’ve only tested my new osCommerce shipping module with the older 2.2 whatever it is. I’ll test against 2.3.1 (I have one store partly configured) later tonight and either verify it works or release something tomorrow.

    Just tested – the shipping module described in my recent article works with 2.3.1 without problems:
    http://blog.lolyco.com/sean/2011/01/19/spider-my-shipping-modules-v0-3-for-oscommerce-zen-cart-pos-malaysia/
    It’ll currently quote for Air Parcel/Document overseas and domestic Pos Laju Parcel/Document. It’s quicker, more reliable and simpler than the old ones, give it a try!

  1. 2 Trackback(s)

  2. May 10, 2009: Sean’s blog » Blog Archive » Pos Malaysia Parcel Tracking and Online feedback both broken
  3. Jan 16, 2011: Pos Malaysia Shipping rates / quotations for osCommerce and Zen Cart

Post a Comment