VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Shipping VM 1.1 => USPS (U.S. Postal Service) VM 1 => Topic started by: lowmips on September 25, 2008, 21:39:49 pm

Title: Unbundled Shipping?
Post by: lowmips on September 25, 2008, 21:39:49 pm
I am using VirtueMart 1.1.2 stable and USPS shipping module version 4.  My problem is this:
All items in the cart are apparently assumed to be bundled in the same shipment. For instance, if I sell one item weighing 5 lbs, and having the dimensions 40x8x8inches, along with another item weighing 7lbs, and having dimensions 48x8x8inches, the USPS module queries the API server for a package weighing a total of 12lbs (and looking at the actual XML file sent to the API server, it completely ignores the dimensions anyway). 
In reality, my items are shipped seperately in their own boxes, and the costs for this is much higher than the quote for the combined weight.  Is there a way to make the USPS module get seperate quotes, and add both to the total?

If not, where should I post a request for this feature? Unless I can work around this issue, I will not be able to use VirtualMart for my eCommerce needs.

Title: Re: Unbundled Shipping?
Post by: Mike M on September 30, 2008, 18:52:07 pm
I would love to know the answer to this question as well.
Title: Re: Unbundled Shipping?
Post by: lowmips on September 30, 2008, 21:41:43 pm
I've delved into the VirtueMart code and found that there is no way around this as it is.  The shopping cart adds the total weights together, and puts them into one variable.  The shipping module then queries that one variable and forms the XML (or HTTP) request to the shipping API's and shows the result from that query.

So, I've taken it upon myself to attempt a hack to fit my needs. 

Basically I'm adding an option to each product which signifies it must be shipped alone.  Any items in the cart with this option will have their shipping costs queried separately.  Items without this flag are assumed to be in one shipment, and the total weight for those is queried. Then, the total cost of each shipment is added together, and that will be the shipping cost shown and used in total cost calculations.

I'm about 1/4 done and if things go well I'll have this working in a couple of weeks.  However, I am pretty green with PHP, Joomla, and VirtueMart programming, so it's slow going...I'll post the hack here if I am successful.
Title: Re: Unbundled Shipping?
Post by: lowmips on October 11, 2008, 20:15:47 pm