Need some help. I am wondering if COD payment can be applied only to certain user group. Thanks
Need some help. I am wondering if COD payment can be applied only to certain user group. Thanks
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!
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.
Thank youHTML 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; } } }
You could customize the code in the COD Payment module for:
/includes/modules/payment/cod.php
by using:
Just check the group_id for what Group you want this to work for and set it where I have it set to 2 ...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();
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!
It is working perfectly...Thank you for your great help Linda..
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!