çategory searç
This commit is contained in:
parent
26df5dd8d1
commit
4db7ae8345
|
|
@ -43,6 +43,7 @@ class Product extends JsonResource
|
|||
'is_item_in_cart' => \Cart::hasProduct($product),
|
||||
'shop_title' => $this->shop_title,
|
||||
'brand' => $product->brand->name ?? '',
|
||||
'images' => ProductImage::collection($product->images),
|
||||
/* product's extra information */
|
||||
$this->merge($this->allProductExtraInfo()),
|
||||
|
||||
|
|
@ -94,7 +95,7 @@ class Product extends JsonResource
|
|||
$typeInstance = $product->getTypeInstance();
|
||||
|
||||
return [
|
||||
'images' => ProductImage::collection($product->images),
|
||||
|
||||
'price' => (double) core()->convertPrice($typeInstance->getMinimalPrice()),
|
||||
|
||||
'formatted_price' => core()->currency($typeInstance->getMinimalPrice()),
|
||||
|
|
|
|||
|
|
@ -306,8 +306,7 @@ class Product extends Model implements ProductContract
|
|||
*/
|
||||
public function related_products(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(static::class, 'product_relations', 'parent_id', 'child_id')
|
||||
->limit(4);
|
||||
return $this->belongsToMany(static::class, 'product_relations', 'parent_id', 'child_id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue