Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / In-store pickup only for some item

In-store pickup only for some item

Locked

Views: 11,425

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
10 Jun 2006, 8:16 PM
#1
pglatz avatar

pglatz

New Zenner

Join Date:
Aug 2004
Posts:
17
Plugin Contributions:
0

In-store pickup only for some item

I'm setting up a store for a specialty food merchant. He can't ship wine; can products of one particular type be set to in-store pickup only? If not, can this be done on a per-product basis?

10 Jun 2006, 8:41 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: In-store pickup only for some item

You can make an override on the shipping based on a given condition ...

For example, if you used a products_type 1 (Products General) for all products but products_type 4 (Document Product) for wine ...

You have a "built-in" flag of products_type to separte the 2 kinds of products which would tell you if:

wine only
other stuff only
wine and other stuff mixed

This can be checked with the shopping_cart class function in_cart_check ...

Then you can manage all shipping modules by controlling the:

$this->enabled

of each module based on a function that tests the cart to see what is really in the cart and when to override the normal enable of each Shipping Module ...

If you think this through ... it is not a difficult override to make, just a bit time consuming to write to get in all the code ...

10 Jun 2006, 8:42 PM
#3
ajeh avatar

ajeh

Oba-san

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

Re: In-store pickup only for some item

NOTE: you do not have to use the products_type field to test this ...

You can add a new field, however, then you need additional coding for the Admin to manage the products table and the new setting ...

11 Jun 2006, 1:18 AM
#4
pglatz avatar

pglatz

New Zenner

Join Date:
Aug 2004
Posts:
17
Plugin Contributions:
0

Re: In-store pickup only for some item

Thanks for the info, this is very hlepful. A few basic questions...
How do apply the product type? Can it be applied to an entire category, being added to new products by default? Or do I apply it to each product? I didn't see a place in the product or category entry to do this - is this an attribute that needs to be set up?

Ajeh:

Then you can manage all shipping modules by controlling the:

$this->enabled

of each module based on a function that tests the cart to see what is really in the cart and when to override the normal enable of each Shipping Module ...

If you think this through ... it is not a difficult override to make, just a bit time consuming to write to get in all the code ...

Do I have to modify the shipping modules if I use the existing product type 4? Is there something I have to tell the product type about shipping?

thanks again for your help, Phil

11 Jun 2006, 1:33 AM
#5
ajeh avatar

ajeh

Oba-san

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

Re: In-store pickup only for some item

Product Types are set while adding Products or Categories via the dropdown, just before you hit: New Product or New Category ...

The products_type = 4 is a handy one to use as it matches everything about the regular Products except it is using the document_products gang of files in the Catalog and Admin to manage these products ...

You could clone the document_products ... and I pick this one just because the variables and constants for it would be easy to follow ... and make a products_type such as products_wine or something similar ...

You'd then use this products_type which, more than likely, would become products_type 6 as your "flag" for wine and be able to control that product_type ...

Or, you can add on the products table a new field ... such as products_is_wine ... and follow one of the similar fields in the /admin to customize the code to allow for this new field ...

This can then be used for your test of what's in the cart ...

The "test" is running the function in_cart_check to see if there is one or more "wine" products in the cart ... if so, you can then customize the shipping modules to act according to the rules you need ... such as only show if no wine is in the cart, unless it is the Store Pickup ...

The Shipping modules each have a setting similar to this, taken from the item.php Shipping Module:

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

This is testing the cart for if the shipping should be free based on the function zen_get_shipping_enabled ...

What that does is test for various conditions for when shipping should be Free and only show the Free Shipping (freeshipper) Shipping Module and turn off or hide the other Shipping Modules ... even though you have them installed in the Admin ...

At the same time, if Shipping is not Free ... then it turns off or hides the Free Shipping (freeshipper) Shipping Module based on the opposit conditions so it will not show when the other Shipping Modules show ...

11 Jun 2006, 9:54 PM
#6
pglatz avatar

pglatz

New Zenner

Join Date:
Aug 2004
Posts:
17
Plugin Contributions:
0

Re: In-store pickup only for some item

I'm still not quite getting this... are there detailed docs somewhere I'm missing? The wiki didn't explain how everything fits together. Maybe I can contribute something when I get this straight

First of all, I see where I can set a product type when I create a new product, but not when I create a new category (it would be useful to have all products of a certain category have a default type). I can't find a way to change the product type or add ont to a product once the product is created.

If I write a custom product type, or adapt an existing one, where does the code go? I grepped through the files for 'document_product' and didn't see a file that contained any logic I would expect to see.

The only flag with the product types is "allow add to cart" - I disabled it, and am still able to add products to the cart. How do I tell it the item is not shippable?

What I'm trying to do is tag certain products as available for instore pickup only. If a customer ordered a mix of products, some in-store and others not, is there a way to indicate at checkout that only part of the order could be shipped? Since they are coming in anyway, it might be better just to make the whole order unshippable. Could this be done some other way than product types, such as some sort of attribute?

Sorry to sound so dense on all this - I've used Zen Cart on other projects and like it a lot. I hope I'm not trying to push the envelope here.