a064855 Posted April 23, 2014 Share Posted April 23, 2014 I'm new to prestashop and I need to know if there is a way (via code) by which I can restrict the number of payment gateways available according to customer postcode. For example, let's say that anyone who buys from New York can only pay via PayPal but the rest cities in US can use any payment gateway. I tried this, but it disables modules for everyone not for a particular client: if (strcmp($postcode, "12345")) // postcode I want to restrict { // disabling other payment modules $modules = PaymentModuleCore::getInstalledPaymentModules(); foreach ($modules as $module) { // fetch all installed module names $name = $module['name']; if (strcmp($name, "Paypal") != 0) Module::getInstanceByName($name)->disable(); } } Link to comment Share on other sites More sharing options...
xantarian Posted May 15, 2014 Share Posted May 15, 2014 Is there any module for this? I need this as well. 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