Forums / Setting Up Categories, Products, Attributes / Finding way to restrict paypal as payment method for specific item or category?

Finding way to restrict paypal as payment method for specific item or category?

Locked

Views: 4,463

Results 1 to 20 of 21
This thread is locked. New replies are disabled.
8 Dec 2008, 6:45 AM
#1
gisco avatar

gisco

New Zenner

Join Date:
Nov 2008
Posts:
12
Plugin Contributions:
0

Finding way to restrict paypal as payment method for specific item or category?

Hello, all:

DO you have any idea or do you know some module to do this?

[What I want to do]

My shop handles many kind of item, but only one item I cannot accept paypal. (super low profit rate under 3%)

When the customer put that item, I do not want to show paypal as payment method.

If the s/he mixed with another item, then simply offer non-paypal payment option to the all item.

[What I can do]
List that specific item at special category

I checked about "ristrict for payment method", but what I could find seems not suitable for this purpose....

Any idea??

Thank you for your attention in advance.

10 Dec 2008, 6:23 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Finding way to restrict paypal as payment method for specific item or category?

You could add a condition on the $this-enabled on the payment module where you check the contents of the cart to see if this product is in it ...

If the product is in the cart, have $this->enabled evaluate as false and the 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!

14 Dec 2008, 2:39 PM
#3
gisco avatar

gisco

New Zenner

Join Date:
Nov 2008
Posts:
12
Plugin Contributions:
0

Re: Finding way to restrict paypal as payment method for specific item or category?

Thank you for your hints, but it seems too heavy for me......

It need coding....

Ummmmmm,....

14 Dec 2008, 4:33 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Finding way to restrict paypal as payment method for specific item or category?

You should be able to use this in any Payment Module where 12 is the products_id that you want the Payment Module to not show if it is in the cart ...

// turn off the $this->enable to hide this payment method when products_id 12 is in the cart
    global $cart;
    if (IS_ADMIN_FLAG === false && $_SESSION['cart']->in_cart_check('products_id', 12) > 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!

22 Dec 2008, 4:46 AM
#5
gisco avatar

gisco

New Zenner

Join Date:
Nov 2008
Posts:
12
Plugin Contributions:
0

Re: Finding way to restrict paypal as payment method for specific item or category?

Oh, thank you for that code. I try it this holiday and will feedback.

Thank you again!

22 Dec 2008, 7:19 AM
#6
knuckle_101 avatar

knuckle_101

Totally Zenned

Join Date:
Dec 2005
Location:
Cincinnati Ohio
Posts:
1,034
Plugin Contributions:
3

Re: Finding way to restrict paypal as payment method for specific item or category?

Ajeh,

What would you suggest for a certain item product_id that cannot be shipped free but other products can. Been working on a solution for this and tried a reverse on this code for shipping instead of payment but not working. Any ideas would be appreciated.

PCI Certified Web Hosting - ControlScan, Security Metrics (Platinum Partner), McAfee, TrustKeeper
Business Class Web Hosting - Linux and cPanel Powered

22 Dec 2008, 3:46 PM
#7
ajeh avatar

ajeh

Oba-san

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

Re: Finding way to restrict paypal as payment method for specific item or category?

Depends on the Shipping Module and how you are marking the Products for Free and not Free shipping ...

All of the shipping modules with Zen Cart are designed to manage Free Shipping or a combination of Free Shipping and regular shipping when everything is configured correctly ...

You are not supplying enough information on how things are setup for any guess at what you have setup wrong that this is not working for you ... :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!

22 Dec 2008, 4:03 PM
#8
knuckle_101 avatar

knuckle_101

Totally Zenned

Join Date:
Dec 2005
Location:
Cincinnati Ohio
Posts:
1,034
Plugin Contributions:
3

Re: Finding way to restrict paypal as payment method for specific item or category?

Ajeh,

Sorry I should have been more clear about the question I do apologize.

What is being used as shipping is UPS, Store Pickup and Free Shipping Options.

The customer is shipping orders anything over $80.00 for free using the ot_shipping option. However he is selling bags of dogfood that weigh at least 30 to 50 lbs per bag he does not want the bags of dog food to be free with the $80.00 free shipping option if the order goes over $80.00.

We tried to use the tare weight and so forth however none of that worked unless we are missing something.

What we would like is that thosr bags of dog food not to be included with the $80.00 orders if they happen to order the bag of dog food with it.

PCI Certified Web Hosting - ControlScan, Security Metrics (Platinum Partner), McAfee, TrustKeeper
Business Class Web Hosting - Linux and cPanel Powered

22 Dec 2008, 5:13 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: Finding way to restrict paypal as payment method for specific item or category?

Instead why don't you turn off the ot_shipping.php free shipping ...

Change the Free Shipping Options freeoptions to from:

// final check for display of Free Options
      if ($this->ck_freeoptions_total or $this->ck_freeoptions_weight or $this->ck_freeoptions_items) {

to read;

// final check for display of Free Options
      if ($this->ck_freeoptions_total and $this->ck_freeoptions_weight and $this->ck_freeoptions_items) {

And set the paramaters to:
Total >= 80
Weight <= 50 (might need 49.99)

Now this will show as an Option on orders over $80 IF the weight is <= 50 (or 49.99 if you use that)

and this will give the normal UPS charges if they want it faster ...

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!

8 Jan 2009, 4:40 AM
#10
3apples avatar

3apples

New Zenner

Join Date:
Dec 2008
Posts:
14
Plugin Contributions:
0

Re: Finding way to restrict paypal as payment method for specific item or category?

Ajeh:

You should be able to use this in any Payment Module where 12 is the products_id that you want the Payment Module to not show if it is in the cart ...

// turn off the $this->enable to hide this payment method when products_id 12 is in the cart
global $cart;
if (IS_ADMIN_FLAG === false && $_SESSION['cart']->in_cart_check('products_id', 12) > 0) {
$this->enabled = false;
}


Hi, sorry, ZC newbie here. Would you just place this anywhere in the module code? Also, how would you recommend modifying this if you'd like it to exclude a whole category of products (for my example, I don't want people to pay with Paypal for anything in my Downloadable Content category, but it's fine for physical objects being shipped)? Or would you just have to add the products_id of every individual product for this code to work?
8 Jan 2009, 6:15 AM
#11
ajeh avatar

ajeh

Oba-san

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

Re: Finding way to restrict paypal as payment method for specific item or category?

I have not tested this yet ... too sleepy ... :cool:

But find the line:

    if (PROJECT_VERSION_MAJOR != '1' && substr(PROJECT_VERSION_MINOR, 0, 3) != '3.8') $this->enabled = false;

and put it underneath that and see if it works for you ...

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!

8 Jan 2009, 3:29 PM
#12
gisco avatar

gisco

New Zenner

Join Date:
Nov 2008
Posts:
12
Plugin Contributions:
0

Re: Finding way to restrict paypal as payment method for specific item or category?

Ajeh:

You should be able to use this in any Payment Module where 12 is the products_id that you want the Payment Module to not show if it is in the cart ...

// turn off the $this->enable to hide this payment method when products_id 12 is in the cart
global $cart;
if (IS_ADMIN_FLAG === false && $_SESSION['cart']->in_cart_check('products_id', 12) > 0) {
$this->enabled = false;
}


Hello, I tried with paypal IPN module. Just below the hedder part of paypal.php, I inserted that part, but seems not work.

Shall I change different file???

Thank you for your attention.
8 Jan 2009, 3:47 PM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Finding way to restrict paypal as payment method for specific item or category?

I am not for sure where you are saying you placed the code ... but it works for me when placed where I suggested ... below this line:

    if (PROJECT_VERSION_MAJOR != '1' && substr(PROJECT_VERSION_MINOR, 0, 3) != '3.8') $this->enabled = false;

The code should read:

    if (PROJECT_VERSION_MAJOR != '1' && substr(PROJECT_VERSION_MINOR, 0, 3) != '3.8') $this->enabled = false;
// turn off the $this->enable to hide this payment method when products_id 12 is in the cart
    global $cart;
    if (IS_ADMIN_FLAG === false && $_SESSION['cart']->in_cart_check('products_id', 12) > 0) {
      $this->enabled = false;
    }
    // verify table structure
    if (IS_ADMIN_FLAG === true) $this->tableCheckup();

With this code, if products_id 12 is in the cart, then PayPal does not show ... if I remove that product, then it does 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!

10 Jan 2009, 8:53 AM
#14
gisco avatar

gisco

New Zenner

Join Date:
Nov 2008
Posts:
12
Plugin Contributions:
0

Re: Finding way to restrict paypal as payment method for specific item or category?

Ajeh:

I am not for sure where you are saying you placed the code ... but it works for me when placed where I suggested ... below this line:

if (PROJECT_VERSION_MAJOR != '1' && substr(PROJECT_VERSION_MINOR, 0, 3) != '3.8') $this->enabled = false;
> 
> The code should read:
> ```
    if (PROJECT_VERSION_MAJOR != '1' && substr(PROJECT_VERSION_MINOR, 0, 3) != '3.8') $this->enabled = false;
// turn off the $this->enable to hide this payment method when products_id 12 is in the cart
    global $cart;
    if (IS_ADMIN_FLAG === false && $_SESSION['cart']->in_cart_check('products_id', 12) > 0) {
      $this->enabled = false;
    }
    // verify table structure
    if (IS_ADMIN_FLAG === true) $this->tableCheckup();

With this code, if products_id 12 is in the cart, then PayPal does not show ... if I remove that product, then it does show ...

Hello, thank you for the update. I did not recognized your post with insert location.

It goes well.

Thank you.

p.s. For future paypal.php updade, I hope this function will be included by default, also applicable for multi item, because some item is prohibited accept payment via paypal....

30 Jun 2009, 9:28 PM
#15
3apples avatar

3apples

New Zenner

Join Date:
Dec 2008
Posts:
14
Plugin Contributions:
0

Re: Finding way to restrict paypal as payment method for specific item or category?

Is there a way to restrict an entire category instead of just a single item?

30 Jun 2009, 10:16 PM
#16
3apples avatar

3apples

New Zenner

Join Date:
Dec 2008
Posts:
14
Plugin Contributions:
0

Re: Finding way to restrict paypal as payment method for specific item or category?

Nevermind, I found an easy workaround by restricting via products_model instead (just gave all the items I didn't want to allow Paypal a model # and put that into in_cart_check('products_model' instead of in_cart_check('products_id'.

28 Apr 2010, 11:00 PM
#17
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,798
Plugin Contributions:
22

Re: Finding way to restrict paypal as payment method for specific item or category?

I can't seem to get it working with categories. It works great with product_id but when i put master_categories_id instead, it doesn't work. Any ideas?

My site - Pro ZC Help
My portfolio | My plugins

29 Apr 2010, 1:14 AM
#18
ajeh avatar

ajeh

Oba-san

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

Re: Finding way to restrict paypal as payment method for specific item or category?

Check that the products are using the categories_id for their master_categories_id ...

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!

29 Apr 2010, 5:39 AM
#19
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,798
Plugin Contributions:
22

Re: Finding way to restrict paypal as payment method for specific item or category?

Errrrr....

How do i do that? :smile:

My site - Pro ZC Help
My portfolio | My plugins

29 Apr 2010, 11:07 AM
#20
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,798
Plugin Contributions:
22

Re: Finding way to restrict paypal as payment method for specific item or category?

:cry: Oh my god... :frusty:

Sometimes I surprise myself...

I was using the wrong master_categories_id... I used my categories id for products that are in sub-categories... After I changed it to my sub-category ID, everything works great! If only I tried to edit my product earlier to see what master_categories_id it has...

But, this i a good thing to know - setting up something for a category doesn't reflect on it's sub-categories.

Ajeh, thank you very much for your help!

My site - Pro ZC Help
My portfolio | My plugins