çategory searç

This commit is contained in:
merdan 2022-10-08 17:16:45 +05:00
parent 26df5dd8d1
commit 4db7ae8345
2 changed files with 3 additions and 3 deletions

View File

@ -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()),

View File

@ -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');
}
/**