I have an array of cities. Depending on the city chosen by the client, the shipping time will vary. I am trying to do it with the following code:
$city = WC()->customer->get_shipping_city();
if( $city == 'adam' && 'aderet' && 'trom' && 'oranit' && 'shilo'){
echo 'משלוח תוך 5 ימי עסקים';
}elseif( $city == 'reyhan' && 'rimonim' && 'roy' && 'kedar' && 'ktora' ){
echo 'משלוח תוך 3 ימי עסקים';
}else{
echo 'test';
}
But I am not getting the desired result. The comparison works only for the first city. If I choose Adam I see the message: "משלוח תוך 5 ימי עסקים" But when I select any other city from the comparison list, I see "test" message. When I use || instead && then it doesn't matter at all what I choose, only this message is always triggered "משלוח תוך 5 ימי עסקים". Please help me figure out what I'm doing wrong in the code.