Forums / Built-in Shipping and Payment Modules / Restrict some items to usa only

Restrict some items to usa only

Locked

Views: 1,534

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
24 Mar 2010, 2:07 AM
#1
sham avatar

sham

Zen Follower

Join Date:
Feb 2010
Posts:
159
Plugin Contributions:
0

Restrict some items to usa only

I sell cigar humidors and ship to US and Canada. I would like to add cigars to my site, but due to restrictions would only be able to ship to US. I use UPS for all shipping. So can I set up to sell humidors to both US and Canada and cigars only to US?
Thank you for helping.

24 Mar 2010, 4:01 PM
#2
sham avatar

sham

Zen Follower

Join Date:
Feb 2010
Posts:
159
Plugin Contributions:
0

Re: Restrict some items to usa only

Sorry maybe I should ask this differently. Can I ship products from categories 1-6 to USA and Canada, but ship from category 7 only to USA?

24 Mar 2010, 4:40 PM
#3
ajeh avatar

ajeh

Oba-san

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

Re: Restrict some items to usa only

You would need some customization to test what is in the cart and the shipping address and then decide how you want it handled when someone goes to checkout and changes their shipping address to Canada and has Products from categories_id 7 in the cart ....

This can be done ... but it does take some customization to the code to manage this for the customer so that they do not get confused ...

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 2010, 4:49 PM
#4
sham avatar

sham

Zen Follower

Join Date:
Feb 2010
Posts:
159
Plugin Contributions:
0

Re: Restrict some items to usa only

Thank you for your help. I would state clearly on the cigar (category 7) page that cigars ship to us only!! But I'm sure some will add to cart anyway. Any idea as where to start looking?
add somewhere something like-- if category 7 ship to us only--???
been searching and trying to learn at same time.
Thanks again

24 Mar 2010, 5:04 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: Restrict some items to usa only

The adding to cart will not matter ...

The testing of the cart on the checkout_shipping would prevent the checkout ...

This is where the customized coding comes in ...

This can be tested against the master_categories_id being the test using this function from the shopping_cart class:

  /**
   * Method to calculate the number of items in a cart based on an abitrary property
   *
   * $check_what is the fieldname example: 'products_is_free'
   * $check_value is the value being tested for - default is 1
   * Syntax: $_SESSION['cart']->in_cart_check('product_is_free','1');
   *
   * @param string product field to check
   * @param mixed value to check for
   * @return integer number of items matching restraint
   */
  function in_cart_check($check_what, $check_value='1') {

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 2010, 5:24 PM
#6
sham avatar

sham

Zen Follower

Join Date:
Feb 2010
Posts:
159
Plugin Contributions:
0

Re: Restrict some items to usa only

Thanks again, trying to understand. Cigar category is 37. would test check category_id 37 and country_id CA return 0???
Sorry to be such a novice

24 Mar 2010, 5:46 PM
#7
sham avatar

sham

Zen Follower

Join Date:
Feb 2010
Posts:
159
Plugin Contributions:
0

Re: Restrict some items to usa only

If it makes any difference I use paypal and googlecheckout as only payment options.

24 Mar 2010, 7:28 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Restrict some items to usa only

No ... you need to test for what is in the cart and what the shipping address is ...

This takes some custom code to manage this for you ...

$chk_cat_37 = $_SESSION['cart']->in_cart_check('master_categories_id','37');

will give you the number of products that are from Category with categories_id 37 ...

Then you have to test the shipping address on the order to see if the address is US or somewhere else ...

Then, you have to decide what to do if the shopping cart has products from categories_id 37 and the shipping address is not the US ...

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!