Advertisement
cahyadsn

total setelah diskon

Sep 18th, 2012
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1.     <?php
  2.     if($cart_result = this->cart->contents()){
  3.       $total_after_discount=0;
  4.       foreach ($cart_result as $item){
  5.          $price = $item['price'];
  6.          @$discount = $item['discount'];
  7.          @$harga_discount = ($price*$discount)/100;
  8.          echo "Harga Per baris Item = ".$harga_discount."<br>\n";
  9.          $total_after_discount+=$harga_discount;
  10.       }
  11.       echo "Harga Total setelah diskon ".$total_after_discount;
  12.     }
  13.     ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement