This commit is contained in:
TL 2022-08-12 16:30:46 +08:00
parent de4f48065b
commit d881e4e795
2 changed files with 2 additions and 1 deletions

View File

@ -35,7 +35,7 @@ class ProductDetail extends JsonResource
'category_id' => $this->category_id ?? null,
'variables' => $this->decodeVariables($this->variables),
'skus' => SkuDetail::collection($this->skus)->jsonSerialize(),
'in_wishlist' => CustomerRepo::inWishlist($this->resource, current_customer()),
'in_wishlist' => $this->inCurrentWishlist->id ?? 0,
];
}

View File

@ -40,6 +40,7 @@ class ProductList extends JsonResource
'price_format' => currency_format($masterSku->price),
'origin_price_format' => currency_format($masterSku->origin_price),
'category_id' => $this->category_id ?? null,
'in_wishlist' => $this->inCurrentWishlist->id ?? 0,
'images' => array_map(function ($item) {
return image_resize($item, 400, 400);