@extends('user.layout') @php $selLang = \App\Models\User\Language::where([ ['user_id', Auth::guard('web')->user()->id], ['code', request()->input('language')], ])->first(); if (empty($selLang)) { $selLang = \App\Models\User\Language::where([ ['user_id', Auth::guard('web')->user()->id], ['is_default', 1], ])->first(); } if (empty($selLang)) { $selLang = \App\Models\User\Language::where('user_id', Auth::guard('web')->user()->id)->first(); } $userLanguages = \App\Models\User\Language::where('user_id', Auth::guard('web')->user()->id)->get(); @endphp @includeIf('user.partials.rtl-style') @section('content')

{{ __('Variations') }}

{{ __('Manage product variations easily and efficiently.') }}

@if (!empty($userLanguages)) @endif {{ __('Add Variation') }}
@if (count($variants) == 0)

{{ __('NO VARIATION FOUND') }}

@else
@php $pastelBoxes = [ ['bg' => 'rgba(111, 66, 193, 0.12)', 'color' => '#6f42c1', 'icon' => 'fa-tags'], ['bg' => 'rgba(25, 135, 84, 0.12)', 'color' => '#198754', 'icon' => 'fa-cube'], ['bg' => 'rgba(220, 53, 69, 0.12)', 'color' => '#dc3545', 'icon' => 'fa-layer-group'], ['bg' => 'rgba(253, 126, 20, 0.12)', 'color' => '#fd7e14', 'icon' => 'fa-shapes'], ['bg' => 'rgba(13, 202, 240, 0.12)', 'color' => '#0dcaf0', 'icon' => 'fa-adjust'], ['bg' => 'rgba(13, 110, 253, 0.12)', 'color' => '#0d6efd', 'icon' => 'fa-sliders-h'], ]; @endphp @foreach ($variants as $key => $item) @php $options = DB::table('variant_option_contents') ->where([['language_id', @$selLang->id], ['variant_id', $item->variant_id]]) ->whereNotNull('option_name') ->where('option_name', '!=', '') ->select('option_name') ->distinct() ->get(); $style = $pastelBoxes[$key % count($pastelBoxes)]; @endphp @if (count($options) > 0) @endif @endforeach
{{ __('Name') }} {{ __('Category') }} {{ __('Subcategory') }} {{ __('Options') }} {{ __('Actions') }}
{{ $item->name }}
{{ @$item->category->name ?? __('All Categories') }} {{ @$item->sub_category->name ?? '-' }} @if (count($options) > 0) @else - @endif
@endif
@endsection