PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, November 10, 2022

[FIXED] How do I get the package length, width, and height in Magento for a shipping estimate?

 November 10, 2022     magento, magento-1.7     No comments   

Issue

I am looking for a snippet that will give me the length, width, and height of the packaging to ship the items currently in the cart.

I am creating a shipping rates module and this is the last piece of the puzzle.

Any information is greatly appreciated!

Jeff


Solution

Take a look @ Create Shipping Method Module

In collectRates(Mage_Shipping_Model_Rate_Request $request) you can get all items using

 $request->getAllItems()

See /app/code/core/Mage/Shipping/Model/Rate/Request.php

So you could Loop through each item to get their dimension

foreach($request->getAllItems() as $item){
    //do you logic per item
     $item->getLength();
     $item->getWidth();
     $item->getHeight();
}


Answered By - MagePal Extensions
Answer Checked By - Clifford M. (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing