0

I want to add another option to the following "if" condition, so it checks for four cases instead of three that it checks for now.

The option I want to add is

$chauffeur_data['enable-pos'];

and if check is valid then $pos_check should be '1'.

This is for the second step in the booking process in this page https://gr.transfer4u.eu and i want when the payment option "Pay with Card on POS in the Car" is checked, the booking to complete. Now it does not.

<?php
if ($chauffeur_data['enable-paypal'] == '1') {

    $paypal_check = '1';
    $stripe_check = '0';
    $cash_check = '0';
    $pos_check = '0';
} elseif ($chauffeur_data['enable-paypal'] == '0' && $chauffeur_data['enable-stripe'] == '1') {

    $paypal_check = '0';
    $stripe_check = '1';
    $cash_check = '0';
    $pos_check = '0';
} elseif ($chauffeur_data['enable-stripe'] == '0' && $chauffeur_data['enable-cash'] == '1') {

    $paypal_check = '0';
    $stripe_check = '0';
    $cash_check = '1';
    $pos_check = '0';
} else {

    $paypal_check = '0';
    $stripe_check = '0';
    $cash_check = '0';
    $pos_check = '1';
}

So, the code above is wrong as I don't see the success booking message when I check the "Pay with Card on POS in the Car" and proceed. How should be the correct code?

Ahmed Maruf
  • 481
  • 3
  • 14
ndimos
  • 13
  • 5

1 Answers1

0

Here is your code with slight modification. Hope it will work

<?php
$paypal_check = 0;
$stripe_check = 0;
$cash_check = 0;
$pos_check = 0;
if ($chauffeur_data['enable-paypal'] == 1) {

  $paypal_check = 1;
} elseif ($chauffeur_data['enable-stripe'] == 1) {

  $stripe_check = 1;
} elseif ($chauffeur_data['enable-cash'] == 1) {

  $cash_check = 1;
} elseif ($chauffeur_data['enable-pos'] == 1) {

  $pos_check = 1;
} else {
  $pos_check = 1;
}

If the above code do not work for you, Please add a bit more details of your problem

Ahmed Maruf
  • 481
  • 3
  • 14
  • I used your code but still don't get a succesful booking message. Seems that something is missing and it doesn't take me to the next step. When I check any of the other three payment methods, it completes succesfully, though. I attach the whole php file. Maybe i am missing some information that are needed upon submit for the next step to complete. https://pastebin.com/ui9CYh4G Your code starts at line 256. – ndimos Apr 18 '19 at 18:53