10

Customer enters order with different shipping/billing addresses.

if we need to edit the order in admin it creates a new order, in the new order the shipping address defaults to 'same as billing' and the original shipping address is lost!

  1. can anyone confirm if their installation does the same.
  2. does anyone have a solution.
8
  • 7
    i.imgur.com/Lb427Io.jpg
    – philwinkle
    Commented Dec 16, 2013 at 17:57
  • 2
    I maintain quite a few 1.7 shops and none of them have this Commented Dec 16, 2013 at 20:17
  • @SanderMangel, thank you. so now we need to figure out why it's happening on my installation. Any suggestions?
    – mendel
    Commented Dec 16, 2013 at 21:32
  • Check your logs, both Magento and Apache. If that's all ok turn off all 3th party extensions via app/etc/modules to see if that causes it. If that doesn't help... well... then you have a bigger issue Commented Dec 16, 2013 at 22:04
  • @SanderMangel, I disabled all 3rd party extensions, did not make a difference. I checked the exception and system logs, and I don't see any errors that coincide with the time I clicked 'edit order'
    – mendel
    Commented Dec 17, 2013 at 17:47

4 Answers 4

3

I had this problem. My problem was, that same_as_billing_address was set on shipping address through the frontend, therefore the backend thought, there was no second address and skipped the rendering.

Check your frontend, whether it submits correct data.

4
  • when the customer enter the order they can select to Ship to this address or ship to different address, if they select to ship to a different address they can enter a shipping address. the admin sales order page shows both addresses until I edit the order. in the sales_order_flat table I don't see a column same_as_billing_address, but I do see shipping_address_id and billing_address_id and they are different. Perhaps I'm not looking in the right place?
    – mendel
    Commented Mar 13, 2014 at 15:22
  • I found the field same_as_billing in the table sales_flat_quote_address and it is set to 0 for those orders where a customer entered a different shipping address.
    – mendel
    Commented Mar 13, 2014 at 15:47
  • Then you have another problem :-( Commented Mar 13, 2014 at 15:51
  • I've also checked this, and your solution does not apply to me, either. same_as_billing_address is set correctly.
    – Louis B.
    Commented Aug 14, 2015 at 15:40
2

I could not reproduce it on Magento 1.9.

There is no bugfix for this mentioned in the release notes, however I found the following in the 1.8.0.0 release notes:

Administrative Ordering and Credit Memo Fixes

  • When you create an order using the Admin Panel and you have specified a default billing address and a default shipping address, the addresses are used correctly.

Possibly this is related and fixed the bug as well. The release notes are not always complete.

1

I have encountered the same issue in the latest Magento 1.9.2.4 and 2.0.5.

Scenario:

  1. Guest places an order
  2. Order has different Billing and Shipping addresses
  3. Admin edits the order in the Admin Panel

Result: The Shipping address is lost and Billing address is shown instead.

Reason: The _isSameAsBilling() method always returns true if the order was placed by a Guest. It is not proper behaviour.

The method in question:

Magento 2.0.5: /app/code/Magento/Quote/Model/Quote/Address.php

protected function _isSameAsBilling()
    {
        return $this->getAddressType() == \Magento\Quote\Model\Quote\Address::TYPE_SHIPPING &&
            ($this->_isNotRegisteredCustomer() ||
            $this->_isDefaultShippingNullOrSameAsBillingAddress());
    }

Magento 1.9.2.4: /app/code/core/Mage/Sales/Model/Quote/Address.php

protected function _isSameAsBilling()
    {
        return ($this->getAddressType() == Mage_Sales_Model_Quote_Address::TYPE_SHIPPING
            && ($this->_isNotRegisteredCustomer() || $this->_isDefaultShippingNullOrSameAsBillingAddress()));
    }

As you can see if Customer is not registered the _isSameAsBilling() method returns true even if the Billing and Shipping addresses are different.

It has serious implications on all orders edited through the Admin Panel as original Shipping Address is lost.

Is this a bug or am I missing something?

1

Had the same problem with Magento 1.7 and correct with this change on : app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php

You need to overwrite the class on a clean way :)

Change the method : _initShippingAddressFromOrder with this code :

protected function _initShippingAddressFromOrder(Mage_Sales_Model_Order $order)
{
    $this->getQuote()->getShippingAddress()->setCustomerAddressId('');
    Mage::helper('core')->copyFieldset(
        'sales_copy_order_shipping_address',
        'to_order',
        $order->getShippingAddress(),
        $this->getQuote()->getShippingAddress()
    );
    $this->getQuote()->getShippingAddress()->setSameAsBilling(false);
    if($order->getShippingAddress()->getCustomerAddressId() && $order->getShippingAddress()->getCustomerAddressId() == $order->getBillingAddress()->getCustomerAddressId()) {
        $this->getQuote()->getShippingAddress()->setSameAsBilling(true);
    }
}
1
  • Thanks, that magento installation has gone thru a number of updates and extensions and I can no longer reproduce the problem so I cannot test your fix.
    – mendel
    Commented Mar 13, 2017 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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