This commit is contained in:
2025-09-25 03:03:31 +05:00
commit ae480cf2f6
2768 changed files with 1485826 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace App\Models\Ecommerce\Product\Order\Concerns;
trait HasPayments
{
/**
* Total price for order
*/
public function total(): float
{
return $this->items->sum('total');
}
/**
* Return total order with shipping.
*/
public function fullPriceWithShipping(): string
{
return floatval($this->total()) + floatval($this->shippingPrice()) + floatval($this->additional_tax);
}
/**
* Formatted payment type
*/
public function formattedPaymentType(): string
{
return $this->paymentType?->name;
}
}