Shipping

Posts: 29
Joined: 11/05/2007

Hello,

Is it possible to define shipping charges based on the following criteria?

I need to set up shipping costs based on quantity (or weight if necessary), state where the order will be shipped and type of shipping (air or ground). Multiple states fall into the same shipping rate so I would like to set up different regions which contain the one or more states. For example

Region1 = CA
Region2 = OR,NV
Region3 = AZ,CO,ID,MT,NM,WA,WY

Ground
Qty Region1 Region2 Region3
1 $12.62 $12.99 $13.16
2 $13.45 $14.21 $14.50
3 $14.67 $15.33 $15.67

Air
Qty Region1 Region2 Region3
1 $14.35 $16.80 $17.50
2 $18.00 $21.95 $22.65
3 $21.80 $27.25 $28.00

Thanks for your help,

Patrick

Posts: 802
Joined: 11/05/2007
Bug FinderFAQ ModeratorGetting busy with the Ubercode.

Use the procedure detailed in http://www.ubercart.org/faq/2942 but instead of checking the order total value, check on the ship-to state and the # of products. You'll need more than two flatrate configurations.

--

<tr>.

Posts: 29
Joined: 11/05/2007

I have configured the flatrate and workflow-ng settings for shipping to use an amount of $30 to ship 6 items to zone 2 by ground and to use an amount of $51.92 to ship 6 items to zone 2 by air using shipping zone and number of products as conditions. Instead of using these values the shipping quote calculation is multiplying the flatrate by the number of products, i.e. 6 * $30 for ground and 6 * 51.92 for air. Is this the desired functionality? Would it make sense to be able to choose an operator in the flatrate setup to allow for both cases? Is it correct and what are the implications of changing

if (is_null($product->flatrate)) {
$rate += $method->product_rate * $product->qty;
}
else {
//$node = node_load($product->nid);
$rate += $product->flatrate[$mid] * $product->qty;

to

if (is_null($product->flatrate)) {
$rate += $method->product_rate;
}
else {
//$node = node_load($product->nid);
$rate += $product->flatrate[$mid];

Thanks for the help,

Patrick

Posts: 802
Joined: 11/05/2007
Bug FinderFAQ ModeratorGetting busy with the Ubercode.

Flatrate gives you a space to enter a base price (per order) and a per-product price. You put your numbers in the wrong spot.

--

<tr>.

Posts: 29
Joined: 11/05/2007

Hello TR,

Due to the large number of flatrate entries I have created I went into the database and executed the following queries:

update `uc_flatrate_methods` set `base_price` = `product_price' WHERE `product_price` > 0
update `uc_flatrate_methods` set `product_price' = 0 WHERE `product_price` > 0

I thought this would be a simple fix and save me a lot of time. The shipping amount is still not being calculated correctly. The shipping costs are double the amount they should be. I think it might have something to due with the uc_flaterate_products table. What is the purpose of the uc_flaterate_products table? How does the mapping work between this table and the uc_flatrate_methods table? Is it possible to fix the shipping problem through my approach or do I need to revert to the old database and make the changes one by one?

Thanks for your help,

Patrick

Posts: 1998
Joined: 08/07/2007
AdministratoreLiTe!

uc_flatrate_products holds the price per product for each method that overrides the rate in uc_flatrate mehtods. If you don't want a per product rate, you should remove the rows in that table because they're overriding the zeros you put in uc_flatrate_methods.

Posts: 29
Joined: 11/05/2007

Thanks for the quick reply. To solve the problem I executed the following SQL command:

update `uc_flatrate_products` set `rate' = -1