Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / Built-in Shipping and Payment Modules / Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories?

Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories?

Locked

Started by blackorchidcouture on 18 Jun 2010, 9:03 PM · Views: 8,361

Results 1 to 20 of 70
This thread is locked. New replies are disabled.
18 Jun 2010, 9:03 PM
#1
blackorchidcouture avatar

blackorchidcouture

Zen Follower

Join Date:
Apr 2010
Location:
Albuquerque, NM
Posts:
198
Plugin Contributions:
0

Post #1 by blackorchidcouture

Been researching this, can't figure it out.

Basically, one whole category in my store is a product that will be dropshipped by the manufacturer, a flat $10 for shipping any amount ordered in that category, and can only be shipped to the US. I know I need to use Flat Rate Shipping and US zone.

BUT, all other categories I have here in stock and will be shipping myself based on weight, using USPS. I will ship internationally for these items, so more zones.

I've seen lots on using and cloning different shipping modules for different zones, but not for different categories.

If a customer orders a mixture of products from the dropship category and from the other categories, I will need their cart to itemize the $10 flat fee plus the additional shipping by weight (I think it would be cool if these could show on separate lines if possible).

Anyone have any experience with this? Thanks!

18 Jun 2010, 9:47 PM
#2
blackorchidcouture avatar

blackorchidcouture

Zen Follower

Join Date:
Apr 2010
Location:
Albuquerque, NM
Posts:
198
Plugin Contributions:
0

Post #2 by blackorchidcouture

OK, I just found a post where someone was having the exact same issue: http://www.zen-cart.com/forum/showthread.php?t=123932

One suggested solution was to compromise and come up with one flat rate for the whole store, which I just don't think will work in my case. The category that I need to be a flat rate of $10 for shipping is higher priced jewelry pieces compared to the clothing and accessory items in the rest of the store. If someone buys an $8 shirt, they are not going to want to pay $10 shipping, it would only be a good deal if they buy more items. If I compromise and say the flat rate is $5 shipping, I'll be losing on shipping in most circumstances. Anything above $5 is too much for those items under $10. I was thinking I could do the whole store by weight, and make those dropshipped items weigh more so the shipping charge is higher for them, but then it might go over $10 if they order a lot from that category.

The thread I posted above talks about adapting osC modules for Zen Cart, and I found the directions here: http://www.zen-cart.com/wiki/index.php/Developers_-_Porting_modules_from_osC

But where would I find the osC modules in the first place?

18 Jun 2010, 10:37 PM
#3
blackorchidcouture avatar

blackorchidcouture

Zen Follower

Join Date:
Apr 2010
Location:
Albuquerque, NM
Posts:
198
Plugin Contributions:
0

Post #3 by blackorchidcouture

Nevermind, I found it: addons.oscommerce.com/info/4129

I'll update if it does what I'm needing to after I modify it.....

18 Jun 2010, 10:59 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #4 by ajeh

Did you try just setting the weight to 0 on the Products from that Category and then just test if 1 or more Products from that Category and add the Flat Rate amount to the calculated shipping cost in the USPS shipping module?

You can also make it so if all Products in the order are from that Category then turn off the USPS shipping module and just enable the Flat Rate flat shipping module ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Jun 2010, 12:13 AM
#5
blackorchidcouture avatar

blackorchidcouture

Zen Follower

Join Date:
Apr 2010
Location:
Albuquerque, NM
Posts:
198
Plugin Contributions:
0

Post #5 by blackorchidcouture

I actually had that thought, that one way to separate these products from the ones that would ship by weight would be to set their weight to 0, and then to "somehow" make all the 0 weight products fall under the flat shipping price. It's just the "somehow" that I don't get!

When you say "test if 1 or more Products from that Category and add the Flat Rate amount", are you talking about a .php query or something? Honestly my .php knowledge is limited, I can cut/paste in all the right areas and files. What files do I want to be looking at? I'm doubting that this is as simple as configuring in the admin area.

I downloaded that osC module, and there look to be over 20 php files that I'd have to modify, not sure that's the route to go....

Thank you!

19 Jun 2010, 12:52 AM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #6 by ajeh

If all the Products in that Category are using the same master_categories_id ... say this was categories_id 10 ... you could test for how many are being used with:

global $cart;
$chk_flat_cat = $_SESSION['cart']->in_cart_check('master_categories_id','10')

$chk_flat_cat would then tell you the number of Products x quantity in the shopping cart ...

I would have to really sit down to write the customizations to the code for this ... which is not hard, but more time consuming ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Jun 2010, 2:04 AM
#7
blackorchidcouture avatar

blackorchidcouture

Zen Follower

Join Date:
Apr 2010
Location:
Albuquerque, NM
Posts:
198
Plugin Contributions:
0

Post #7 by blackorchidcouture

