Browse Source

Merge branch 'development' into localization

Dennis 3 years ago
parent
commit
d572a603d3
2 changed files with 8 additions and 4 deletions
  1. 4 4
      app/Models/PaypalProduct.php
  2. 4 0
      resources/views/admin/products/index.blade.php

+ 4 - 4
app/Models/PaypalProduct.php

@@ -43,7 +43,7 @@ class PaypalProduct extends Model
     /**
      * @param mixed $value
      * @param string $locale
-     * 
+     *
      * @return float
      */
     public function formatToCurrency($value,$locale = 'en_US')
@@ -70,7 +70,7 @@ class PaypalProduct extends Model
     */
     public function getTaxValue()
     {
-        return $this->price*$this->getTaxPercent()/100;
+        return number_format($this->price*$this->getTaxPercent()/100,2);
     }
 
     /**
@@ -78,8 +78,8 @@ class PaypalProduct extends Model
     *
     * @return float
     */
-    public function getTotalPrice() 
+    public function getTotalPrice()
     {
-        return $this->price+($this->getTaxValue());
+        return number_format($this->price+$this->getTaxValue(),2);
     }
 }

+ 4 - 0
resources/views/admin/products/index.blade.php

@@ -28,6 +28,7 @@
 
                 <div class="card-header">
                     <div class="d-flex justify-content-between">
+
                         <h5 class="card-title"><i class="fas fa-sliders-h mr-2"></i>{{__('Products')}}</h5>
                         <a href="{{route('admin.products.create')}}" class="btn btn-sm btn-primary"><i
                                 class="fas fa-plus mr-1"></i>{{__('Create new')}}</a>
@@ -39,6 +40,7 @@
                     <table id="datatable" class="table table-striped">
                         <thead>
                         <tr>
+
                             <th>{{__('Active')}}</th>
                             <th>{{__('Name')}}</th>
                             <th>{{__('Price')}}</th>
@@ -52,6 +54,7 @@
                             <th>{{__('Eggs')}}</th>
                             <th>{{__('Servers')}}</th>
                             <th>{{__('Created at')}}</th>
+
                             <th></th>
                         </tr>
                         </thead>
@@ -77,6 +80,7 @@
                 language: {
                     url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{config("app.datatable_locale")}}.json'
                 },
+
                 processing: true,
                 serverSide: true,
                 stateSave: true,