commit before consolodating payment methods

This commit is contained in:
twotalesanimation
2025-12-30 10:40:45 +02:00
parent 3c24c0e9ef
commit a898c35a39
23 changed files with 673 additions and 2184 deletions
+45
View File
@@ -0,0 +1,45 @@
<?php
namespace App\Services;
use App\Models\AppSetting;
class ShippingService
{
/**
* Calculate shipping fee based on order subtotal
*/
public static function calculateShippingFee(float $subtotal): float
{
$freeShippingThreshold = AppSetting::get('free_shipping_threshold', 2000);
if ($subtotal >= $freeShippingThreshold) {
return 0;
}
$localShipping = AppSetting::get('local_shipping', 200);
return $localShipping;
}
/**
* Get shipping label based on order subtotal
*/
public static function getShippingLabel(float $subtotal): string
{
$freeShippingThreshold = AppSetting::get('free_shipping_threshold', 2000);
if ($subtotal >= $freeShippingThreshold) {
return 'Free Shipping';
}
return 'Local Delivery';
}
/**
* Get sample cost
*/
public static function getSampleCost(): float
{
return AppSetting::get('sample_cost', 80);
}
}