2

As you all know, Magento comes packaged with the Fedex rate quoting extension built-in. What this extension does not do is ask for dimensions. Therefore, the shippping rates returned are based solely on weight and nothing else.

For $299 I can get the super fancy WebShoppeApp, but I'm trying to avoid paying for that when all I lack is a few lines in, for example, this file...

 app/code/core/Mage/Usa/Model/Shipping/**Fedex.php**

Inside this file, I can clearly see that an XML request is being created.

Line 315
        $r = $this->_rawRequest;
        $ratesRequest = array(
            'WebAuthenticationDetail' => array(

.....
                'RateRequestTypes' => 'LIST',
                'PackageCount'     => '1',
                'PackageDetail'    => 'INDIVIDUAL_PACKAGES',
                'RequestedPackageLineItems' => array(
                    '0' => array(
                        'Weight' => array(
                            'Value' => (float)$r->getWeight(),
                            'Units' => $this->getConfigData('unit_of_measure')
                        ),
                        'GroupPackageCount' => 1,
                    )
                )

As you can see, there is no defining of dimensions here. This makes it very difficult to ship something that is 12 ft long, or longer.

My first instinct, being a relatively advanced PHP programmer, was to add the Dimension key to the above XML Request... and insert custom attributes from the product into this.

            'RequestedPackageLineItems' => array(
                '0' => array(
                    'Weight' => array(
                        'Value' => (float)$r->getWeight(),
                        'Units' => $this->getConfigData('unit_of_measure')
                    ),
                    'Dimensions' => array(
                         'Width' => ?,
                         'Height' => ?,
                         'Length' => ?
                    ),
                    'GroupPackageCount' => 1,
                )

Then, it occurred to me that I have no clue how this works with the products, especially multiple ones. In other words, I'm not exactly sure how to go about grabbing those custom attributes and knowing that a shopping cart full of differently sized products will be requested accordingly, accurately, appropriately.

To me, this look like one single package item. It has been hard-coded in.

Besides dropping $300 for an extension, is there a solution to my problem?

  • You know I'm sure there is a solution the you or myself could code. However, Its not just a matter of adding dims for a product, you have to figure out how to pack the products for shipping so you can get the pricing, aka. writing a packing algorithm. And then if you want to let the client customize how things get packed/shipped in some way there an entire set of admin stuff you need to create. In the end i went with the WSA extension because I was sure there was more than the cost of that extension in dev hours i would spend to get something that was actually useful with LESS functionality. – prodigitalson Nov 11 '14 at 16:29
  • I will say that WSA extension requires you to configure boxes for each product and these are related entities not straight EAV attributes so i did need to write a script to get these all set up (We were using Fedex and USPS Flat Rate) initially with the thought that the client would go in and change them. You can take a look at my rather raw code here: gist.github.com/prodigitalson/… – prodigitalson Nov 11 '14 at 16:43
  • It looks like you ended up creating your own Shipping Method in the long run? So I'm guessing WSA is out of the question when it comes to a non-manual-coding solution. – dockeryZ Nov 11 '14 at 17:40
  • And your absolutely right. As I tried to mention in my post, I am not sure whether or not I will be able to handle multiple shipment sizes in one purchase. After all of this research and testing with Magento, I'm having to come to a full stop in my work because of this game-changing problem. – dockeryZ Nov 11 '14 at 17:43
  • 1
    No i didnt create my own shipping method i used WSA out of the box. No changes were necessary. WSA jsut requires alot of product configuration beyond the dimension and weight attributes. The code I shared was to automate inital setup of that. – prodigitalson Nov 11 '14 at 17:43
3

I wrote the WSA Dimensional Shipping extension, and its something that has taken me nearly 4 years on/off working on it for days on end to get it so that its useful.

As discussed you can just put in the dimensions to Fedex but this only works if you have all your products shipping in their own box or of you box everything in the 1 same box.

You do anything more than that you are in need of complex algorithms to manage it. We are still working on Dimensional Shipping and constantly improving it and adding in new features. It's not a magic bullet as bin packing is a np-hard issue. But I know thro experience we can get the rates much more accurate than anything else out there. There is always an investment of effort.

Sometimes tho writing your own on this can be worthwhile, you would need to get the FedEx API and then write an algorithm that meets your needs to do the bin packing. As our extension is sold to many people we have features in there that you may not need so writing yourself can be useful. Just bear in mind it could take a while, and you would definitely need TDD if you are doing anything but very simple calculations.

| improve this answer | |
  • Thank you for your input, Karen! I would be selling rugs, differently sized, rolled up rugs. There are small ones and large ones and VERY LARGE ones which would require LTL. I'm already in a TDD, so no worries there; just erase it all and start from scratch, again, and again, and again. – dockeryZ Nov 11 '14 at 18:02
  • 2
    Feel free to email me for more info. I'm very keen I dont start being seen as marketing our extns here so probably need to take this offline! – Karen Baker Nov 11 '14 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.