From fe18d9ca88159d42c3b12706c52ca059f7a02891 Mon Sep 17 00:00:00 2001 From: merdan Date: Tue, 28 Jun 2022 18:31:53 +0500 Subject: [PATCH] parse test --- packages/Sarga/API/Http/Controllers/Products.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/Sarga/API/Http/Controllers/Products.php b/packages/Sarga/API/Http/Controllers/Products.php index 66a0510f5..eef979048 100644 --- a/packages/Sarga/API/Http/Controllers/Products.php +++ b/packages/Sarga/API/Http/Controllers/Products.php @@ -2,6 +2,7 @@ namespace Sarga\API\Http\Controllers; +use Illuminate\Support\Facades\Log; use Sarga\API\Http\Resources\Catalog\ProductVariant; use Sarga\API\Http\Resources\Catalog\SuperAttribute; use Sarga\Shop\Repositories\ProductRepository; @@ -64,7 +65,7 @@ class Products extends ProductController { $channel = core()->getRequestedChannelCode(); - $locale = core()->getRequestedLocaleCode(); + $locale = 'tm';//core()->getRequestedLocaleCode(); $qf->where('product_flat.channel', $channel) ->where('product_flat.locale', $locale) @@ -73,6 +74,8 @@ class Products extends ProductController }]); }])->find($id); + Log::info($product); + if(!empty($product) && $product->super_attributes->isNotEmpty() && $product->variants->isNotEmpty()) { $variants = $product->variants->makeHidden(['type','created_at','updated_at','parent_id','attribute_family_id',