Mar 7, 2021
11
Level 1
A non well formed numeric value encountered
Hi, I'm on to build a ecommerce with laravel 7. But now I'm stuck with this error: A non well formed numeric value encountered. I have searched for a solution online but I can not find any help. My course leader can not answer that either.
In the top of the file I has this lines of code.
@php $featured = DB::table('products')->where('status',1)->orderBy('id','desc')->limit(12)->get();
$trend = DB::table('products')->where('status',1)->where('trend',1)->orderBy('id','desc')->limit(8)->get();
$best = DB::table('products')->where('status',1)->where('best_rated',1)->orderBy('id','desc')->limit(8)->get();
<div class="product_extras">
<div class="product_color">
<input type="radio" checked name="product_color" style="background:#b19c83">
<input type="radio" name="product_color" style="background:#000000">
<input type="radio" name="product_color" style="background:#999999">
</div>
<button class="product_cart_button">Lägg i kundvagnen</button>
</div>
</div>
<div class="product_fav"><i class="fas fa-heart"></i></div>
<ul class="product_marks">
@if($row->discount_price == NULL)
<li class="product_mark product_discount" style="background: blue;">Ny</li>
@else
<li class='product_mark product_discount'> 😢 This line is marked as an error
@php
$amount=$row->selling_price - $row->discount_price;
$discount=$amount/$row->selling_price*100;
@endphp
{{ intval($discount) }}
</li>
@endif
</ul>
</div>
</div>
I'm a beginner, you could say. Have taken a few courses, but I do not solve this problem.
Best regards JanOve
Level 1
The line disappeared.
This is the line:
product_mark product_discount
Please or to participate in this conversation.