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

Edit the shipping price on an order? 
 
KandT
Member
 
Total Posts:  33
Joined:  2009-05-17
 

I haven’t tried it yet but I just wanted to be clear on what this will do. This allows you to add a custom shipping rate ONLY in the backed? The customer will still only see the standard shipping methods?

Also, does this allow you to edit the shipping rate once the order is placed? (without having to edit the actual order because I can’t edit orders since almost all my products are configurable)

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  633
Joined:  2007-10-01
Bakersfield, CA
 
KandT - 09 June 2009 03:23 AM

I haven’t tried it yet but I just wanted to be clear on what this will do. This allows you to add a custom shipping rate ONLY in the backed? The customer will still only see the standard shipping methods?

Also, does this allow you to edit the shipping rate once the order is placed? (without having to edit the actual order because I can’t edit orders since almost all my products are configurable)

Thanks!

Yes, this only applies to the backend.  The original modification posted by szotyi talked about canceling the order and then changing the shipping price.  That’s not something I have tested.  I personally only use this for creating new orders that were called in over the phone.

 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  633
Joined:  2007-10-01
Bakersfield, CA
 
DavePit.com - 08 June 2009 04:32 PM

Yup, as soon as I enable flat rate shipping, it does in fact work.  So sounds like it’s not working with free shipping or USPS.

Just an update on this.  I registered for a USPS Web Tools account so I can start testing this.  I had to change the gateway URL to https://secure.shippingapis.com/ShippingAPITest.dll as my account is still in test mode.  Put in my user ID, set some options, and began testing. Then I hit a giant brick wall.

As soon as I click “Get shipping methods and rates”, I’m hit with the error message “This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.”. Tried changing the gateway back to production, and I get the same error.  I have no idea what I’m doing wrong.

 
Magento Community Magento Community
Magento Community
Magento Community
 
davedavedave
Sr. Member
 
Avatar
Total Posts:  238
Joined:  2007-08-31
 
i960 - 09 June 2009 10:00 AM

DavePit.com - 08 June 2009 04:32 PM

Yup, as soon as I enable flat rate shipping, it does in fact work.  So sounds like it’s not working with free shipping or USPS.

Just an update on this.  I registered for a USPS Web Tools account so I can start testing this.  I had to change the gateway URL to https://secure.shippingapis.com/ShippingAPITest.dll as my account is still in test mode.  Put in my user ID, set some options, and began testing. Then I hit a giant brick wall.

As soon as I click “Get shipping methods and rates”, I’m hit with the error message “This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.”. Tried changing the gateway back to production, and I get the same error.  I have no idea what I’m doing wrong.

I don’t remember what I had to do to get it working, but I remember there was roadblocks...may want to search and see what the solution is.  I do remember I had to call USPS and get the production API enabled instead of just waiting for them.  The URL I’m using is http://production.shippingapis.com/ShippingAPI.dll

 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  633
Joined:  2007-10-01
Bakersfield, CA
 
DavePit.com - 09 June 2009 10:05 AM

I don’t remember what I had to do to get it working, but I remember there was roadblocks...may want to search and see what the solution is.  I do remember I had to call USPS and get the production API enabled instead of just waiting for them.  The URL I’m using is http://production.shippingapis.com/ShippingAPI.dll

Yeah, found a thread talking about it.  I’ve requested my account be switched to production and I’m waiting to hear back.

In the mean time I’m looking into creating a custom shipping module just for this so it won’t matter what other shipping methods you use. I’m going to try a stripped down version of the flat rate shipping module and hide it on the front end.

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

Ok, my account was upgraded to production and the USPS shipping method is now working.  I ran a test and the custom shipping price is working just fine.  I used Priority Mail like you.  See attached picture.  I have no idea why it’s not working for you.

Image Attachments
custom-shipping-usps.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
davedavedave
Sr. Member
 
Avatar
Total Posts:  238
Joined:  2007-08-31
 
i960 - 09 June 2009 12:12 PM

Ok, my account was upgraded to production and the USPS shipping method is now working.  I ran a test and the custom shipping price is working just fine.  I used Priority Mail like you.  See attached picture.  I have no idea why it’s not working for you.

Just because we’ve had a few different renditions, can you once again post what the code that’s working for you is for both files?

Also, are you using 1.3.1.2?

Weird that it’s not working for me!

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

I will just attach my exact files.  I am running version 1.3.2.1.

Are you editing the core files directly?  Shipping.php should go in /app/code/local/Mage/Sales/Model/Quote/Address/Total/. Those folder names are case sensitive, so make sure they are exactly like that.  And of course, make sure you clear your cache after uploading the files.

File Attachments
form.phtml  (File Size: 7KB - Downloads: 135)
Shipping.php  (File Size: 8KB - Downloads: 138)
 
Magento Community Magento Community
Magento Community
Magento Community
 
davedavedave
Sr. Member
 
Avatar
Total Posts:  238
Joined:  2007-08-31
 