Yes, they are all under the same master category. I totally understand what I'm asking would be time consuming, and I'm not at all expecting you to come up with the whole fix for me. Would you be able to just tell me what file I'd be putting that test into? If I know what file to start with, I can experiment and investigate and see if I can figure it out....

19 Jun 2010, 2:54 AM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #8 by ajeh

I'd customize the Flat Rate flat shipping module:
/includes/modules/shipping/flat.php

and I would customize the USPS shipping module:
/includes/modules/shipping/usps.php

You can then determine which one needs to run based on the results of the test of the cart contents ...

Controlling the $this->enabled determines which runs, by setting it to false when it should not run and true when it should run ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Jun 2010, 3:22 AM
#9
blackorchidcouture avatar

blackorchidcouture

Zen Follower

Join Date:
Apr 2010
Location:
Albuquerque, NM
Posts:
198
Plugin Contributions:
0

Post #9 by blackorchidcouture

Cool, thanks for the headstart, I'll see what I can do!

One more question and I'm out of your hair, to create the right override setup, would I put the modified files in:

  1. includes/modules/my_template/shipping

or

  1. includes/modules/shipping/my_template

Or would they both work the same?

Thanks again!

19 Jun 2010, 4:05 AM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #10 by ajeh

The shipping modules do not have overrides ...

Save a copy of the originals on your computer ... and then save a copy of your customized files on your computer for the future ...

Don't try to save them in the:
/includes/modules/shipping

directory as this is a self loading directory and unless you name them right, they will cause you issues if left in there ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 Jun 2010, 3:00 AM
#11
blackorchidcouture avatar

blackorchidcouture

Zen Follower

Join Date:
Apr 2010
Location:
Albuquerque, NM
Posts:
198
Plugin Contributions:
0

Post #11 by blackorchidcouture

So I've read through the suggestions you gave me, Linda, and have read through most of the following thread and gotten a lot of ideas: http://www.zen-cart.com/forum/showthread.php?t=91394.

I now have some more questions.

  1. Are the Master Categories the main categories in my categories sidebox? In terms of this string of links to get to the rings, Alchemy of England/Gothic Jewelery/Rings, is Alchemy of England (which has a lot of other subcategories too) the Master Category, or is Rings? If it helps, here is my store: https://www.blackorchidcouture.com.

  2. So if I add a weight to all the products I want to ship with USPS, and keep all the Alchemy products at 0, then only the wieghted products will generate a shipping price for USPS? And then I just need to have the flat shipping activated anytime I there is an Alchemy product in the cart?

  3. Would this code work in the flat.php to add the flat rate to the Alchemy category (category ID 1).....

 // disable only when entire cart is free shipping
          
      if (zen_get_shipping_enabled($this->code)) {
          $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
      }

      // disable for one master_categories_id
      if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','1') > 0)) {
          // show FLAT
          $this->enabled = true;
      } else {
          // hide FLAT
          $this->enabled = false;
      } 

I hope I'm getting close, the shipping is the last thing holding me back!

22 Jun 2010, 3:30 AM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #12 by ajeh

If you do not use linked products, then the master_categories_id matches the categories_id that it is in ...

If you do use linked products, then you have to see which of the 1+ categories_id has been assigned as the master_categories_id on the product ...

If you have 0 weight on the products that you want the flat rate charge on, you have to check that on the Configuration ... Shipping/Packaging ... that you have marked 0 weight does NOT mean Free Shipping ...

Above the line:
// disable for one master_categories_id

put the code:
global $cart;

so that you can use calls to the cart ...

Are you trying to use Flat Rate when only products from master_categories_id is 1 or to also show it with USPS when there is 1 or more products in the cart from categories_id 1

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 Jun 2010, 7:28 PM
#13
blackorchidcouture avatar

blackorchidcouture

Zen Follower

Join Date:
Apr 2010
Location:
Albuquerque, NM
Posts:
198
Plugin Contributions:
0

Post #13 by blackorchidcouture

I'll have more time to look this all over later, but for now, I don't believe I'm using linked products, Alchemy of England is master category 1, then there are subcategories, then more subcategories folders with the different products.

As for what I need to happen in the cart, if someone orders one or more of these products, I'll need to charge them a flat $10, no matter the quantity. If anything is ordered from any other category also, this $10 needs to be ADDED TO the USPS shipping calculation for these other products. If only other products are ordered and no Alchemy products, I need only USPS to come up.

Thank you! I'll be back tonight.....

22 Jun 2010, 8:56 PM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #14 by ajeh

The master_categories_id is NOT the top level categories_id of a branch on the category tree ...

The master_categories_id is related to the immediate categories_id that the Product is in ...

So if you have a Top Level Category for Alchemy of England that is categories_id 1 and 3 subcategories with Products, then it is those subcategories categories_id that would be the master_categories_id for the Products ...

