Zen Cart Logo
Forums / PayPal Express Checkout support / Restrict the use of paypal for certain categories

Restrict the use of paypal for certain categories

Views: 1,742

Results 1 to 7 of 7
9 Jan 2011, 8:57 PM
#1
mentose457 avatar

mentose457

New Zenner

Join Date:
Dec 2010
Posts:
21
Plugin Contributions:
0

Restrict the use of paypal for certain categories

I would like to restrict the use of paypal for certain categories because the things im selling are against paypal policy.

I tried following the steps on on this website but with no luck.

Your help would be much appreciated.

Brent

10 Jan 2011, 5:44 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Restrict the use of paypal for certain categories

Are the Categories that you want to restrict from using PayPal the master_categories_id of the Products that are in them?

Which PayPal are you using?

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!

21 Mar 2011, 2:44 AM
#3
mentose457 avatar

mentose457

New Zenner

Join Date:
Dec 2010
Posts:
21
Plugin Contributions:
0

Re: Restrict the use of paypal for certain categories

Bump... I have the same question. Any help would be great! Thanks!

Brent
rroutdoors.com

21 Mar 2011, 4:56 AM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Restrict the use of paypal for certain categories

You can check the contents from a category if the categories_id is used as the master_categories_id for the Products with this code to turn off the module if 1 or more Products are in the cart from categories_id 10 and 15:

if (!IS_ADMIN_FLAG) {
  global $cart;
  $chk_cat = 0;
  $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','10');
  $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','15');
  if ($chk_cat > 0) {
    $this->enabled = 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!

21 Mar 2011, 5:03 AM
#5
mentose457 avatar

mentose457

New Zenner

Join Date:
Dec 2010
Posts:
21
Plugin Contributions:
0

Re: Restrict the use of paypal for certain categories

Well I got it working. I was editing the wrong file... paypal.php when I needed to edit paypalwpp.php.

21 Mar 2011, 5:05 AM
#6
mentose457 avatar

mentose457

New Zenner

Join Date:
Dec 2010
Posts:
21
Plugin Contributions:
0

Re: Restrict the use of paypal for certain categories

Ajeh:

You can check the contents from a category if the categories_id is used as the master_categories_id for the Products with this code to turn off the module if 1 or more Products are in the cart from categories_id 10 and 15:

if (!IS_ADMIN_FLAG) {
global $cart;
$chk_cat = 0;
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','10');
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','15');
if ($chk_cat > 0) {
$this->enabled = false;
}
}


Thanks for your help. I found [this](http://www.zen-cart.com/forum/showthread.php?t=120145&page=2) thread (which you contributed too) and it helped as well.
21 Mar 2011, 1:13 PM
#7
ajeh avatar

ajeh

Oba-san

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

Re: Restrict the use of paypal for certain categories

Thanks for the update that you have this working now and for posting the other thread that helped you out ... :smile:

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!