feat: Implement order and invoice management, enhance addon features, and remove the 'Type' module.
This commit is contained in:
@@ -103,6 +103,17 @@ class Product extends Model
|
||||
return $this->belongsToMany(ProductCategories::class, 'product_product_category', 'product_id', 'product_category_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Relationship: Product has many addons (through product type)
|
||||
* Addons are linked via type_id in product_addon table
|
||||
*/
|
||||
public function addons()
|
||||
{
|
||||
// Assuming product_addon has type_id field that links to product type
|
||||
return $this->hasMany(Addon::class, 'type_id', 'product_type')
|
||||
->orderBy('sort_order');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get monthly pricing (or first available pricing)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user