So what you can do is in Flat Rate flat shipping module you want to count how many products are in the multiple categories_id with the master_categories_id and see if it is the same as the total item count in the cart ... if so, then the whole cart should use Flat Rate ...

If not, then you want to have USPS shipping module check if 1 or more are in those categories_id and if so, add $10.00 to the calculated cost from USPS ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

25 Jun 2010, 7:22 AM
#15
blackorchidcouture avatar

blackorchidcouture

Zen Follower

Join Date:
Apr 2010
Location:
Albuquerque, NM
Posts:
198
Plugin Contributions:
0

Post #15 by blackorchidcouture

Now that I understand the master_categories_id, I'm thinking the easiest thing would be if I could test if the products were from a certain manufacturer, in this case Alchemy. I will have a lot of master_categories_id's under the top category of Alchemy. I was looking for a way to use the manufacturer instead, and I found both manufacturers_id and product_model. Would either of these work to test in place of master_categories_id?

Thanks!

25 Jun 2010, 1:51 PM
#16
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #16 by ajeh

You can test for the manufacturers_id with:
$_SESSION['cart']->in_cart_check('manufacturers_id','XX')

where XX is the manufacturers_id that you want to check ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

25 Jun 2010, 7:00 PM
#17
blackorchidcouture avatar

blackorchidcouture

Zen Follower

Join Date:
Apr 2010
Location:
Albuquerque, NM
Posts:
198
Plugin Contributions:
0

Post #17 by blackorchidcouture

Yaye, thanks! That's going to be easier I think.

I think I just have one more question. Is the cart able to use/combine TWO shipping modules in one session? Meaning if there are mixed products/manufacturers, will it apply the USPS module for the weighted products AND the Flat module/$10 for the Alchemy products?

Or is it more like, it will use Flat for only Alchemy products, USPS for only other products, and if they are mixed, it won't use Flat at all, but I will need to make it add $10 to the USPS calculation? In which case it will look like one big price, it won't separate the shipping in the cart?

One last idea, would it be easier to just use USPS, keep the Alchemy products at 0 weight so they don't get figured in, and have the cart add a one time $10 "handling fee" if there are one or more Alchemy products?

I think this is the last bit of info I need to fill in the gaps!

25 Jun 2010, 7:53 PM
#18
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #18 by ajeh

Just one shipping module ...

But you can add an additional calculation to the USPS shipping module to add on to the cost of the USPS quotes ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

27 Jun 2010, 7:07 AM
#19
blackorchidcouture avatar

blackorchidcouture

Zen Follower

Join Date:
Apr 2010
Location:
Albuquerque, NM
Posts:
198
Plugin Contributions:
0

Post #19 by blackorchidcouture

Ok, since anytime there will be mixed products in the cart, Alchemy and others, and in case I will be using USPS with Alchemy products set to 0 weight, and the module set to add the additional $10 charge for the Alchemy products, I figured it might work to just use the USPS all the time, and not use the Flat Module ever. Just seems like less to get entangled.

So, in the USPS module I took elements of different things I'm reading and have come up with this:

   // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
      $this->enabled = ((MODULE_SHIPPING_USPS_STATUS == 'True') ? true : false);
    }


$order_total_amount = $_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() ;

global $cart;

   //check if manufacturer alchemy is in cart 
      if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('manufacturers_id','alchemy') > 0)); {
        $drop_ship_extra_charge = $manufacturer_alchemy;
}

// set 223 to your country 2 character country
if ($order->delivery['country']['iso_code_2'] != 'US') {
  if ($drop_ship_extra_charge > 0) {
    $cat_extra_charge = 10;
  }
}
echo 'I see ' . 'An additional $10 shipping fee for Alchemy products will apply to your total.'<br>';

The part $manufacturer_alchemy I completely made up, I'm not sure what to use there.

Am I at all close? Does it need any tweaks? Am I correct that just using the usps module alone should work so long as it charges the $10 fee for Alchemy, and the Alchemy products don't have a set weight to trigger the USPS module?

If I'm way off, please let me know!

Thank you!

27 Jun 2010, 1:35 PM
#20
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #20 by ajeh

Close to the concept ... :smile:

   //check if manufacturer alchemy is in cart 
      if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('manufacturers_id','XX') > 0)); {
        $manufacturer_alchemy = $_SESSION['cart']->in_cart_check('manufacturers_id','XX');
// this goes here or further down to make the calculation
        $drop_ship_extra_charge = $manufacturer_alchemy;
}

you need the XX to be the manufactuers_id for the Alchemy manufacturer ...

Then you can check:

1 are any in the cart

2 if they are in the cart, how many

3 calculate the extra charge

If you want that echo to only show when the $10.00 is added not US shipping then put it inside the IF otherwise it always show ...

Then, add the calculated charge to the cost on the quotes ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!