Post by ginjg » Sat Dec 28, 2013 4:19 am

Is there any shipping extension that will allow shipping to be applied according to option?

Newbie

Posts

Joined
Sat Apr 13, 2013 4:50 am

Post by dmsims » Sat Dec 28, 2013 8:25 pm

Not that I am aware of directly

However you can set an additional weight on the option and calculate from that

Active Member

Posts

Joined
Sat Apr 13, 2013 6:05 pm

Post by ginjg » Thu Jan 16, 2014 10:21 am

So, back at trying to get USPS Shipping module to ignore 00.00 weight item options.
What's needed is an options shipping method mod

Some products have two options: Downloadable or CD (using option boost together with option download) we are able to define the weight for each. Of course the download is set to 00.
But, because shipping requires is set in data instead of per option, USPS shipping module automatically changes the 00 weight to 0.01 and applies shipping fee when the download option is selected.
We can use weight based, but because we use endicia for postage, we get discounted rates. Our State requires that, If we charge a defined rate and actual postage is less, we have to include it in the taxable total. But weight based shipping doesn't allow for defining a tax class as the shipping modules do.
Any suggestions would be appreciated.

Newbie

Posts

Joined
Sat Apr 13, 2013 4:50 am

Post by Johnathan » Thu Jan 16, 2014 10:54 pm

Not really sure why the USPS module does that, but you should be able to have it not return anything when the weight is 0 by making this change:

Code: Select all

IN:
/catalog/model/shipping/usps.php

REPLACE:
$weight = ($weight < 0.1 ? 0.1 : $weight);

WITH:
if (!$weight) return array();
Also, both the USPS method and the Weight Based method allow to set a tax class -- it's right above the Geo Zone setting in the USPS method, and the first setting in the "General" tab in the Weight Based method.
Last edited by Johnathan on Sat Jan 18, 2014 1:17 am, edited 1 time in total.
Reason: Added "return array()" code as per Qphoria's suggestion below

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by Qphoria » Thu Jan 16, 2014 11:41 pm

Johnathan wrote:Not really sure why the USPS module does that, but you should be able to have it not return anything when the weight is 0 by making this change:

Code: Select all

IN:
/catalog/model/shipping/usps.php

REPLACE:
$weight = ($weight < 0.1 ? 0.1 : $weight);

WITH:
if (!$weight) return;
Also, both the USPS method and the Weight Based method allow to set a tax class -- it's right above the Geo Zone setting in the USPS method, and the first setting in the "General" tab in the Weight Based method.
Since usps won't accept a 0 weight, I added that code to set it to 0.1 when weight is 0
Also, for your change, I think you need to return an empty array to satisfy the shipping controller.

Code: Select all

if (!$weight) return array(); 
But be sure you have other shipping options available. Otherwise you'll get the "no shipping options available" error.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Johnathan » Fri Jan 17, 2014 1:06 am

I've used just a return statement before, and believe it worked fine, but technically Qphoria's right that it should return an empty array.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by ginjg » Fri Jan 17, 2014 8:17 am

Thanks, i used the empty array snippet. And that informed USPS not to display if weight = 0. I really appreciate your help.
Now we can use USPS for ordinary shipping.

The system still demands a shipping method for 0 weight options.
I did work around that by creating a Downloadable Products Geozone for Weight Based shipping for downloadable products defined as 0:0.
So an Options Based Shipping extension is still a need for products that have both a digital and physical option.

Now I need to find a similar snippet to apply to the Fedex Shipping so it won't display for 0 weight options because the error message is ugly.

Again, thank you both for your help

Newbie

Posts

Joined
Sat Apr 13, 2013 4:50 am

Post by Johnathan » Sat Jan 18, 2014 1:15 am

If you're using the default Fedex extension, this should work:

Code: Select all

IN:
/catalog/model/shipping/fedex.php

BEFORE:
$weight_code = strtoupper($this->weight->getUnit($this->config->get('fedex_weight_class_id')));

ADD:
if (!$weight) return array(); 

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by ginjg » Sat Jan 18, 2014 1:33 am

Thank you Johnathan - that worked perfectly. I really appreciate it.

The customer still has to choose a shipping method for a non shipping purchase when he chooses the download option for products that also have a physical option. But that's just mere moments of their time. Perhaps soon there will be enough demand that this will be included in the option boost or option download extensions

Newbie

Posts

Joined
Sat Apr 13, 2013 4:50 am
Who is online

Users browsing this forum: No registered users and 1 guest