Magento Forum

   
Edit the shipping price on an order? 
 
Ija A
Jr. Member
 
Total Posts:  5
Joined:  2009-07-09
 

I fixed the issue by commenting out line 170-174 in app/code/core/Mage/Sales/Model/Service/Quote.php

/*
            $method= $address->getShippingMethod();
            $rate  = $address->getShippingRateByCode($method);
            if (!$this->getQuote()->isVirtual() && (!$method || !$rate)) {
                Mage::throwException($helper->__('Please specify shipping method.'));
            }
            */

 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  633
Joined:  2007-10-01
Bakersfield, CA
 

Interesting. That file didn’t exist until 1.4. Commenting it out isn’t a proper fix, but it does lead me down the right path to solving this. Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  633
Joined:  2007-10-01
Bakersfield, CA
 

Just from a quick test, $address->getShippingMethod() is returning the proper shipping method code, but $address->getShippingRateByCode($method) is returning blank. That’s why it’s failing the check. So I need to figure out why that is happening.

 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  633
Joined:  2007-10-01
Bakersfield, CA
 

For a quick and dirty hack to get it working, replace that section with this:

$method$address->getShippingMethod();
$rate  $address->getShippingRateByCode($method);
if (
$method != 'indust_customshippingrate'{
    
if (!$this->getQuote()->isVirtual() && (!$method || !$rate)) {
        Mage
::throwException($helper->__('Please specify shipping method.'));
    
}
}

That will get it going while retaining core functionality. I am still looking for a proper solution. The best way to do this for now is to copy that file to /app/code/local/Mage/Sales/Model/Service/Quote.php. That way you aren’t messing with a core file, and the changes will still be there after an upgrade.

 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  633
Joined:  2007-10-01
Bakersfield, CA
 

For a quick and dirty hack to get it working, replace that section with this:

$method$address->getShippingMethod();
$rate  $address->getShippingRateByCode($method);
if (
$method != 'indust_customshippingrate'{
    
if (!$this->getQuote()->isVirtual() && (!$method || !$rate)) {
        Mage
::throwException($helper->__('Please specify shipping method.'));
    
}
}

That will get it going while retaining core functionality. I am still looking for a proper solution. The best way to do this for now is to copy that file to /app/code/local/Mage/Sales/Model/Service/Quote.php. That way you aren’t messing with a core file, and the changes will still be there after an upgrade.

 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  633
Joined:  2007-10-01
Bakersfield, CA
 

Sorry for the double post. The forum has really been messing up today.  It’s taking like 2-3 minutes just for each page to load.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ija A
Jr. Member
 
Total Posts:  5
Joined:  2009-07-09
 

Hi there. I just realized that you’re the author of the extension :D

Yea commenting them out aint really a good solution. I’m not a big fan of hacking core/Mage either but I needed something to buy time and keep me from tearing my hair our.

Thanks for keeping the extension free. I’ll post more if I can get it fixed too smile

Cheers

 
Magento Community Magento Community
Magento Community
Magento Community
 
jetsetter
Member
 
Total Posts:  33
Joined:  2008-06-29
 

This is just the extension we needed. I installed it but got nothing on my orders page (I cleared cache, etc.)

I think it has to do with a different extension I have installed that deals with order comments.  It’s called magento-community/Biebersdorf_CustomerOrderComment

This makes changes to the adminhtml for the orders to display the comments on the information page.  I can’t quite make out how the conflict.  Is anyone using this contris with the Order Comments?

Thanks, Joe

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bill Stender
Jr. Member
 
Total Posts:  9
Joined:  2009-10-19
 

I’ve got the Biebersdorf comments extension, and this shipping extension on 1.3.2.4 both working. but I had to use the previous version of the shipping ext. to make it work.  However, the fields did show up as expected with the latest shipping extension, they just wouldn’t function.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jetsetter
Member
 
Total Posts:  33
Joined:  2008-06-29
 

I’m on 1.4 actually.  Reading through this thread, it looks it does work with 1.4 Which is the previous version of the shipping extension you are using?  Was it that zip file that was posted a few pages back?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bill Stender
Jr. Member
 
Total Posts:  9
Joined:  2009-10-19
 

Yeah, it works for the author i960, but didnt for me. He suggested I try the previous version: magento-community/Indust_CustomShippingRate-1.0.2 and that did the trick.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jetsetter
Member
 
Total Posts:  33
Joined:  2008-06-29
 

That version does seem to work for me too.  I can see the new option when I create a new order (before I couldn’t) but I can’t bring up a shipment on an existing order - it throws an error message.

Does this extension only work when creating new orders and editing existing orders (cancel / edit) or new orders too?  Of course the problem with the Edit is that you need to get the CC info again if you change the shipping method (and don’t change the cost at all).  We got around this with a terrible operational hack that I have the back office enable Purchase Order (we renamed it to Order Adjustment: Credit Card) and have them quickly edit the order and the turn off the Purchase Order.  This is for when a customer forgets to apply a coupon or something that brings the cost down.  Then we capture offline.  I wish Magento would address this ! 

I was hoping it would work for new orders that came in with one shipping method (we only offer UPS from our warehouse), that we could then change the text to something else (like Fedex when we have to drop ship something we don’t have) on the information page without edit/cancel.

Magento lets you add the Fedex tracking number with no problem, but on the invoices/packing slips it says UPS Ground and then it says Fedex and a tracking number.  A bit confusing for the customer.  I’ve changed the invoices to say “Shipping Best Way” for now, but if I could sustitute the custom admin shipping title, that would be great.

Joe

 
Magento Community Magento Community
Magento Community
Magento Community
 
aramsore
Jr. Member
 
Total Posts:  27
Joined:  2009-12-18
 

I tried this for 1.4.01.  and I also installed Indust_CustomShippingRate 1.0.2 version.
But it gives me error message..HTTP Error 500
I can’t placne an order… it doesn’t go further and keep repeating.

I just used “Commeting out Solution’ for now. It is working.
But can you tell me what is the problem if I use this way?

Thank you!

i960 and Lja A both!

JC

i960 - 15 March 2010 11:13 AM

For a quick and dirty hack to get it working, replace that section with this:

$method$address->getShippingMethod();
$rate  $address->getShippingRateByCode($method);
if (
$method != 'indust_customshippingrate'{
    
if (!$this->getQuote()->isVirtual() && (!$method || !$rate)) {
        Mage
::throwException($helper->__('Please specify shipping method.'));
    
}
}

That will get it going while retaining core functionality. I am still looking for a proper solution. The best way to do this for now is to copy that file to /app/code/local/Mage/Sales/Model/Service/Quote.php. That way you aren’t messing with a core file, and the changes will still be there after an upgrade.

 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  633
Joined:  2007-10-01
Bakersfield, CA
 
jetsetter - 18 March 2010 09:05 AM

That version does seem to work for me too.  I can see the new option when I create a new order (before I couldn’t) but I can’t bring up a shipment on an existing order - it throws an error message.

Does this extension only work when creating new orders and editing existing orders (cancel / edit) or new orders too?  Of course the problem with the Edit is that you need to get the CC info again if you change the shipping method (and don’t change the cost at all).  We got around this with a terrible operational hack that I have the back office enable Purchase Order (we renamed it to Order Adjustment: Credit Card) and have them quickly edit the order and the turn off the Purchase Order.  This is for when a customer forgets to apply a coupon or something that brings the cost down.  Then we capture offline.  I wish Magento would address this ! 

I was hoping it would work for new orders that came in with one shipping method (we only offer UPS from our warehouse), that we could then change the text to something else (like Fedex when we have to drop ship something we don’t have) on the information page without edit/cancel.

Magento lets you add the Fedex tracking number with no problem, but on the invoices/packing slips it says UPS Ground and then it says Fedex and a tracking number.  A bit confusing for the customer.  I’ve changed the invoices to say “Shipping Best Way” for now, but if I could sustitute the custom admin shipping title, that would be great.

Joe

What error are you getting? This extension is only for new orders.

 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  633
Joined:  2007-10-01
Bakersfield, CA
 

I have a new version just about ready to go that works in 1.4. Still testing things right now. I will provide a zip file here and let you guys try it out before I release on Magento Connect.  One issue I’m facing is that it’s not compatible with 1.3.2.4 and prior. I don’t know how I can release the extension on Magento Connect so that only people with 1.4+ will get it. I can put a warning up, but anyone who checks for updates through their store will see a new version and not realize it’s not compatible.  I think it’s possible to create a dependency on certain versions, but last time I tried that it would just upgrade their stores to the newest version without even asking. I can’t allow that. So any ideas would be helpful.

Also, the fixes for 1.4 are pretty much the same as what’s posted above. I can’t find any other solution, and I’ve been working on it for quite awhile now. So far I’m not seeing any downsides to using this method, other than it seems like a hack to me.

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