10 replies [Last post]
Minde_'s picture
Offline
Joined: 09/29/2008
Juice: 36
Was this information Helpful?

Hello everybody,

I am building an online resale clothing store for a client using Ubercart and Drupal. I've used Drupal before, but never built an online store, so this has definitely been a learning experience. Right now I'm struggling with figuring out shipping, and I was hoping some of you more experienced ones here can give me some pointers.

How do you set it up so that if there are different flat rate types in one order, the highest base price of the products in the cart is used and each item after uses only their per-product additional shipping price?

For example, I have the "Shirts & Light Jackets" flat rate shipping category, which (should - I'm still figuring that part out, too) apply to only shirts and light-weight jackets product types. The base price for that category is, say, $7 and the per-product is $3. Then I also have the "Jeans and Heavy Jackets" flat rate category, which applies to all jeans and heavy-weight jackets. The base price for that category is $9 and the per-product is $3 (unless, of course, in the product edit page it's been changed to something more, like $4).

So, let's say somebody buys a shirt and a pair of jeans. I would like the shipping to be shown to the customer as $15. That number would come from the highest priced flat rate category in the cart ($9 - "Jeans & Heavy Jackets") plus each of the rest of the items' per-product rates ($3 + $3).

Is there any way at all to make that work?

Any help would be greatly appreciated, especially if you can come up with it soon. It's been taking me too long to figure this out and my client is impatient.

justageek's picture
Offline
Bug Finder
Joined: 10/29/2008
Juice: 189
can you tell me what happens now with these rules

Here is how this will work, I think.

For each of your flat rate shipping rates, like "Shirts and Jackets", or whatever, you have to create an associated Product Class. If you are not familiar with Product Classes, they are essentially new content types for specific types of Products, so after you create these classes, you will use

Content -> Create Content -> Light Shirts and Jackets and NOT Content -> Create Content -> Product.

Then, you locate each one of your Flat Rate Shipping methods:

Administer -> Store Administration -> Configuration -> Shipping Quote Settings -> Quote Methods

(NOTE: it is important that you have the 'weight' for each shipping method set appropriately, so that Ubercart will apply the methods in order, lowest to highest, so in your example, your most expensive flat rate should be weight 0, next expensive should be 1, etc.)

Click on the Flat Rate tab / section and then for each one of the flat rate methods you have already defined, you click the 'conditions' link. This takes you into the Drupal 'Actions' system configuration, where you will be able to add one or more rules that will determine when the particular shipping method and its prices are applied. These available Ubercart actions are provided in a nice drop-down list in the Conditions group area of the screen. So, in this list, you locate and select Order: Product -> Order has a product of particular class. Then click Add Condition.

This will load screen that will list for you all your Product Classes. You select the Product Class that matches this shipping rule. For example, you should have a product class such as Shirts and Jackets and a shipping method for Shirts and Jackets. You select the product class from the list and click the overall Save Changes at the very bottom of the form.

Whew. this is a lot, and it is painful because once you are in the Actions area of the configuration, you can't get quickly back to your list of Shipping Methods.

But, once you have done this for each product class that has an assoicated flat-rate shipping method, it will work like this:

1. User adds product from Shirts and Jackets to cart - flat rate is $15 plus $3 per product
2. User adds product from Product Class B to cart - flat rate is $10 plus $3 per product.

When they go to checkout and click "calculate shipping", Ubercart will choose your Shirts and Jackets class and use it for shipping costs.

I realize this is a lot, and I wrote it quickly, let me know if it makes sense.

Brian

Minde_'s picture
Offline
Joined: 09/29/2008
Juice: 36
Re: can you tell me what happens now with these rules

It actually does make a good deal of sense. I had already figured I'd probably need to make classes that matched the different shipping rates because I didn't see any other way to tie different methods to different products. But I didn't even think about weighting the methods, so that's great to know.

