@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)
@else
@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
@endif
@endforeach