Different shipping methods for different categories
Hi, I have been searching around a lot and cant seem to find the answer to my question.. I have two categories of which i need to assign different shipping methods for each (Products in 1st category can be shipped with any shipping method but products in category 2 can only be picked up in store, so a forced in store pickup)
How would i go about doing this?? I read stuff about Mixed Carts, but am unsure what that is.
Thanks,
Tyler
Re: Different shipping methods for different categories
Anybody have any ideas??
Thanks!
Tyler
Re: Different shipping methods for different categories
You could customize the shipping modules that when a given master_categories_id is in the shopping cart then only Store Pickup storepickup can run ...
Otherwise, when nothing from that master_categories_id is in the cart then all other Shipping modules run ...
You should also consider whether you want Store Pickup storepickup to always show as an option ...
Re: Different shipping methods for different categories
Ok, this is basically what i want to do. Unfortunately i have no idea where to begin (Im new with PHP).
But to give you some more information, i only have one other shipping option in my cart (2 total with storepickup) which is Per Item. So what i would want to do is in the Per Item shipping module include code somewhere that states if the master_categories_id is 17 (the one i want storepickup on) then disable this shipping module.
Store pickup can be shown on all other products, it just has to be the only forced option in this one category :) :smile:
Thanks for your help thus far, its so much appreciated!!
Re: Different shipping methods for different categories
Let's say you want the Per Item item shipping module to turn off or hide when 1 or more products from categories_id 17 is in the shopping cart ...
Edit the shipping module:
/includes/modules/shipping/item.php
PHP Code:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
if ($_SESSION['cart']->in_cart_check('master_categories_id','17') > 0) {
$this->enabled = ((MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
}
}
This will cause the $this->enabled to evaluate as false and not show the Per Item item shipping module ...
Re: Different shipping methods for different categories
We are close!! Thanks so much! But a couple issues:
It seems to work backwards, it enables per item shipping for the category 17 but disables it for the rest of the categories.
second in the admin panel when i click on shipping modules it states:
Fatal error: Call to a member function on a non-object in /home/content/W/o/l/Wolves17/html/cart/includes/modules/shipping/item.php on line 28
Thanks so much for your help so far! I will be donating :smile:
Re: Different shipping methods for different categories
Silly silly me ... such the dyslexic am I ... :blink:
You want this OFF when categories_id is in the shopping cart ...
Based on the assumption that these products use the master_categories_id 17, you need that to be > 0 so that it sets Per Item item shipping module to a false $this->enabled ...
I was sorta losing my mind at the time ... t'wasn't nothin' ... :lamo:
Re: Different shipping methods for different categories
Let me find the secret code for the admin conflict on the cart ... kinda forgot about that one ... :smartalec:
Re: Different shipping methods for different categories
This would work better and not make the Admin have a fit:
PHP Code:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
}
// disable for one master_categories_id
if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','17') > 0)) {
$this->enabled = false;
}
Re: Different shipping methods for different categories
Wow, you are awesome! Thank you so much! It works great :)