Skip to content

Commit

Permalink
[Updated: newProduct, featuredProduct, and relatedProduct queries upd…
Browse files Browse the repository at this point in the history
…ated.]
  • Loading branch information
vivek-webkul committed Apr 12, 2022
1 parent b9c2211 commit 1ce5944
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Queries/Catalog/ProductContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function getRelatedProducts($rootValue, array $args, GraphQLContext $cont
$product = $this->productRepository->find($args['productId']);

if ($product) {
return $product->related_products()->where('type', 'simple')->get();
return $product->related_products()->whereIn('products.type', ['simple', 'virtual', 'configurable'])->get();
}

return null;
Expand Down
4 changes: 2 additions & 2 deletions src/Queries/Shop/Common/HomePageQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function getNewProducts($rootValue, array $args, GraphQLContext $context)
->where('product_flat.status', 1)
->where('product_flat.visible_individually', 1)
->where('product_flat.new', 1)
->where('products.type', 'simple')
->whereIn('products.type', ['simple', 'virtual', 'configurable'])
->where('product_flat.channel', $channel)
->where('product_flat.locale', $locale)
->inRandomOrder();
Expand All @@ -141,7 +141,7 @@ public function getFeaturedProducts($rootValue, array $args, GraphQLContext $con
->where('product_flat.status', 1)
->where('product_flat.visible_individually', 1)
->where('product_flat.featured', 1)
->where('products.type', 'simple')
->whereIn('products.type', ['simple', 'virtual', 'configurable'])
->where('product_flat.channel', $channel)
->where('product_flat.locale', $locale)
->inRandomOrder();
Expand Down

0 comments on commit 1ce5944

Please sign in to comment.