Jump to content

Carrier selection while placing an order.


Recommended Posts

Hello,

 

Prestashop Version: 1.4.7.3

 

I have 2 different carriers setup in my shop.

Carrier A

Carrier B

 

I also have 2 payment methods setup.

Cash on Delivery

Bank Wire

 

Is there anyway I can add a condition so customers can ONLY select Carrier A if they select Cash on Delivery and Carrier B if they select Bank wire payment method?

 

 

Thanks in Advance!

  • Like 1
Link to comment
Share on other sites

Hi,

 

You will need change function hookPayment on some payment modules:

 

 

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

 $cart = new Cart($params['cookie']->id_cart);
 if($cart->id_carrier == 6){ // ID carrier
  return false;
 }
......

 

This code excludes payment method for carrier with ID = 6

 

Regards

  • Like 1
Link to comment
Share on other sites

Hi, You will need change function hookPayment on some payment modules:
 public function hookPayment($params) { if (!$this->active) return ; global $smarty; $cart = new Cart($params['cookie']->id_cart); if($cart->id_carrier == 6){ // ID carrier return false; } ...... 

This code excludes payment method for carrier with ID = 6 Regards

 

Thank you very much Alexander Simonchik.

It works like a charm!

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...