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',