Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Where are the functions defined in Mage_Shipping_Model_Rate_Request? 
 
quanza
Sr. Member
 
Avatar
Total Posts:  97
Joined:  2008-12-02
Tokyo, Japan
 

Hi, I’m trying to create a shipping module and am having trouble understanding what is going on in the following code from /core/Mage/Usa/Model/Shipping/Carrier/Dhl.php:

public function setRequest(Mage_Shipping_Model_Rate_Request $request)
    
{
        $this
->_request $request;

        
$r = new Varien_Object();

        
$r->setStoreId($request->getStoreId());

        if (
$request->getLimitMethod()) {
            $r
->setService($request->getLimitMethod());
        
}

        
if ($request->getDhlId()) {
            $id 
$request->getDhlId();
        
else {
            $id 
$this->getConfigData('id');
        
}
        $r
->setId($id);

In particular, I’m trying to understand what functions are available to me through the $request variable. You’ll notice there are a bunch of DHL specific functions being called off $request.  How is this possible?  The Mage_Shipping_Model_Rate_Request class I have in my code-base has no reference to any of these functions.

If I’m building my own shipping module, how do I access specific settings defined for that module in the Admin (and where are these functions defined?).

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top