PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.7.0
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.7.0
1.7.0 1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 All 50 releases
← All changes | app/Models/Product.php +9 -2 1.6.3 → 1.7.0 View file →
@@ -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 }