Ver Fonte

Remove unneeded function

Ferks-FK há 1 ano atrás
pai
commit
22413c3b30
1 ficheiros alterados com 0 adições e 21 exclusões
  1. 0 21
      app/Traits/Coupon.php

+ 0 - 21
app/Traits/Coupon.php

@@ -95,27 +95,6 @@ trait Coupon
         return true;
     }
 
-    public function calcDiscount($productPrice, stdClass $data)
-    {
-
-        if ($data->isValid) {
-            if ($data->couponType === 'percentage') {
-                return $productPrice - ($productPrice * $data->couponValue / 100);
-            }
-
-            if ($data->couponType === 'amount') {
-                // There is no discount if the value of the coupon is greater than or equal to the value of the product.
-                if ($data->couponValue >= $productPrice) {
-                    return $productPrice;
-                }
-            }
-
-            return $productPrice - $data->couponValue;
-        }
-
-        return $productPrice;
-    }
-
     public function applyCoupon(string $couponCode, float $price)
     {
         $coupon = CouponModel::where('code', $couponCode)->first();