New Zenner
- Join Date:
- Aug 2009
- Posts:
- 25
- Plugin Contributions:
- 0
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
Views: 1,600
New Zenner
Need some help. I am wondering if COD payment can be applied only to certain user group. Thanks
Oba-san
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 ...
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!
New Zenner
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.
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
Oba-san
You could customize the code in the COD Payment module for:
/includes/modules/payment/cod.php
by using:
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 ...
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!
New Zenner
It is working perfectly...Thank you for your great help Linda..
Oba-san
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 ... :smile:
Linda McGrath
If you have to think ... you haven't been zenned ...
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!
Tell staff why this post should be reviewed.