malcolm123 Posted February 13, 2018 Share Posted February 13, 2018 Hello, Is there any way by code to not show a payment method (PayPal) when buying a certain product? Something similar to the module "PayPal surcharge extra fee Module" that includes an option that says "Disable PayPal by Categories" and deactivated by ID I attach a photo I would like the same but I do not want to buy the entire module for just this option. I found a code but it is only for the product id and the bank transfer is deactivated. I want it to deactivated Paypal and a whole category public function hookPayment($params) { $products = $this->context->cart->getProducts(); if($products) { foreach ($products as $productos) { if ($productos['id_product'] == 2) { return; } } } if (!$this->active) return; if (!$this->checkCurrency($params['cart'])) return; $this->smarty->assign(array( 'this_path' => $this->_path, 'this_path_bw' => $this->_path, 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/' )); return $this->display(__FILE__, 'payment.tpl'); } Thank you, Regards! Link to comment Share on other sites More sharing options...
bellini13 Posted February 23, 2018 Share Posted February 23, 2018 On 2/13/2018 at 1:22 PM, malcolm123 said: I want it to deactivated Paypal and a whole category What do you mean by "and a whole category"? 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