Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Shipping Costs


Recommended Posts

Hi Everybody


I've looked through the lists and I can't find the exact answer I need.


This is the scenario:


Product 1

Order 1 - 2, Postage Cost 1.80

Order 3+, Postage Cost 2.50


Product 2

Order 1 - 3, Postage Cost 2.50

Order 4+, Postage Cost 4.50


Product 3

Order 1, Postage Cost 2.50

Order 2+, Postage Cost 4.50


I've sat here for ages trying to work out a way of doing this with the table and I just can't work out a way of doing it.


Any help would be much appreciated.



Link to comment
Share on other sites

If you're only selling three products, and that's all you will ever be selling, you could write a custom shipping module that would check which product it is via the product_id and count the quantity. Then it just spits out the required amount. If you look at the existing shipping modules you can see how they calculate the quantit, etc. If there are going to be more than three products, but they are only in three different groups, you could add a check box or drop down menu on the product page and designate which group it belongs to. This would only be on the admin side so it's invisible to the customer. Then the shipping module would just check to see which groups it's in, check the quantity, and spit out the amount. The only problem I see is if they order 3 of product 1, 1 of product 2, and 5 of product 1. You should be able to modify flat.php or one of the other shipping modules to work. Just an idea.

If every member of this board donated $1 to the dev team, that would be over $11,000.00. Don't you think this cart is worth at least a $1????

Link to comment
Share on other sites

If I was a PHP expert then I might have a crack at it. :)


I *think* I have a solution though.


Group 1 Products have a weight of 1.


Group 2 Products have a weight of 50 (It's unlikely that anyone would buy 50 Group 1 Products).


Group 3 Products have a weight of 1000.


Then I set my table up like so:




That way if someone buys 1 Group 1 Produc and 1 Group 2 Product the weight will be 1001 and the shipping cost will be 2.50 which is correct - I think.


Does that look like it makes sense?



Link to comment
Share on other sites

If someone buys 10 group two products, don't you want the shipping price to be $4.50? As I read it, it would charge $2.50 still. Perhaps weights of 1, 50, and 150 with a table of 2:1.80,199:2.50,10000:4.50


Since they use the same rates with different thresholds, group three products have to weigh about three times as much as group two products. They can range from twice the weight to 3.99 times the weight.


Good luck,


Link to comment
Share on other sites

a small modification to a contribution I just uploaded might do the trick. You can read the info about it here: http://www.oscommerce.com/forums/viewtopic.php?t=50221


so instead of adding one field to the database, you would need to add three -

maybe something like products_ship_price, products_ship_price_two, products_ship_qty


after adding all the code to the various places and adding the new database tables to the queries, the line in shopping_cart.php that you would have to modify from the contribution would be:


$this->shiptotal += ($products_ship_price);


but instead it would be


if $qty => $products_ship_qty) {

$this->shiptotal += ($products_ship_price_two);

} else {

$this->shiptotal += ($products_ship_price); 


-D. M. 8)

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...