Search
 
SCRIPT & CODE EXAMPLE
 

PHP

tackle discount in php laravel blade

 @if($invoice->promo != null)
   <div class="d-flex keep-print-font">
   <p class="text-left h4 fw-700 keep-print-font mr-4">
   Promo Discount
   </p>
   <p class="text-left h4 fw-700 keep-print-font">
 {{ number_format($invoice->promo->amount,3) }} KD
   @if($invoice->promo->type == "percentage")
   @php
   $discount_amount += ($sub_total+$sum_addon)/100*$invoice->promo->amount;
@endphp
  @else
  @php
  $discount_amount += $invoice->promo->amount ;
@endphp
  @endif
  </p>
  </div>
  @else
  <div class="d-flex keep-print-font">
  <p class="text-left h4 fw-700 keep-print-font mr-4">
  Discount
  </p>
  <p class="text-left h4 fw-700 keep-print-font">
{{ number_format($discount_amount,3) }} KD
{{-- {{ number_format($sum_addon,3) ?? '' }} KD --}}
</p>
  </div>
  @endif
Comment

PREVIOUS NEXT
Code Example
Php :: phpunit stop on failure 
Php :: carbon finer 
Php :: make controller laravel 8 with resource 
Php :: php check if variable is string 
Php :: grouping routes in laravel 
Php :: php array to csv 
Php :: Allowed memory size of 1610612736 bytes exhausted 
Php :: laravel where condition on relationship 
Php :: datetime iso 8601 php 
Php :: sha256 php 
Php :: php quit 
Php :: how to run a specific migration in laravel 
Php :: laravel timestamps on pivot table 
Php :: laravel 8 check if null or empty 
Php :: php capitalize each word 
Php :: how to add title to wordpress php 
Php :: why laravel site loading only 
Php :: rename migration in laravel 
Php :: php mysql if exists 
Php :: implode with br in php 
Php :: laravel blade skip entry 
Php :: wordpress get field 
Php :: php superglobal 
Php :: read file data using php 
Php :: get table name from model laravel 
Php :: laravel login redirect to previous page 
Php :: get_transient wordpress 
Php :: wordpress check if page is password protected 
Php :: laravel sort by numbers 
Php :: laravel order by relationship 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =