Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default hide payment methods for certain discounts groups?

    I have the Invoice mod installed to display an invoice payment option to customers in the Invoice group. I would like to hide the Paypal and AIM payment options for the customers in that group. I tried adding the code from the invoice module to those other modules and changing it to hide them but I can't figure it out. Can anyone help?

    Thanks!
    Danielle

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How to hide payment methods for certain discounts groups?

    LEt's say you want to disable PayPal express when the customer belongs to customer group 2 ...

    Edit the file:
    /includes/modules/payment/paypalwpp.php

    And add the code in RED:
    Code:
        $this->enabled = (MODULE_PAYMENT_PAYPALWPP_STATUS == 'True');
        
    // bof: disable when when customer group is 2
          if (!IS_ADMIN_FLAG) {
            global $db;
            $group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
            if ($group_query->fields['customers_group_pricing'] == 2) {
              $this->enable = false;
            }
          }
    // eof: disable when when customer group is 2
    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!

  3. #3
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: How to hide payment methods for certain discounts groups?

    Quote Originally Posted by Ajeh View Post
    LEt's say you want to disable PayPal express when the customer belongs to customer group 2 ...

    Edit the file:
    /includes/modules/payment/paypalwpp.php

    And add the code in RED:
    Code:
        $this->enabled = (MODULE_PAYMENT_PAYPALWPP_STATUS == 'True');
        
    // bof: disable when when customer group is 2
          if (!IS_ADMIN_FLAG) {
            global $db;
            $group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
            if ($group_query->fields['customers_group_pricing'] == 2) {
              $this->enabled = false;
            }
          }
    // eof: disable when when customer group is 2
    Thank you for your reply, but that code did not work
    Last edited by Ajeh; 27 Feb 2012 at 07:43 PM. Reason: fixed typo
    Danielle

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How to hide payment methods for certain discounts groups?

    What is the customer group id that you are trying to block from the payment modules?

    Are you using PayPal Express?

    Also, check that the customer you are testing with is in the customer group that you want blocked from PayPal Express ...
    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. #5
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: How to hide payment methods for certain discounts groups?

    The group ID is 1, so I used this code:

    // bof: disable when when customer group is 1
    if (!IS_ADMIN_FLAG) {
    global $db;
    $group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
    if ($group_query->fields['customers_group_pricing'] == 1) {
    $this->enabled = false;
    }
    }
    // eof: disable when when customer group is 1
    I am using Paypal Express and Authorize.net AIM, I tried it in both files but it didn't hide either method.

    The customer is definitely in group 1.
    Last edited by Ajeh; 27 Feb 2012 at 07:43 PM. Reason: fixed typo
    Danielle

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How to hide payment methods for certain discounts groups?

    eeks typo!!

    Change the:
    Code:
              $this->enable = false;
    to read:
    Code:
              $this->enabled = false;
    see if that works better ...
    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!

  7. #7
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: How to hide payment methods for certain discounts groups?

    Perfect, thanks!!!
    Danielle

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How to hide payment methods for certain discounts groups?

    Thanks for the update that this is working for you now ... without that silly little typo ...
    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!

  9. #9
    Join Date
    May 2012
    Location
    Melbourne, Australia
    Posts
    15
    Plugin Contributions
    0

    Default Re: How to hide payment methods for certain discounts groups?

    This is just what I need, but in reverse!

    I want to show 2 payment options at checkout depending on their group. Either "press" for the "press group" or "team" for the "team group". The press & team payment options are renamed "cod & money order" payment options. Ideally (if wishes were raindrops) I'd like 2 new payment options "Press" & "Team" made available.

    When either of the 2 groups login (100% disc) I want them to see the previously hidden options (as well as the paymate/paypal ones available).

    Would it be possible to exclude a product from the discount group? Say, a donation item?
    Team/Press come along, they login they add to the cart their review/staff items - but hey, they want to help with our charity of the month and add the "donation" item to the order. Is it possible to have that excluded from the group?

    v1.5 (reward points; master password; paypal express; paymate; orders 2.0 - selling digital software only)

    Many thanks in advance,

    Karen

 

 

Similar Threads

  1. Replies: 6
    Last Post: 16 Jul 2015, 04:29 AM
  2. Can I restrict certain payment methods for certain products?
    By one tall man in forum Built-in Shipping and Payment Modules
    Replies: 27
    Last Post: 6 Apr 2011, 08:40 PM
  3. Replies: 1
    Last Post: 18 Nov 2010, 11:53 PM
  4. Hide quantity discounts for general customers, show for groups only?
    By swamyg1 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 16 Nov 2009, 09:22 PM
  5. How to disable certain payment methods for certain products?
    By AccurateOptics in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 29 Mar 2007, 06:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg