Skip to content

Commit

Permalink
fix recommend number
Browse files Browse the repository at this point in the history
  • Loading branch information
xxl4 committed Oct 31, 2024
1 parent 8c50195 commit 4afa6b0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Http/Controllers/Api/V1/ProductsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,16 +248,14 @@ public function details($slug, Request $request)
*/
public function recommend($slug, Request $request)
{


$checkout_path = $request->input("checkout_path");

//select four recommended products

$shopify_store_id = config('shopify.shopify_store_id');


$products = \Nicelizhi\Shopify\Models\ShopifyProduct::where("shopify_store_id",$shopify_store_id)->where("status", "active")->select(['product_id','title','handle',"variants","images"])->limit(10)->get();
$products = \Nicelizhi\Shopify\Models\ShopifyProduct::where("shopify_store_id",$shopify_store_id)->where("status", "active")->select(['product_id','title','handle',"variants","images"])->limit(100)->get();


$recommended_info = [];
Expand All @@ -270,7 +268,7 @@ public function recommend($slug, Request $request)
}

$i = 0;
$max = 3;
$max = 10;
foreach($products as $key=> $product) {
$images = $product->images;
$variants = $product->variants;
Expand Down

0 comments on commit 4afa6b0

Please sign in to comment.