diff --git a/packages/TPS/Shop/src/Repositories/ProductRepository.php b/packages/TPS/Shop/src/Repositories/ProductRepository.php index cffd8eac2..15a37b2b3 100644 --- a/packages/TPS/Shop/src/Repositories/ProductRepository.php +++ b/packages/TPS/Shop/src/Repositories/ProductRepository.php @@ -527,10 +527,8 @@ class ProductRepository extends PRepository $qb = app(ProductFlatRepository::class)->getModel()::search(implode(' OR ', $queries)) - ->take($perPage) -// ->query(fn ($query) =>) -// ->where('status', 1) -// ->where('visible_individually', 1) + ->where('status', 1) + ->where('visible_individually', 1) ->where('channel', $channel) ->where('locale', $locale) ->orderBy('product_id', 'desc'); diff --git a/packages/Webkul/Product/src/Models/ProductFlat.php b/packages/Webkul/Product/src/Models/ProductFlat.php index 52cff4ee8..2c43e3c6e 100644 --- a/packages/Webkul/Product/src/Models/ProductFlat.php +++ b/packages/Webkul/Product/src/Models/ProductFlat.php @@ -50,6 +50,19 @@ class ProductFlat extends Model implements ProductFlatContract return 'products_index'; } + public function toSearchableArray():array + { + return [ + 'id' => $this->id, + 'locale' => $this->locale, + 'channel' => $this->channel, + 'name' => $this->name, + 'meta_keywords' => $this->meta_keywords, + 'status' => $this->status, + 'visible_individually'=> $this->visible_individually, + 'product_id' => $this->product_id + ]; + } /** * Get an attribute from the model. *