No replies
camoa's picture
Offline
Joined: 10/04/2011
Juice: 13
Was this information Helpful?

Hello,

I was working on a special case for my project and got into a particular shipping quoting method:

The company I am helping does food deliveries from several restaurants, their shipping cost is X amount for each restaurant you order from.

Example: if you order 4 items, 3 from restaurant 1 and 1 from restaurant 2 your delivery cost wil be 2X.
If all the items are from the same restaurant it will be only X amount.

Well, I'm not sure I am explaining it correctly, anyway I did not find any shipping method that worked this way or could be accommodated, the closest thing I found was the multi flat rate module, so I used this one and made some modifications.

The modifications are simple:
Instead of using product classes, I am using catalog terms. Assuming that each restaurant is a root term in the catalog the module will add the value defined for each restaurant in the configuration.

So,

if the catalog looks like:

Restaurant 1
- Prod 1
- Prod 2
- Entrees
- - Entree 1

Restaurant 2
- Prod 3
- Prod 4

the shipping quotes go like:

Restaurant 1 $5
Restaurant 2 $3

and your cart looks like:

Qty Product
2 Prod 1
1 Entree 1
3 Prod 4

the module will charge that order 8 dollars total.

As it is a fast modification on the multiflatrate module, there is code that may not be needed or can be used to allow for a flat rate per restaurant plus an extra amount per quantity.

PreviewAttachmentSize
Module to add a flat rate for each catalog root that the products belong to.5.47 KB