Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories
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: 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).....
PHP Code:
// 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!
Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories
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
Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories
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.....
Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories
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 ...
Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories
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!
Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories
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 ...
Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories
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!
Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories
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 ...
Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories
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:
PHP Code:
// 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!
Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories
Close to the concept ... :smile:
Code:
//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 ...