I do have one question about classes, though. So, I have one shipping rate for both shirts and skirts. Since shirts and skirts are different kinds of things and will have different CCK fields (e.g. skirts won't have sleeve lengths) I want them to be different classes. Do I have to make different flat-rate shipping methods for each of them (i.e. one for shirts and one for skirts), or can I cover both with just one method?

justageek's picture
Offline
Bug Finder
Joined: 10/29/2008
Juice: 189
You can try a single flat rate

The reason I think it might work is this: When you are adding "conditions" to your new flat-rate shipping method, you can build these conditions with OR statements, so you can say:

Order has a product of class Shirts OR Order has a product of class Skirts

So, if a person order a Shirt or a Skirt, then that one flat-rate will be applied. So, I think you are good with a single flat-rate method applied this way to both classes.

Minde_'s picture
Offline
Joined: 09/29/2008
Juice: 36
Re: can you tell me what happens now with these rules

Ok, when I sat down to actually go through the process you outlined, I ran into a problem. When I click on the Flat Rate tab / section, there is no "conditions" link.

What is this "Actions"? Do you mean Workflow-ng?

I am using the latest version of Ubercart and Druapl 5.

justageek wrote:

Click on the Flat Rate tab / section and then for each one of the flat rate methods you have already defined, you click the 'conditions' link. This takes you into the Drupal 'Actions' system configuration, where you will be able to add one or more rules that will determine when the particular shipping method and its prices are applied. These available Ubercart actions are provided in a nice drop-down list in the Conditions group area of the screen. So, in this list, you locate and select Order: Product -> Order has a product of particular class. Then click Add Condition.

This will load screen that will list for you all your Product Classes. You select the Product Class that matches this shipping rule. For example, you should have a product class such as Shirts and Jackets and a shipping method for Shirts and Jackets. You select the product class from the list and click the overall Save Changes at the very bottom of the form.

Minde_'s picture
Offline
Joined: 09/29/2008
Juice: 36
Re: Re: can you tell me what happens now with these rules

I figured out that the difference was the Drupal version.

I set up a test install of Drupal 6 and the latest corresponding Ubercart release on my localhost and set up the basics of a mock store, and then went in and made the adjustments as per your instructions.

Everything worked just like you said, except for one crucial part: When the shipping is calculated, it shows all of the applicable flat-rate methods as options instead of just the highest one. How do I tell Ubercart to just show the top one and not the other options?

Jmmb's picture
Offline
Joined: 08/23/2007
Juice: 301
Re: Re: Re: can you tell me what happens now with these rules

Yes, this is exactly what I need to find out as well. So far it's not too easy - any advice is appreciated.

Jim

(Drupal^Ubercart) * (Design^Development^Hosting) = Sundays Energy

sisko's picture
Offline
Joined: 09/17/2009
Juice: 260
Hi, did you manage a solution

Hi,

did you manage a solution to combine or restrict the flatrates delivery rate s into one? Puzzled

Jmmb's picture
Offline
Joined: 08/23/2007
Juice: 301
Hi sisko, Yes, I did

Hi sisko,

Yes, I did eventually figure out a solution. I'm not sure if it's the most elegant, but it was the only thing I could find that worked.

Basically, I had to create different classes for the main types of products that I wanted to differentiate between. Then in the Workflow-ng settings, I was able to limit shipping results in an order based on product class.

Hope that helps,

Jim

(Drupal^Ubercart) * (Design^Development^Hosting) = Sundays Energy

sisko's picture
Offline
Joined: 09/17/2009
Juice: 260
Re: Hi sisko, Yes, I did

Thanks for your response Jmmb.

If you're using Workflow-ng, then you're on drupal 5.

Unfortunately, I'm on Drupal 6, workflow-ng is not supported and the Rules module which replaces it didn't seem to help very much.
( or perhaps I just didn't use it properly ??? ).

Any thoughts or suggestions ??

marcus178's picture
Offline
Joined: 04/13/2009
Juice: 113
Re: Multiple Flat Rates in One Order

I have follow the instructions on this post but when I click on calculate shipping it shows both the cheaper option and the expensive option. How do I get it to just display one. I have set the order of my quote methods but that does seem to make any difference.