Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6997659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:18:41+00:00 2026-05-27T20:18:41+00:00

My custom shipping module was failing because it couldn’t get a sales quote when

  • 0

My custom shipping module was failing because it couldn’t get a sales quote when an order was being edited on the backend. This was the code I was using:

class Mymodule_Model_Mycarrier_Customrate 
    extends Mage_Shipping_Model_Carrier_Abstract
        implements Mage_Shipping_Model_Carrier_Interface
{
    public function collectRates(Mage_Shipping_Model_Rate_Request $request)
    {
        $quote = Mage::getSingleton('checkout/type_onepage')->getQuote();

I need to get the current quote so I have access to the address information. I am making an API request that requires a street address.

Now if the order was being edited on the backend, this would obviously result in an error because the checkout singleton is no longer relevant. Instead I get the quote like this:

$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();

In my collectRates() method I need to determine which singleton to load. First I want to ask if this is the proper way of doing things, and also if my check for the backend is sufficient:

$quote = Mage::getSingleton('checkout/type_onepage')->getQuote();

// If admin is editing an order, find the quote by admin session.
if(Mage::getSingleton('admin/session')->isLoggedIn()){
    $quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
}

I don’t want this to potentially cause problems later. I also get the feeling that I may be using the collectRates() method wrong if I have to create a workaround like this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:18:41+00:00Added an answer on May 27, 2026 at 8:18 pm

    The Mage_Shipping_Model_Rate_Request object already has access to the address via $request->getDestStreet(), etc…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don´t understand the tags that configure a custom sales quote. In this code
I guys i try to create a custom product from a module with this
I'm currenty working on a shipping module extension that is used for an order-import
Our custom automatic email delivery service is hitting this problem with a couple of
My custom error messages quit working somewhere along the way and I'm getting this
I made a custom module that sell used product along with original product and
I'm implementing a custom FedEx integration solution for a Magento site. Part of this
I'm working on a custom module in Drupal with a multi-page form approach, and
how do i set editing style for custom UItableviewcell like this image. this is
I need to get shipping rates from USPS. I have signed up with them,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.