WOOHOO!  Got it working!  It was a really dumb mistake on my part, I had originally updated the shipping.php in /local, but then was making the code updates you mentioned in the /core folder...of course it was taking the /local old code.  Once I updated the correct file it worked perfectly.

The only thing I changed was form.phtml so that it would ask you the title and then the rate as it seemed a little more intuitive to me.

Thanks a ton for doing this and helping me troubleshoot i960!

For those just looking at this, the code i960 posted here is the final working version:

http://www.magentocommerce.com/boards/viewreply/144829/

i960 - I would just edit that page and change /core to /local in the code so there is no confusion.  There is no reason to edit the code in /core.  Don’t forget to mention to people that they will need to create those directories and files.

 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  633
Joined:  2007-10-01
Bakersfield, CA
 
DavePit.com - 09 June 2009 06:40 PM

WOOHOO!  Got it working!  It was a really dumb mistake on my part, I had originally updated the shipping.php in /local, but then was making the code updates you mentioned in the /core folder...of course it was taking the /local old code.  Once I updated the correct file it worked perfectly.

The only thing I changed was form.phtml so that it would ask you the title and then the rate as it seemed a little more intuitive to me.

Thanks a ton for doing this and helping me troubleshoot i960!

For those just looking at this, the code i960 posted here is the final working version:

http://www.magentocommerce.com/boards/viewreply/144829/

i960 - I would just edit that page and change /core to /local in the code so there is no confusion.  There is no reason to edit the code in /core.  Don’t forget to mention to people that they will need to create those directories and files.

I’m glad it’s finally working for you.  cool smile  I did mention that the file should be copied to the local folder instead of editing the core file, but I edited my post to make it a bit more clear.  Since this seems to be working for all shipping methods I’ve tried, I don’t think it will be necessary to create a custom shipping method just for this.  It should work as is.  I would still like to see someone step up and turn it into an extension to make it easier to install.

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

Got some good news for everyone.  I am about 90% done creating a new extension for this.  So far I’ve created a new shipping method just for this modification, so it won’t make any difference whatsoever what other shipping methods you have or if you have any at all.  It’ll just work.  It also properly extends core files instead of overriding them in the local folder.  Even the template modification isn’t necessary anymore.  This was a huge learning curve for me as I’ve never done an extension before.  Hopefully I am doing things right.

Now with that said, I have run into a bit of a problem with the way I did this.  It shows the custom shipping method on both the frontend and backend.  Neither behavior is desirable for what I’m doing here.  I want the shipping method to be active so I can overwrite it, but not displayed anywhere.  If I can solve this one problem, then it should just be a matter of getting everything cleaned up and ready to be published.  I also have no idea how to package an extension for Magento Connect, so that is another learning curve I have to deal with.  I am in talks with another extension developer who I may have publish the code for me.  If everything goes as planned then this should be a 1-click install for everyone.  I do have to thank szotyi again for the code that got the ball rolling on this.  I would have been lost without it.

Cost for the extension when it is done will be $99,875.  Hopefully that is reasonable for everyone.....

.....no I’m not gonna charge for this.  That would be silly, lol.  tongue laugh

 
Magento Community Magento Community
Magento Community
Magento Community
 
bmartus
Sr. Member
 
Total Posts:  128
Joined:  2008-05-22
Greenville, TX
 

This is great news .. thanks!!

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

I’m still having trouble figuring out how to hide a shipping method while keeping it active.  I’m thinking it’s not possible without editing the template files that show the shipping methods.  Not really what I wanted to do. If I have to edit the templates to make it work then I could just as easily do this completely without a new shipping method.  It would be just like the code I already posted, except packaged up as an extension.  Unless I stumble across something this week, then that is likely what the extension will end up being.  I’ll just have to make sure I keep this thing up to date with new Magento versions if they start messing with the template used to display the shipping methods.  Since I plan on using this in my own store, that shouldn’t be a problem.

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

I got the extension done.  Before I put it up on Magento Connect, I’d like to have a few people try it out and make sure it’s working ok and I’m not missing anything.  I’ve attached a zip file with everything you need.  Just upload the files to your site and you should be good to go.  And as always, don’t do this on a live store and backup your site first.  None of the files will overwrite any core files or anything, so there’s nothing to worry about there.

The extension works exactly like the instructions I already posted, except it properly extends core files so there’s no need to edit any of them.  Also, if you’ve already done the modification to your store, you will need to remove it before trying this one out.  To uninstall, just delete the files.  Pretty simple.  After I get some good feedback on this, I will post the extension on Magento Connect so it’ll be an easy install.

File Attachments
Indust_CustomShippingRate.zip  (File Size: 10KB - Downloads: 269)
 
Magento Community Magento Community
Magento Community
Magento Community
 
bmartus
Sr. Member
 
Total Posts:  128
Joined:  2008-05-22
Greenville, TX
 

I’ll install it on our dev site and give it a spin.

Thanks!

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