Author Topic: USPS v5 - Bundled and Unbundled shipping  (Read 185462 times)

lowmips

  • Global Moderator
  • Hero Member
  • *
  • Posts: 1464
    • lowmips.com
USPS v5 - Bundled and Unbundled shipping
« on: October 11, 2008, 20:08:08 pm »
Hi all,
My online shop needed to calculate the shipping cost for certain items seperately, as those items ship in their own box.  The current implementations of the USPS module were returning incorrect quotes as they were assuming all items were shipped together.  So, I rewrote the USPSv4.0 module to include this functionality.  My new module adds a new attribute to your product, which designates whether or not the product ships alone, or can be bundled with other products in your cart.  At checkout, all "bundled" items weight are combined, and that rate is queried from USPS.  Then, each "unbundled" item is queried.  All queries are then added together for a final shipping price.

I have attached the installation archives to this post.   Please view the README.txt for installation instructions.

If you come across any bugs, please post them here. I have subscribed to this topic. I have added this functionality to the UPS shipping module as well.  Please see this post for details.

Thank you,
Reggie


Show shipping estimates before the user checks out! Download plgSystemCartRates-USPSv5.zip


Versions


vm11x-USPSv5.2011.02.09-BASIC
- Adheres to 'drop in' concept of VirtueMart shipping modules, should work with any recent version of VirtueMart
- Supports latest v4 domestic and v2 international USPS API (IMPORTANT! The old v3 is being phased out.)
- Domestic/International handling fees
- allows for upcharging each service type
- mod_virtuemart_currencies support
- works with the "Cart Rates" plugin
- should work with any version of VM from 1.1.x+

vm118-USPSv5.2011.03.25
- v4 Domestic and v2 Inernational API support (IMPORTANT! The old v3 is being phased out.)
- Bundled/Unbundled products support
- Domestic/International handling fees
- allows for upcharging each service type
- mod_virtuemart_currencies support
- works with the "Cart Rates" plugin
- Package Dimension declaration
- GXG support
- ported to VirtueMart 1.1.8

vm119-lowmips.2011.08.22
- includes vm118-uspsv5.2011.03.25
- ported to VirtueMart 1.1.9
- download from my website

[attachment cleanup by admin]
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

koaweb

  • Beginner
  • *
  • Posts: 20
Re: USPSv5.0 - Bundled and Unbundled shipping
« Reply #1 on: October 14, 2008, 10:10:51 am »
Hi Reggie,
Thanks for making this mod available. It seems like the product.product_form file breaks the page from the VM template and won't open correctly. Only the first few fields of the Product Information tab shows up.

Im using VM 1.1.1 and J! 1.0.15

Looking forward to using this, I hope you are able to replicate and fix it.

Thanks again.


lowmips

  • Global Moderator
  • Hero Member
  • *
  • Posts: 1464
    • lowmips.com
Re: USPSv5.0 - Bundled and Unbundled shipping
« Reply #2 on: October 14, 2008, 14:13:53 pm »
Koaweb,
I wrote and tested this on Joomla 1.5.x and VM 1.1.x.  All I did in that specific file was add a new column with a checkbox.  Are there any error messages displayed in your browser? What browser are you using?  Could you do a "print source" on the webpage and copy the results to a file and upload them to this thread?

Thanks,
Reggie
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

koaweb

  • Beginner
  • *
  • Posts: 20
Re: USPSv5.0 - Bundled and Unbundled shipping
« Reply #3 on: October 17, 2008, 11:03:05 am »
The page did not show any on screen error messages and my browser is FF 2.0.0.17

Theres quite a bit missing from the source code when using the Simple Layout. When viewing it in Extended Layout the CSS does not break but it still does not load beyond "Manufacturer" field on the Product Information page.

I am not able to post the source code because it goes over the char. limit for the forum. I will PM it to you if I can.

Thanks again for looking into it.


lowmips

  • Global Moderator
  • Hero Member
  • *
  • Posts: 1464
    • lowmips.com
Re: USPSv5.0 - Bundled and Unbundled shipping
« Reply #4 on: October 21, 2008, 22:37:03 pm »
Hi all,
Koaweb and I have done some preliminary debugging of his issue and we have decided it is most likely a Joomla version issue, but have no hard evidence.  I currently do not have a Joomla 1.0.x installation to debug the issue on.  I have successfully tested this module on Joomla version 1.5.x, so please keep this in mind if you decide to use it.  If anyone else uses Joomla 1.0.x and does or does not see this same issue please let me know so I can confirm that it is/is not a versioning issue.

Thanks,
Reggie
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

lowmips

  • Global Moderator
  • Hero Member
  • *
  • Posts: 1464
    • lowmips.com
