Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2009
    Posts
    25
    Plugin Contributions
    0

    Default COD only apply to certain user group

    Need some help. I am wondering if COD payment can be applied only to certain user group. Thanks

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

    Default Re: COD only apply to certain user group

    You could customize the payment module and change the:
    $this->enabled

    to false when the customer is not in the right Group ...
    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
    Aug 2009
    Posts
    25
    Plugin Contributions
    0

    Default Re: COD only apply to certain user group

    Thanks Linda for quick reply.

    Could you give some example code. I am not so sure how to do.

    Here is the code I see on cod payment module.
    HTML Code:
            if ($check_flag == false) {
              $this->enabled = false;
            }
          }
    
    // disable the module if the order only contains virtual products
          if ($this->enabled == true) {
            if ($order->content_type != 'physical') {
              $this->enabled = false;
            }
          }
        }
    Thank you

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

    Default Re: COD only apply to certain user group

    You could customize the code in the COD Payment module for:
    /includes/modules/payment/cod.php

    by using:
    Code:
          if ((int)MODULE_PAYMENT_COD_ORDER_STATUS_ID > 0) {
            $this->order_status = MODULE_PAYMENT_COD_ORDER_STATUS_ID;
          }
    
    // bof: only show for group_id = 2
          global $db;
          $chk_group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
          if ($chk_group_query->fields['customers_group_pricing'] != 2) {
            $this->enabled = false;
          }
    // eof: only show for group_id = 2
    
          if (is_object($order)) $this->update_status();
    Just check the group_id for what Group you want this to work for and set it where I have it set to 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!

  5. #5
    Join Date
    Aug 2009
    Posts
    25
    Plugin Contributions
    0

    Default Re: COD only apply to certain user group

    It is working perfectly...Thank you for your great help Linda..

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

    Default Re: COD only apply to certain user group

    You are most welcome ... thanks for the update that this customizaiton of the COD Payment module to only show for one Customer Group using the Group Pricing was able to work 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!

 

 

Similar Threads

  1. How can I create a coupon to apply to only a certain catagory of products?
    By mistymurata in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 19 Jul 2010, 12:28 AM
  2. Store pick up for certain customer or group only
    By Kayz in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 16 Mar 2010, 10:38 AM
  3. Can I apply discount on certain attributes only?
    By Decostyle in forum Setting Up Specials and SaleMaker
    Replies: 21
    Last Post: 10 Dec 2008, 08:41 PM
  4. Taxes only apply to orders over a certain amount??
    By apemusic in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 7
    Last Post: 30 Jan 2008, 11:41 PM
  5. COD only above certain order amount?
    By ronwong in forum Built-in Shipping and Payment Modules
    Replies: 51
    Last Post: 13 Aug 2007, 05:29 AM

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