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.
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.
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:
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.
Code: Select all
IN:
/catalog/model/shipping/usps.php
REPLACE:
$weight = ($weight < 0.1 ? 0.1 : $weight);
WITH:
if (!$weight) return array();
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
Reason: Added "return array()" code as per Qphoria's suggestion below
Since usps won't accept a 0 weight, I added that code to set it to 0.1 when weight is 0Johnathan 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:
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.Code: Select all
IN: /catalog/model/shipping/usps.php REPLACE: $weight = ($weight < 0.1 ? 0.1 : $weight); WITH: if (!$weight) return;
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();
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
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
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();
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
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
Who is online
Users browsing this forum: No registered users and 1 guest