| @@ -195,9 +195,9 @@ | ||
| 195 | 195 | |
| 196 | 196 | public function getThumbnailAttribute() |
| 197 | 197 | { |
| 198 | 198 | if (empty($this->detail) || empty($this->detail->featured_media)) { |
| 199 | - return Vite::getAssetUrl('images/placeholder.svg'); | |
| 199 | + return Helper::getProductPlaceholderUrl(); | |
| 200 | 200 | } |
| 201 | 201 | return Arr::get($this->detail->featured_media, 'url'); |
| 202 | 202 | } |
| 203 | 203 | |
| @@ -491,9 +491,9 @@ | ||
| 491 | 491 | |
| 492 | 492 | public function images(): array |
| 493 | 493 | { |
| 494 | 494 | $images = []; |
| 495 | - $thumbnailImage = $this->thumbnail ?? Vite::getAssetUrl('images/placeholder.svg'); | |
| 495 | + $thumbnailImage = $this->thumbnail ?? Helper::getProductPlaceholderUrl(); | |
| 496 | 496 | |
| 497 | 497 | $galleryImages = get_post_meta($this->ID, 'fluent-products-gallery-image', true); |
| 498 | 498 | |
| 499 | 499 | |
| @@ -803,6 +803,13 @@ | ||
| 803 | 803 | |
| 804 | 804 | public function integrations(): \FluentCart\Framework\Database\Orm\Relations\HasMany |
| 805 | 805 | { |
| 806 | 806 | return $this->hasMany(ProductMeta::class, 'object_id')->where('object_type', 'product_integration'); |
| 807 | + } | |
| 808 | + | |
| 809 | + public function reviews(): \FluentCart\Framework\Database\Orm\Relations\HasMany | |
| 810 | + { | |
| 811 | + return $this->hasMany(ProductReview::class, 'post_id', 'ID') | |
| 812 | + ->whereNull('parent_id') | |
| 813 | + ->where('status', Status::REVIEW_APPROVED); | |
| 807 | 814 | } |
| 808 | 815 | } |