Re: USPSv5.0 - Bundled and Unbundled shipping
« Reply #5 on: October 21, 2008, 23:28:13 pm »
Hi all,
I added this functionality to the UPS shipping module. See this post for details.

Reggie
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

kumar16

  • Beginner
  • *
  • Posts: 14
Re: USPSv5.0 - Bundled and Unbundled shipping
« Reply #6 on: November 03, 2008, 19:16:47 pm »
I installed this module and got my USPS account activated. I dont see anything when it comes to select a shipping method. I am unable to go to the payment without selecting the shipping method, which just appears blank. Any ideas? Thanks.

lowmips

  • Global Moderator
  • Hero Member
  • *
  • Posts: 1464
    • lowmips.com
Re: USPSv5.0 - Bundled and Unbundled shipping
« Reply #7 on: November 03, 2008, 20:57:20 pm »
Have you enabled the USPSv5 module under VirtueMart?
Administration->Admin->Configuration->Shipping->The USPS Shipping v5.0. Supports bundled and unbundled shipments.

Have you enabled the appropriate shipping types under the USPSv5.0 configuration?
Administration->Store->Shipping Module List->(USPSv5.0) Configure Ship Method->Domestic/International shipping options


Hope this helps,
Reggie
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

kumar16

  • Beginner
  • *
  • Posts: 14
Re: USPSv5.0 - Bundled and Unbundled shipping
« Reply #8 on: November 03, 2008, 21:51:31 pm »
Hey lowmips,

I did. I think i figured out what the problem was, the product attribute weight was not set. Once i did that, its working now. I ran into another serious problem where i am unable to change the attribute of existing products, but that is not related to this and i hope someone helps me out with that soon. Thanks for this wonderful module!

lowmips

  • Global Moderator
  • Hero Member
  • *
  • Posts: 1464
    • lowmips.com
Re: USPSv5.0 - Bundled and Unbundled shipping
« Reply #9 on: November 03, 2008, 23:06:32 pm »
here's why (this was in the original code as well, just in a different way):

// don't process shipments with no weight. we either have digital downloads, or an empty cart
$order_weight = $d['weight'];
if($order_weight <= 0) {
   return true;   
}


I think I'll add in some debug code that shows the order weight is zero.
=)
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

lowmips

  • Global Moderator
  • Hero Member
  • *
  • Posts: 1464
    • lowmips.com
Re: USPSv5.0 - Bundled and Unbundled shipping
« Reply #10 on: November 06, 2008, 21:09:53 pm »
Updated to remove typo introduced in last update...
Updated ps_product to do validation check on ship_alone variable.
Updated uspsv5.php to check each shipment individually against the 70lb max weight limit, instead of the combined weight of all shipments (the original way)
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

lowmips

  • Global Moderator
  • Hero Member
  • *
  • Posts: 1464
    • lowmips.com
USPSv5.0 - Bundled and Unbundled shipping
« Reply #11 on: November 14, 2008, 17:29:21 pm »
Updates 2008/11/14:
BUG NOTICE
I've found a bug where shipments with large numbers of unbundled items will cause the rate request to fail.  This is due to the XML query surpassing the maximum string length allowed in PHP.  I noticed this bug when testing my other module, UPSv2.0 with large shipments that contained around 40 individual packages.  I do not know the exact number of individual packages that will cause this failure.

Over the next week or so I will be modifying the USPSv5.0 module to include much of the new functionality I've put into the UPSv2.0 module, which will include a bugfix for this.

-Reggie
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

Gaelen Hudson

  • Beginner
  • *
  • Posts: 6
Re: USPSv5.0 - Bundled and Unbundled shipping
« Reply #12 on: December 01, 2008, 21:45:16 pm »
I'v got the module installed, enabled, and configured.  However it still does not show up during checkout as an option. Just downloaded and installed today.

Using Joomla! 1.5.8 and VM 1.1.2

lowmips

  • Global Moderator
  • Hero Member
  • *
  • Posts: 1464
    • lowmips.com
Re: USPSv5.0 - Bundled and Unbundled shipping
« Reply #13 on: December 01, 2008, 22:10:13 pm »
Put your website in debug mode, make note of the XML post and replies.

-Reggie
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

Gaelen Hudson

  • Beginner
  • *
  • Posts: 6
Re: USPSv5.0 - Bundled and Unbundled shipping
« Reply #14 on: December 02, 2008, 00:54:34 am »
Good call.  When it gets to the shipping selection phase of checkout it loads the standard module then says:

Debug: Starting Shipping module: uspsv5

Debug: The order total weight is zero. Exiting USPSv5.0.

This store does not do weight based shipping. Does this mean we will not be able to use the module unles we specify a weight for each item?  We have clos to 300 products and use flat rate boxes and would rather not have to go back to put in a weight for each item.