Forums / General Questions / pickup only for some products

pickup only for some products

Views: 2,669

Results 1 to 20 of 26
3 Nov 2010, 10:40 PM
#1
fredz avatar

fredz

New Zenner

Join Date:
Jan 2007
Posts:
66
Plugin Contributions:
0

pickup only for some products

I am sure this has been asked but I can't find what I am looking for.

I have a store that has products that cannot be shipped (explosives). These products only account for about 5% of the store. Is there a way I can mark these products as pickup only. That would mean that if the customer ordered any other product that can be shipped it would give the store pickup option only.

We also have "call for price" products so I can't use that option as a means to identify them.

Any comments would be most helpful.

Regards

Fred

3 Nov 2010, 11:53 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: pickup only for some products

Are all the Explosive Products in the same Category ... as in using the same master_categories_id ... or within a few specific Categories?

What shipping modules are you using?

You could use the function in_cart_check from the shopping cart class such as:

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

where 27 is the master_categories_id ...

When $chk_explosives > 0, then 1 or more Explosive Products is in the cart ...

Using that, you can control the $this->enabled in the shipping module to turn it on and off ...

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!

4 Nov 2010, 12:11 AM
#3
fredz avatar

fredz

New Zenner

Join Date:
Jan 2007
Posts:
66
Plugin Contributions:
0

Re: pickup only for some products

Well actually there are several categories, but only non-shippable products are contained with them.

We only have 2 shipping modules, Store Pickup and Fastways.

I would like to investigate your suggestion further.

What file/s would I apply your suggested mod to?

Regards

Fred

4 Nov 2010, 1:02 AM
#4
ajeh avatar

ajeh

Oba-san

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

Re: pickup only for some products

You need to customize the Fastways ... but I am not familar with it ...

In most shipping modules, for example, Flat Rate flat in the file:
/includes/modules/flat.php

there is some code like:

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

The $this->enabled is first checked for should it show based on Free Shipping conditions and if it is turned on in the first place ...

Let's say you want the Categories that hold the explosives, where they are in categories_id 10, 13 and 15 ... so the master_categories_id are 10, 13 and 15 ... and don't want the Flat Rate flat shipping module to show ...

That code can be changed with:

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

// bof: disable for categories_id 10, 13 and 15
      if (!IS_ADMIN_FLAG) {
        global $cart;
        $chk_explosives_10 = $_SESSION['cart']->in_cart_check('master_categories_id','10');
        $chk_explosives_13 = $_SESSION['cart']->in_cart_check('master_categories_id','13');
        $chk_explosives_15 = $_SESSION['cart']->in_cart_check('master_categories_id','15');

        $chk_explosives = $chk_explosives_10 + $chk_explosives_13 + $chk_explosives_15;
        if ($chk_explosives > 0) {
          $this->enabled = false;
        }
      }
