8 replies [Last post]
sisko's picture
Offline
Joined: 09/17/2009
Juice: 258

Hello guys,

I'm at a crossroads and I need help.

My clients cart has a number of items in it. They want Items in class A, B and C to cost £10 to deliver.
If a customer adds multiple items across those classes are added to the cart, the delivery cost should NOT be £30 but £10.

I have all items of those classes represented as seperate product classess with shipping quotes for each of them costing £10.

In addition, Class D items cost £50 to deliver and if a Class D item and one of Class A, B, and C was ordered, the delivery cost should only be £50 - only the maximum amout.

So, please help me as the delivery calculations right now are way off.

Thanks people.

sisko's picture
Offline
Joined: 09/17/2009
Juice: 258
Hi guys, I really do need

Hi guys,

I really do need serious help with this issue.

To demonstrate my problem, please visit http://www.piggotts.co.uk/eStore/

  • On the home page are 2 products.
  • Add them both to the cart
  • Once both items are added, proceed to checkout
  • Towards the bottom of the page where you will find the "Calculate shipping cost" area - there is the problem

The delivery cost for the items are correct but I need some computation done.
In this case, the delivery cost should total to £125 - ignoring the flags' £10

If only 2 flags are ordered, the delivery cost should total to £10 - not £20

And I don't want to give my customers options to select. Just to calculate the right cost and add it to the order total.

Can anyone please help and give me direction on how to solve this problem ?

Thanks.

Uberchic's picture
Offline
Administrator
Joined: 08/29/2008
Juice: 754
Re: Hi guys, I really do need
sisko's picture
Offline
Joined: 09/17/2009
Juice: 258
Dear Uberchic, thank you for

Dear Uberchic,

thank you for your intervention.

Your recomendation had alot of merit to it but there are some further issues.

The first thing is :

setting the 'flat shipping rates' for each product doesn't work if more than one of those products is added to the cart.
If you adjust the 'External halyard - Fiberglass Flagpoles' quantity to 2 on the cart page, the delivery rate doubles when it should remain £125

The second problem :

There is one product where we will have quite a number of them. Adjusting them each will be deficult.

I wonder, is there a module which can apply granular logic rules to the calculate shipping process?
Either a module or a way to write custom php code to deliver the right delivery cost?

thanks.

ps: you just have to "love" annoyingly demanding clients Eye-wink

Andy's picture
Offline
Administrator
Joined: 08/07/2007
Juice: 1153
Re: Dear Uberchic, thank you for

I think you have to write a custom module to achieve this. You can look here: http://www.ubercart.org/docs/api/hook_shipping_method and here: http://www.ubercart.org/docs/api/hook_shipping_type for the api's you will need. Also look at the flatrate module for a starting point.
--Andy

Andy's picture
Offline
Administrator
Joined: 08/07/2007
Juice: 1153
Re: Dear Uberchic, thank you for

Before you go and write a module, I think I might have a solution.
Create two flat rate shipping methods. Lets call them method_10 and method_50. Each one with a base rate of 10 and 50 respectively and no per item.
Then set the conditional actions for method_10 to only get a quote only if there is a product of class "a" in the cart, and not if there are products of class "b" in cart.
Then set the conditional actions for method_50 to only get a quote if there is a product of class "b" in the cart. I have not tested to make sure this will work as you want, but I think it will and I'll let you know if I manage to set it up on demo.ubercart.org and it works.

sisko's picture
Offline
Joined: 09/17/2009
Juice: 258
Re: Re: Dear Uberchic, thank you for

Thanks Andy,

your suggestion is much appreciated. First thing tomorrow when I'm back at it, I'll give it a try.

Hit or miss, I'll let you know Smiling

sisko's picture
Offline
Joined: 09/17/2009
Juice: 258
Thanks

Andy,

words can not express my gratitude. I don't care how sloppy this sounds Smiling, you are the man!

I feel so daft I didn't see this before but I implemented your second suggestion and things began to fall into place.

I'm still tring to wrap my mind around the logic, I only understand it about 3/4 of the way, but it seems to be working.

If it falls to pieces down the line, I will go down the module route but so far . . . so good.

Thanks a great deal.

Andy's picture
Offline
Administrator
Joined: 08/07/2007
Juice: 1153
Re: Thanks

Glad to help. Good luck with the project! Once you get it all set up, you should list it on the live sites page. http://www.ubercart.org/forum/live_sites/146/live_sites_forum_instructions