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,32 @@
<?php
namespace App\Models\Ecommerce\Product\Order\Concerns;
use App\Models\Ecommerce\Product\Order\Shipping\OrderShipping;
trait HasShipping
{
/**
* Shipping price
*/
public function shippingPrice(): int
{
return intval($this->shipping_price) ?: OrderShipping::priceFor($this->shipping_method);
}
/**
* Formatted shipping method
*/
public function formattedShippingMethod(): string
{
return OrderShipping::formattedShippingMethod($this->shipping_method);
}
/**
* Full address for the order
*/
public function fullAddress(): string
{
return OrderShipping::fullAddress($this->region, $this->province_id, $this->customer_address);
}
}