// eof: disable for categories_id 10, 13 and 15

      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {

Now if 1 or more Products are in the Explosive Categories 10, 13 or 15 then this module will not show ...

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!

4 Nov 2010, 5:43 PM
#5
fredz avatar

fredz

New Zenner

Join Date:
Jan 2007
Posts:
66
Plugin Contributions:
0

Re: pickup only for some products

Wow, how awesome is that. I entered your mod with the appropriated categories defined and it worked exactly as I required.

We have been thinking about how we were going to resolve this issue for several years. Up until now we had simply added a comment to the categories stating that all those products cannot be shipped. But as we all know, there seem to be a growing number of customers that seem to only see what they wanted to see and we were getting a growing number of orders with prohibited items in the order. Surprisingly some customers got grumpy when we said we couldn't ship this or that because it was prohibited.

Thank you so much for your help.

Regards

Fred

4 Nov 2010, 5:47 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: pickup only for some products

You are most welcome ... remember us when you are rich and famous ...

NOTE: you might use something similar to add a note on your shopping cart page based on these Products being in the cart to alert the customer to the limited shipping possiblities, because these explosive products are in the cart ...

That would give them an opportunity to know that by removing those, they can complete the order with shipping, rather than wondering why there isn't a shipping option available on the checkout_shipping other than Store Pickup ...

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!

4 Nov 2010, 10:26 PM
#7
fredz avatar

fredz

New Zenner

Join Date:
Jan 2007
Posts:
66
Plugin Contributions:
0

Re: pickup only for some products

Thanks Linda

I have been pondering this and have thought of a mod that would probably be worth investigating.

When the product is entered there would be the ability to select available shipping methods for the product.

This would mean that the system would scan for installed shipping modules and would give the option of selecting shipping methods from that list.

Not sure how hard that would be to do, or even if it would be practical for anyone else but me, but it was a thought and I figured I would put it out there.

Regards

Fred

4 Nov 2010, 11:48 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: pickup only for some products

And when multiple Products with mixed shipping options are entered into the cart ... then what? :unsure:

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!

5 Nov 2010, 8:11 PM
#9
fredz avatar

fredz

New Zenner

Join Date:
Jan 2007
Posts:
66
Plugin Contributions:
0

Re: pickup only for some products

I use a site in Hong Kong where this happens already, and I am always left with several shipping method selections.

Lets say you have a number of shipping methods (multiple transport/shipping agents). Some agents will ship all items but others will only ship some.

When the shipping methods comes up it will only display those methods that suit "ALL" products in the cart. You may end up with one or two methods. The customer can then have the option of selecting the shipping method they wish.

As a function the shipping module would simply not display any shipping method not applicable to the product/s. A process of elimination leaving only valid options for the entire cart.

Regards

Fred

5 Nov 2010, 11:04 PM
#10
ajeh avatar

ajeh

Oba-san

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

Re: pickup only for some products

While something for this could probably be written ... you might do a Google search on:
Ceon advanced shipper

and see if it has something to help manage this properly ...

That is a commercial shipping package, however it may help you control the shipping methods ... otherwise, you would need to customize the shipping methods to check the cart for a flag or flags on what shipping can be used and control the shipping modules with the results ...

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!

23 Mar 2011, 6:26 AM
#11
jenred avatar

jenred

New Zenner

Join Date:
Jul 2004
Location:
Australia
Posts:
48
Plugin Contributions:
0

Re: pickup only for some products

Ajeh please help! :)

I have been trying to get this to work with no success. I want categories 1 and 67 to be pickup only and all others to be flat rate of $10.00. I have added the code above (customised to my categories) and nothing happens. Flat Rate still shows as an option.

I've also tried the code from here and it didn't work either:
http://www.zen-cart.com/forum/showpost.php?p=1002127&postcount=319

Any help would be appreciated.

thanks

Jen

Red Instead design. print. web. photography.

23 Mar 2011, 1:19 PM
#12
ajeh avatar

ajeh

Oba-san

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

Re: pickup only for some products

What should happen when you have Products from categories_id 1 and 67 and also from categories_id whatever ... in the same order?

Should the Order be Pickup only if 1 or more Products from categories_id 1 and 67 are in the Order? :unsure:

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!

24 Mar 2011, 12:13 AM
#13
jenred avatar

jenred

New Zenner

Join Date:
Jul 2004
Location:
Australia
Posts:
48
Plugin Contributions:
0

Re: pickup only for some products

Thanks Ajeh. The Pick Up Only items are those that are way too big to be shipped (or uneconomical).

If the order has items from both the Pick Up Only categories and from other (normally $10 Flat Rate) categories then the whole order can be Pick Up Only. (The logic is that if they have to come in for one item they might as well collect their whole order by Pick Up from the physical store.)

At the moment I have Pick Up and Flat Rate enabled and people are supposed to choose based on what they have been told but of course you get people who (knowingly or not) choose the $10 postage for huge items and then get upset afterwards. We want it so that if there is an oversized item (from Categories 1 or 67) then the only option that shows is the Store Pick Up.

thanks

Jen

Red Instead design. print. web. photography.

24 Mar 2011, 12:43 AM
#14
ajeh avatar

ajeh

Oba-san

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

Re: pickup only for some products

You should be able to adapt the code in post #4 to disable Flat Rate flat shipping module ...

Check and see what the master_categories_id are for these Products ...

If it is not an entire category but rather specific products_id that are not Categories where all of the Products are oversized, such as products_id 10, 15 and 12 then use:

$chk_products = 0;
$chk_products += $_SESSION['cart']->in_cart_check('products_id','10');
$chk_products += $_SESSION['cart']->in_cart_check('products_id','15');
$chk_products += $_SESSION['cart']->in_cart_check('products_id','12');

and when $chk_products is > 0, you set the $this->enabled to false ...

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!

24 Mar 2011, 2:34 AM
#15
jenred avatar

jenred

New Zenner

