cancel
Showing results for 
Search instead for 
Did you mean: 

Remove USPS Media Mail as Shipping Option when Non-Qualified Item In Cart

Remove USPS Media Mail as Shipping Option when Non-Qualified Item In Cart

I am looking for an extension that already does this or a way to do it myself. This is what has happened so far:

 

I purchased an extension from a company called Magebright called, Shipping Restrictions. Before I purchased it, I specifically asked if it would allow me to restrict the USPS shipping option of Media Mail so that if anything that did not qualify for Media Mail was in the shopping cart, it would disappear as a shipping option. They said it would, so I bought it. Once installed I noticed a problem, I could restrict all of USPS but not any specific shipping methods. So I contacted them and they said they would fix it. They went in and expanded the options so that I could restrict only Media Mail. However, now the extension crashes. I can put as many media mail qualifying items into the cart as I want and it works fine, but as soon as I attempt to add an item that does not qualify it takes me to a 404 error page. If I disable the extension, it all works fine (without restricting the shipping option of course). They said they would fix, but a month has gone by with nothing done. If I look at the error log, it gives me this:

 PHP Fatal error:  Call to a member function getCarrier() on a non-object in magento/app/code/local/Magebright/Shipingresriction/Model/Observer.php on line 44

If I open up the Observer.php file, lines 42-46 are as follows:

        if ($isEmptyResult){
        $error = Mage::getModel('shipping/rate_result_error');
        $error->setCarrier($lastRate->getCarrier());
        $error->setCarrierTitle($lastRate->getMethodTitle());
        $error->setErrorMessage($lastError); 

Any ideas, suggestions on how to fix this, or how to proceed? I downloaded an extension called Modules Conflict Detector to see if any modules were conflicting, but according to the extension, they are not. Any help on how to proceed would be appreciated. Thanks!!

Also - I have not been able to find any other extension offered or way to do this. And I need this function for my site.

3 REPLIES 3

Re: Remove USPS Media Mail as Shipping Option when Non-Qualified Item In Cart

Did you check to see if WebShopApps has a solution for your shipping needs?
http://webshopapps.com/us/extensions

 

Maybe:

http://webshopapps.com/us/shipping/shipping-override-matrix.html

?

 

Per your existing module and issues, the module developer would likely be the best source for getting the problems fixed.

Re: Remove USPS Media Mail as Shipping Option when Non-Qualified Item In Cart

I am doing this very thing to restrict Media Mail, using the Amasty Shipping Restrictions extension.

 

All I had to do was add a custom product attribute for "Media Mail Eligible" and then create a shipping restriction rule to block Media Mail if more than one ineligible item appears in the cart.

 

Amasty support is great based on my single experience, wherein they wrote me back with an answer within a day.

 

Basically you can restrict all methods from a certain carrier using the select box, or just freehand type in a single method in the Restrict Shipping Methods box as seen in the screenshot below.

 

You can specify tons of different rules. See the screenshot of my rule setup.

 

One catch, and it's actually the thing I had to email Amasty support about since I couldn't find it in the documentation. That is, your product attribute needs to have the box checked for "Use for Promo Rule Conditions".

 

Also, there was a bug in my first version and I haven't checked to see if it's been fixed, but it's simple enough to work around. You'll notice my rule says "total quantity equals or greater than 1". I originally tried to use "total quantity greater than 0" but that caused a bug and wouldn't work as expected. Took me forever to figure out through trial and error that you're better off using "equals or greater than 1".

 

Screenshot (15).pngScreenshot (16).png

Re: Remove USPS Media Mail as Shipping Option when Non-Qualified Item In Cart

@njbairThat worked perfect for me!.. thx for the screenshots.. helped!