@extends('Layouts.adminLayout') @section('title') {{__('Insert Product Attribute')}} @endsection @section('breadcrumb')
@endsection @section('content')

{{__('Insert Product Attribute')}}

@CSRF @foreach($data['categoryAttribute'] as $categoryAttribute)

{{$categoryAttribute->title}}

@foreach(AttributewithCategory($categoryAttribute->id) as $attribute)
{{$attribute->title}}
@php $attrValue=\App\Models\Product::getProductAttribute($data['product_id'],$attribute->id)->first(); @endphp @if($attrValue!=null)
@else
@endif @if($attribute->type==1)
@elseif($attribute->type==2)
@php $attrValues=\App\Models\Product::getProductAttribute($data['product_id'],$attribute->id)->get(); if(count($attrValues)>0) $attrValue=$attrValues->pluck('attribute_value_id')->toArray(); else $attrValue=array(); @endphp
@elseif($attribute->type==3)
@php $attrValues=\App\Models\Product::getProductAttribute($data['product_id'],$attribute->id)->get(); if(count($attrValues)>0) $attrValue=$attrValues->pluck('attribute_value_id')->toArray(); else $attrValue=array(); @endphp
@elseif($attribute->type==4)
@php if(isset($attrValue)) $attrValue=$attrValue->text; else $attrValue=''; @endphp
@else
@php if(isset($attrValue)) $attrValue=$attrValue->text; else $attrValue=''; @endphp
@endif @if($attribute->type==2 or $attribute->type==3) @php if(count($attrValues)>0) $special_price=$attrValues[0]->special_price; else $special_price=0; @endphp
{{__('Multi Price')}}
@endif
@endforeach
@endforeach @if(sizeof($data['categoryAttribute'])>0)
@else
@endif
@endsection @section('script') @endsection