FareedR
2 months ago

Calculation on data array

Posted 2 months ago by FareedR

How can I calculate total amount ?

$service_fee = 4
// deals
id | price | qty | 
1      100       1
2      100       1

        foreach($deals as $deal){
            $subTotal           = $deal->price*$deal->qty;
            $serviceCharge      = (100-$service_fee)/100;
            $seller_total_earn  = $subTotal*$serviceCharge;
        }

Please sign in or create an account to participate in this conversation.