Explorar o código

refactor: ♻️ So stupid function calls...

IceToast %!s(int64=2) %!d(string=hai) anos
pai
achega
dba8e2ebb8
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      app/Http/Controllers/Admin/PaymentController.php

+ 4 - 2
app/Http/Controllers/Admin/PaymentController.php

@@ -54,10 +54,12 @@ class PaymentController extends Controller
             }
         }
 
+        $discount = PartnerDiscount::getDiscount();
+
         return view('store.checkout')->with([
             'product' => $shopProduct,
-            'discountpercent' => PartnerDiscount::getDiscount(),
-            'discountvalue' => PartnerDiscount::getDiscount() * $shopProduct->price / 100,
+            'discountpercent' => $discount,
+            'discountvalue' => $discount * $shopProduct->price / 100,
             'discountedprice' => $shopProduct->getPriceAfterDiscount(),
             'taxvalue' => $shopProduct->getTaxValue(),
             'taxpercent' => $shopProduct->getTaxPercent(),