Post by nyltak » Sat Sep 17, 2011 7:53 am

So I managed to write some code which will seperate the unique products from each other so that UPS treats them as seperate packages. but I can not for the life of me figure out how to take this one step furthur to divide multiple quantities of the same product.
What I don't understand is why this treats more than one of the same product as only 1 instance in the foreach. Anyone have any ideas on returning $up for each individual item. those that are alike as well as those that are not?

Code: Select all

foreach ($this->cart->getProducts() as $product){

$up .= ' <Package><PackagingType><Code>02</Code></PackagingType><PackageWeight><UnitOfMeasurement>
<Code>lbs</Code></UnitOfMeasurement><Weight>' . $product['weight'] . '</Weight></PackageWeight></Package>';

$ups = $up;

}
return $ups;

New member

Posts

Joined
Wed Jul 20, 2011 9:56 am

Post by nyltak » Sat Sep 17, 2011 5:57 pm

ran into another problem with this, now the cart can't recognize products that don't require shipping costs... I used to think life was easy with an IQ of 40, but now I'm not so sure...

New member

Posts

Joined
Wed Jul 20, 2011 9:56 am

Post by Qphoria » Sat Sep 17, 2011 10:09 pm

This mod already exists actually. Search extension area for UPS deluxe. It had the option to have individual products or split into packages based on weight limits

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by nyltak » Sun Sep 18, 2011 12:34 am

the whole point of using an opensource program is to not have to pay for it. I shouldnt have to pay for some code that should be in the software to begin with... its ok, I understand, its difficult to make money on a free project. For some reason I keep thinking that maybe someone would offer a snippet or two of code that i can work from. a hint even. I actually enjoy trying to decipher php code, im just slow at it.

New member

Posts

Joined
Wed Jul 20, 2011 9:56 am
Who is online

Users browsing this forum: No registered users and 1 guest