Jump to content

How can I disable a payment module?


Recommended Posts

Hello!

On my prestashop store I have two carriers - courrier and regular mail.

I have 3 payment opitons: By bank wire, Pay on Delivery, Credit card

Surface mail is best for small packagkes, but they DO NOT offer Pay on Delivery service.

SO, the question is - how can I disable the Pay on Delivery payment option when buyer selects surface mail as delivery option?

 

Thank you in advance!

Link to comment
Share on other sites

unfortunately i don't know any easy solutions for this. But of course - solution exists,

 

you can edit tpl file of Pay on Delivery module, where you can add simple {if} statement which will hide pay on delivery when surface mail was chcecked as an delivery type.

 

{if !id_delivery_type=id_surface_mail}

code here

{/if}

Link to comment
Share on other sites

unfortunately i don't know any easy solutions for this. But of course - solution exists,

 

you can edit tpl file of Pay on Delivery module, where you can add simple {if} statement which will hide pay on delivery when surface mail was chcecked as an delivery type.

 

{if !id_delivery_type=id_surface_mail}

code here

{/if}

Thank you, vekia

Where can I see the ID of the surface mail module?

I noticed that payment options can be defined for different groups. Maybe I can assign a group to surface mail, how does it work?

Edited by newage (see edit history)
Link to comment
Share on other sites

I did not do it exactly as mentioned in the thread. In fact initially it did not work.

This is exactly what I did:

 

In the cashondelivery.php file, under

public function hookPayment($params)
{
 if (!$this->active)
  return ;
 global $smarty;

I added:

$cartski = $params['cart'];
$carrierski = intval($cartski->id_carrier);
if ($carrierski==20) return;

where 20 is the carrier ID that does not support Cash On Delivery. And it works!

Edited by newage (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...