[Solved] Can you help me to simplify codes OR in PHP


In answer to your question, no, you can’t use OR statements this way.

What you can do is make $quantity conditionally based on the data you’ve got, for example:

$price = !empty($item->unit_price) ? $item->unit_price : $item_kit->unit_price;
$quantity = $fetch_barcode['item_price'] / $price

solved Can you help me to simplify codes OR in PHP