Only USPS Shipping Option in checkout is Free Shipping

Despite having all the proper settings applied under our Shipping options - USPS calculated, retail rates, express and priority mail, handling charge, and the same USPS username we've been using for 2 years now - suddenly the only shipping option that's available during checkout is free shipping. See attached screenshots. We really need the USPS calculated shipping options to be applied but they're not even available to customers to select and I have no idea why.

I'm on hold with USPS now to see why our API is suddenly disconnected but in the meantime, I'm wondering if you have any insight as to why this keeps happening; Last month, we kept getting the "no valid shipping options" error. Had to call USPS to reconnect our API. This time, without even changing our settings since what happened last month, we're giving away our shipping costs all together. Since this started happening the other day, I have tried checking different boxes within the USPS settings like flat rate box options. But I don't know what else to try. It still just says free shipping every time during checkout.

Please advise: How do we get our USPS calculated rates applied to checkout? And how do we keep these errors from happening a third time?

We're running MarketPress Version 2.9.0.7.

  • great8creative

    Just got off the phone with USPS and they said our webtools API is connected and running fine, that it's not showing any errors on their end. So now I really don't know what to do.

    The only other info I can think of that might help, that might be affecting this... I recently updated a bunch of our plugins, along with the FrameMarket and MarketPress versions we were running. I made these updates and tested them first on our staging site (WP Engine), then pushed everything to production server once everything looked good. By looking at the order history, there doesn't seem to be any shipping errors before 2/6/14 when I pushed all the updates live. So even though we didn't mess with our shipping options/settings, maybe the updates broke our USPS connection. Is this possible?

  • great8creative

    I did check all those cache settings and found them unrelated.

    I think I've found the root of the problem though, but I'm still working on a fix. Back on the staging site, I updated to the most recent version of MarketPress. I then disabled all other plugins... still, no luck. Checkout was still showing free shipping as the only option. So I searched around found this in the changelog for MarketPress 2.9.0.3:

    In Calculated Shipping plugins changed so if all weights in an order are zero then show Free Shipping

    So I checked to see if the product weights for each product in my cart had anything to do with it. Turns out it does. And 1 of 3 things/errors will happen:
    1) If all products in the cart don't have their product weight set, the only shipping option is free shipping (as we've been experiencing).
    2) If there's a combination of product weights in my cart - as in one product has its weight set but another one doesn't - then the only shipping method available in the dropdown menu is "USPS" but then it gives this error: "Operation timed out after 5000 milliseconds with 0 bytes received"
    3) Only if/when every product in my cart has its product weight set, will the calculated shipping option become available.

    This sounds like an old problem that's come back. Obviously if we haven't been setting product weights for all our products, so we need to get this fixed ASAP. Is there some sort of patch I can use with the most recent version of marketpress? Or should I revert to an older version so checkout works for us again?

  • great8creative

    Also if it helps, when there's a combination of products in the cart, 1 with a weight and another without one, this is the error it sometimes throws on the Shipping page of checkout:

    Warning: Division by zero in /nas/wp/www/staging/skinfitusa/wp-content/plugins/marketpress/marketpress-includes/plugins-shipping/mp-usps.php on line 626

    Warning: Division by zero in /nas/wp/www/staging/skinfitusa/wp-content/plugins/marketpress/marketpress-includes/plugins-shipping/mp-usps.php on line 627

    Again, we're not setting the weights of every product nor do we want to; We're just simply offering the express mail or priority mail options. This was all working fine before.

    And sorry for all the updates... I'm their web designer, and we've had issues with this in the past so I just really need to get this fixed so I don't get fired. Please let me know what to do.

  • great8creative

    I'm definitely not a PHP developer so feel free to ignore this comment completely, but I found this block of code in /marketpress/marketpress-includes/plugins-shipping/mp-usps.php starting on line 560:

    //If whole shipment is zero weight then there's nothing to ship. Return Free Shipping
    		if($this->weight == 0){ //Nothing to ship
    			$_SESSION['mp_shipping_info']['shipping_sub_option'] = __('Free Shipping', 'mp');
    			$_SESSION['mp_shipping_info']['shipping_cost'] =  0;
    			return array(__('Free Shipping', 'mp') => __('Free Shipping - 0.00', 'mp') );
    		}
    
    		// Got our totals  make sure we're in decimal pounds.
    		$this->weight = $this->as_pounds($this->weight);
    		$this->pkg_max = $this->as_pounds($this->pkg_max);
    
    		//USPS won't accept a zero weight Package
    		$this->weight = max($this->weight, 0.1);

    ...and I'm wondering, why would we want to return the free shipping array? Is it preventing the following lines from running? These:

    //USPS won't accept a zero weight Package
    		$this->weight = max($this->weight, 0.1);
  • Arnold

    Well your asking for a calculated rate but not giving the program anything to calculate against. It should only give the free shipping choice if all the product weights are zero in an order.

    You state above that some had weights but testing here it doesn't happen. CAn you verify that your getting this with products that have a weight?

    The reason this change was made was so that products could be offered with "free shipping". If it's a physical product there is no such thing, it just means the store pays the shipping. Easiest way to do that was to put in a zero weight so the customer doesn't get charged. This led to situations were all products were zero weight and no list of shipping options was shown. That's why the Free Shipping option was added. so they could pick something.

    So if your products need to be charged for shipping and your using calculated rates then you need some number in there for weight so there's something to calculate.

  • great8creative

    Thank you for response. I appreciate it.

    I'm sorry if I misspoke. To clarify, all we've needed was for 2 options to be available to customers at checkout: Priority or Express shipping. Not free shipping. We've never offered free shipping. And before this last update to marketpress, everything was working fine; customers were choosing one of the 2 shipping options.

    I only brought up the calculated rates in trying to problem solve this myself, when I noticed product weights affected the shipping options at checkout. All along, I'm just trying to get us back to offering only Priority or Express shipping, and not free shipping.

    I don't know that I understand everything you said about changes made to the plugin, but for the sake of getting my client's website back on track... You're saying we just need to enter a weight for every product, right? Is that the change we need to make with the latest release of MarketPress?

    So if your products need to be charged for shipping and your using calculated rates then you need some number in there for weight so there's something to calculate.

    So if we enter weights for all our products, we'll be back to offering just Priority or Express shipping. And free shipping won't be an available option. Is this right?