feat: Implement payment method fields, refactor order creation logic to support detailed order items and VM provisioning, and add admin notifications.
This commit is contained in:
@@ -25,20 +25,11 @@ class OrderItem extends Model
|
||||
|
||||
public function getProductAttribute()
|
||||
{
|
||||
// New flow: Check if product exists in Product table first
|
||||
if ($this->product_id) {
|
||||
$product = Product::find($this->product_id);
|
||||
if ($product) {
|
||||
return $product;
|
||||
}
|
||||
return Product::find($this->product_id);
|
||||
}
|
||||
|
||||
// Legacy flow: fallback to old system
|
||||
return match ($this->product_type) {
|
||||
3 => Hosting::find($this->product_id),
|
||||
4 => Vps::find($this->product_id),
|
||||
default => null,
|
||||
};
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user