Join Date:
Jul 2004
Location:
Australia
Posts:
48
Plugin Contributions:
0

Re: pickup only for some products

I know the code from your Post #4 above should do the trick but I have not been able to get it to work! I'm hoping you can tell me what the problem is... :)

I have added this to my Flat Rate shipping (flat.php)

after this:

      $this->tax_class = MODULE_SHIPPING_FLAT_TAX_CLASS;

      $this->tax_basis = MODULE_SHIPPING_FLAT_TAX_BASIS;

I have this:

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

// bof: disable for categories_id 1 and 67
      if (!IS_ADMIN_FLAG) {
        global $cart;
        $chk_oversized_1 = $_SESSION['cart']->in_cart_check('master_categories_id','1');
        $chk_oversized_67 = $_SESSION['cart']->in_cart_check('master_categories_id','67');

        $chk_oversized = $chk_oversized_1 + $chk_oversized_67;
        if ($chk_oversized> 0) {
          $this->enabled = false;
        }
      }
// eof: disable for categories_id 1 and 67

      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {

and then the next piece of code is this:

 $check_flag = false;

        $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FLAT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");

(Included those to make sure it is in the right place)

Does this look right to you? Any ideas?

thanks

Jen

Red Instead design. print. web. photography.

24 Mar 2011, 2:36 AM
#16
jenred avatar

jenred

New Zenner

Join Date:
Jul 2004
Location:
Australia
Posts:
48
Plugin Contributions:
0

Re: pickup only for some products

The items are all in sub-categories like 1_19 but that shouldn't make a difference should it?

Jen

Red Instead design. print. web. photography.

24 Mar 2011, 3:42 AM
#17
ajeh avatar

ajeh

Oba-san

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

Re: pickup only for some products

A big difference ... if the cPath is 1_19 then the Master Category is probably 19 ...

You need to look at the Products in Category for these Products and determine if ALL Products in Category 19 are Pick Up only ...

Then, change the code to just use the master_categories_id that needs to be tested ...

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!

24 Mar 2011, 4:37 AM
#18
jenred avatar

jenred

New Zenner

Join Date:
Jul 2004
Location:
Australia
Posts:
48
Plugin Contributions:
0

Re: pickup only for some products


The big AH-HA moment!

Thanks so much for your help. I put in the correct numbers and it works perfectly now! :)

Jen

Red Instead design. print. web. photography.

24 Mar 2011, 5:27 AM
#19
jenred avatar

jenred

New Zenner

Join Date:
Jul 2004
Location:
Australia
Posts:
48
Plugin Contributions:
0

Re: pickup only for some products

augh now I am confused! Somehow the sub-category of 1_17 and 1_18 don't want to play but the others do.

I have a category (1) with sub-categories (1_17, 1_18, 1_19, 1_21, 1_68) and a category (67) that are the oversized items, so if any item from one of these categories is chosen then the Flat Rate will not show, just the Pick Up Only.

Can you tell me why 17 and 18 won't play when the others do?

This is my 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);
      }

// bof: disable for categories_id Furniture and Packages
      if (!IS_ADMIN_FLAG) {
        global $cart;
		$chk_oversized_17 = $_SESSION['cart']->in_cart_check('master_categories_id','17');
		$chk_oversized_18 = $_SESSION['cart']->in_cart_check('master_categories_id','18');
 		$chk_oversized_19 = $_SESSION['cart']->in_cart_check('master_categories_id','19');
		$chk_oversized_21 = $_SESSION['cart']->in_cart_check('master_categories_id','21');
		$chk_oversized_67 = $_SESSION['cart']->in_cart_check('master_categories_id','67');
                $chk_oversized_68 = $_SESSION['cart']->in_cart_check('master_categories_id','68');

        $chk_oversized = $chk_oversized_17 + $chk_oversized_18 + $chk_oversized_19 + $chk_oversized_21 + $chk_oversized_67 + $chk_oversized_68;
        if ($chk_oversized > 0) {
          $this->enabled = false;
        }
      }
// eof: disable for categories_id Furniture and Packages

      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {

Again, it all works as it should except for the subcategories of 17 and 18. I can't see how this is possible and would love some help.

thanks

Jen

Red Instead design. print. web. photography.

24 Mar 2011, 2:14 PM
#20
ajeh avatar

ajeh

Oba-san

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

Re: pickup only for some products

Could you edit a Product in categories_id 17 and see what it says its master_categories_id is?

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!