New Zenner
- Join Date:
- Nov 2007
- Posts:
- 54
- Plugin Contributions:
- 0
Different shipping methods for different categories
Ok that worked fine
Thanks for the help again
Started by tylerd213 on 13 Mar 2008, 2:16 AM · Views: 107,884
New Zenner
Ok that worked fine
Thanks for the help again
Oba-san
You are most welcome ... thanks for the update that this worked for you ... :smile:
Linda McGrath
If you have to think ... you haven't been zenned ...
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!
New Zenner
Ok
I have run into a few obstacles. I run a drop shipping business. But some of my manyfacturer;s will not ship internationally. SO the products have to be sent to me first. And with most products the profit margin is big enough and the products are small enough that I am fine with eating the extra shipping. But on large oversized items, this is not working.
So what I want to do is in my shipping modules instead of using category I want to use the product id.
So Using the same method as Ajeh mentioned a few posts up, what do I change master_category_id to so I can input the product id number instead?
And can I mix the
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','10');
statements with both master_categories_id and product id
Oba-san
You can count your products in any manner that works for you ...
If not all can be done by master_categories_id then you can count them by individual products_id to get the total in the cart ...
Linda McGrath
If you have to think ... you haven't been zenned ...
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!
New Zenner
I asked this on another thread, so I hope I am not over posting, but this is very close to what I need to do. If I could just turn OFF flat rate shipping for one category, I could do what I need
New Zenner
Ajeh
I don't know what I did. but I believe it is not possible to use master_categories_id and products_id in the same if statement
When I do I get this
select master_categories__id as check_it from products where products_id
on my shopping cart page instead of the shipping estimator
regardless of what products are in the cart.
New Zenner
I just tried to make 2 separate if statements in the same module and that causes the same problem. So within a module you have to either do it by products_id or master_categories_id at least using the code we have on this thread.
New Zenner
Well I have it working now using two separate modules.
But another problem in my business just arose and I realized that this code will work for it
If you are a drop shipper like me you can create multiple clones of your shipping module and change the code for the zip code to a specific zip code.
So if you have some products coming from Florida you can make a shipping module that only activates for those products_id or master_categories_id and change this
SHIPPING_ORIGIN_ZIP
to the actual zip code of your warehouse in Florida.
You just have to make sure that the other modules do not activate for those products.
This code is extremely useful.
Unfortunately with all the products and suppliers I have etc I am going to wind up with 50 shipping modules.
Zen Follower
Pardon me if this is not the right thread, but this is the only I found that more or less provides the info I need, not quite though.
This is my predicament:
I use the USPS shipping module exclusively as we only ship via USPS. We only offer Express and Priority for domestic and international for 99% of our products (unregulated category), but 1 category of products have to be shipped separately via Parcel and can only be shipped within the US. So this means, if client buys products from unregulated category and products from regulated category 2 customer is charged with 2 quotes, as we would have to ship 2 different packages.
I've tried doing the first change for the item.php found at the beginning of the page, but I'm afraid it doesn't solve this since customer can only pick one or the other shipping method. I need customer to have Parcel mandatory if purchasing items from regulated category, and then be able to select any other shipping method but the unregulated categories. Does this make sense?
Thank you in advance for any help.
M.Valenti
Contemporary Artist - Entrepreneur
http://www.manuelavalenti.com - http://www.byvalenti.com
Zen Follower
I couldn't figure out the solution to my question, so I found another approach which seems to work, so I'm sharing it below.
My dilemma is I can't ship perfumes via airmail, only parcel post. Additionally they can't ship international only within the continental US. So I needed to stop showing Priority and Express mail instead only show Parcel Post.
This was my solution for the USPS module to show only parcel post when certain products in cart.
global $cart;
if (IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_id','114','116') > 0) {
$this->enabled = true;
$this->types = array('PARCEL' => 'Parcel Post');
} else {
$this->types = array('EXPRESS' => 'Express Mail',
'FIRST CLASS' => 'First-Class Mail',
'PRIORITY' => 'Priority Mail',
'PARCEL' => 'Parcel Post',
'MEDIA' => 'Media Mail',
'BPM' => 'Bound Printed Matter',
'LIBRARY' => 'Library'
);
}
To stop showing all international shipping options if alcohol products present in the shopping cart changed to this
global $cart;
if (IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_id','114','116') > 0) {
$this->enabled = false;
}
$this->intl_types = array(
I tested it and it works. Hope this is useful to someone else. :smile:
M.Valenti
Contemporary Artist - Entrepreneur
http://www.manuelavalenti.com - http://www.byvalenti.com
Zen Follower
I would like to have master cat 62 & 76 set to flat rate of $3.00 and the rest set to a flat rate of $8.00.
I have cloned the flat rate BUT I am lost on how to implement it into my zen cart.
Right now I just have a flat rate of $8.00.
Please help:lookaroun
Oba-san
You can customize the Flat Rate shipping module that should not work for categories_id 62 and 76 with:
// bof: disable for these master_categories_id
if (IS_ADMIN_FLAG == false) {
// check master_categories_id add one line per master_categories_id
$chk_cat = 0;
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','62');
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','76');
if ($chk_cat > 0) {
$this->enabled = false;
}
}
// eof: disable for these master_categories_id
Then for the one that should run for categories_id 62 and 76 with:
// bof: disable for these master_categories_id
if (IS_ADMIN_FLAG == false) {
// check master_categories_id add one line per master_categories_id
$chk_cat = 0;
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','62');
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','76');
if ($chk_cat < 1) {
$this->enabled = false;
}
}
// eof: disable for these master_categories_id
What happens when you have Products from Categories 62, 76 and 48? :unsure:
Linda McGrath
If you have to think ... you haven't been zenned ...
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!
Zen Follower
Hi, Ms. A and thanks for the reply.
Here is what I am trying to do and this is what I have gathered here from searching on the forum.
My objective is to have two different flat rates.
One flat rate being $8.00 and the other flat rate being $3.00.
Master Cat 62 & 76 I would like to be $3.00. All others $8.00.
Here is what I have done so far.
I cloned flat.php and added these files to the below referenced directories. Every time I tried to add some code my whole shipping module is admin disappears.
/includes/modules/shipping/flat3.php
/includes/languages/english/modules/shipping/flat3.php
Then I tried adding code to flat.php but not sure which file directory? Or both?
/includes/modules/shipping/flat.php
/includes/languages/english/modules/shipping/flat.php
I need to tell flat.php not include Mast Cat 62 & 76. And I need to tell flat3.php only to include Mast Cat 62 & 76.
I am not sure which code to add to flat.php and which code to add to flat3.php.
And lastly...I have not tried to resolved "what if" they buy from both categories...
I need a little help from Ms. A if possible on coding.
Thank you for your time.:smile:
Oba-san
If you read my post ...
The first set of code is to NOT show if Products from 62 or 76 are in the cart ...
The second set of code is to NOT show if Products from 62 or 76 are NOT in the cart ...
So this means that the first piece of code would show that shipping module on a cart that has Products from 62 or 76 -- or -- either of those two categories and any other category at the same time ...
The code always go into the files in the code directory for:
/includes/modules/shipping
The language defines go in the:
/includes/languages/english/modules/shipping
You add the code right after the existing code for:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
}
Linda McGrath
If you have to think ... you haven't been zenned ...
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!
Zen Follower
Hi thanks so much for your help. I have done what you said.
Both flat rates are showing up in the cart.
I will attached both files.
Can you take a moment to let me know what I have done wrong.
Thanks again for your help
Zen Follower
Zen Follower
Oba-san
You stuck the new code in the bottom of the files where it does nothing ... :eek:
Place it under the 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);
}
and in the clone code under the code:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_FLATCLONE_STATUS == 'True') ? true : false);
}
Linda McGrath
If you have to think ... you haven't been zenned ...
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!
Zen Follower
You are amazing and after I went through learning how to do this...it was not that painful. I just did not know where to add the code. And I tried a zillion times over.
Do you mind if I add it to the free downloads?
And trust me...I will donate. I feel confident I will get some sales now because I think my shipping was too high.
Thanks again.
Oba-san
I don't know that it is worth being an add on as there are so many different methods and a zillion are already posted on the Free Forums ...
Glad you have this working now ... :smile:
Linda McGrath
If you have to think ... you haven't been zenned ...
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!
Tell staff why this post should be reviewed.