<td class="text-center">
@php
$line_sku2= $sell_lines->variations->sub_sku;
$product_weight2 = DB::select('SELECT weight FROM products WHERE sku like ?', [$line_sku2]);
@endphp
@foreach($product_weight2 as $weight2)
@php
$line_weight2 = $sell_lines->quantity * $weight2->weight ;
@endphp
@endforeach
{{$line_weight2}} {{ __(' Kg') }}
</td>
POS system need to modify it with weight value and i’,m junior in php
2
Answers
This is the whole page i need to sum weight
You can initialize a variable and add to it, across your iteration. I have added a snippet below: