I need help with looping my product options, this is what i have now:
What I want is simply get 2 row's only one for color and another for size and in dropdown in front of each one have all items.
here is my blade code:
<tbody>
@foreach($product->suboptions as $option)
<tr>
<td style="width: 150px;">{{ $option->option->title }}</td>
<td class="text-left">
<select name="" id="">
<option value="{{$option->id}}">{{$option->title}} - {{ number_format($option->price, 0) }}</option>
</select>
</td>
</tr>
@endforeach
</tbody>
UPDATE
my dd result of {dd($product->suboptions)}}


print_r($products->suboptions)? Do color and size appear multiple times?$product = Product::where('slug', $slug)->firstOrFail();print_r($product->suboptions)before the blade loop, so you can see if the suboptions are indeed duplicated.ddresult