Wazzu Posted December 29, 2010 Share Posted December 29, 2010 Hi all.How can I make my payment module displays only when the order is greater than X?I'm developing this module, there's no problem abou coding, but I don't know if this is possible.Thanks! Link to comment Share on other sites More sharing options...
rocky Posted December 29, 2010 Share Posted December 29, 2010 See here. Link to comment Share on other sites More sharing options...
Wazzu Posted December 29, 2010 Author Share Posted December 29, 2010 Inside hookPayment function, of course!Thanks very much! Link to comment Share on other sites More sharing options...
rocky Posted December 29, 2010 Share Posted December 29, 2010 Please edit your first post and add [sOLVED] to the front of the title. Link to comment Share on other sites More sharing options...
Wazzu Posted December 29, 2010 Author Share Posted December 29, 2010 I can even show a different template to display a disabled payment method, so customers know it exists :-) function hookPayment($params) { global $smarty; $smarty->assign(array( 'this_path' => $this->_path, 'this_path_ssl' => Configuration::get('PS_FO_PROTOCOL').$_SERVER['HTTP_HOST'].__PS_BASE_URI__."modules/{$this->name}/")); // Checks the minimum total of the order if ($params['cart']->getOrderTotal() < 1000) { return $this->display(__FILE__, 'payment_disabled.tpl'); } else { return $this->display(__FILE__, 'payment.tpl'); } } 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