maxxer Posted October 30, 2010 Share Posted October 30, 2010 Hi.I'd like to enable a payment method only to trusted customers, that could be someone who already completed two orders.Is it possible to do?thanksmaxxer Link to comment Share on other sites More sharing options...
olea Posted October 30, 2010 Share Posted October 30, 2010 In BO, in the payment tab, you can restrict payment method to groups.you then have to place your customer in appropriated group Link to comment Share on other sites More sharing options...
rocky Posted October 30, 2010 Share Posted October 30, 2010 Go to the Payment tab and use the "Group restrictions" section to choose which groups can access which payments. Link to comment Share on other sites More sharing options...
maxxer Posted October 30, 2010 Author Share Posted October 30, 2010 great, thanks!can I have the condition above, that is if a user completes the second order it is automatically added to a specific group?thanks Link to comment Share on other sites More sharing options...
rocky Posted October 31, 2010 Share Posted October 31, 2010 It's not possible to do that without modifying code. Try changing lines 294 of classes/PaymentModules.php from: Hook::newOrder($cart, $order, $customer, $currency, $orderStatus); to: $result = Db::getInstance()->execute('SELECT COUNT(*) as `num_orders` FROM `'._DB_PREFIX_.'order` WHERE `id_customer` = '.$customer->id); if (is_array($result) AND sizeof($result) > 0 AND $result[0]['num_orders'] == 2) { Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'customer_group` (`id_customer`, `id_group`) VALUES ('.$customer->id.', 3)'); Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'customer` SET `id_default_group` = 3); } Hook::newOrder($cart, $order, $customer, $currency, $orderStatus); Change 3 to the ID of the group you want the customer to be changed to on the second order. Link to comment Share on other sites More sharing options...
SteveW1805 Posted April 12, 2011 Share Posted April 12, 2011 Go to the Payment tab and use the "Group restrictions" section to choose which groups can access which payments. Thank you. That helped me too. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now