bumbummen99 / LaravelShoppingcart

A simple shopping cart implementation for Laravel
MIT License
501 stars 228 forks source link

A non-numeric value encountered #176

Closed foRsxs closed 1 year ago

foRsxs commented 1 year ago

Users sometimes see this error, but I can't catch it. Can you check this

A non-numeric value encountered (View: .../resources/views/sections/arrival/new.blade.php) {"view":{"view":".../vendor/bumbummen99/shoppingcart/src/Calculation/DefaultCalculator.php","data":[]},"userId":28,"exception":"[object] (Facade\Ignition\Exceptions\ViewException(code: 0): A non-numeric value encountered (View: .../resources/views/sections/arrival/new.blade.php) at .../vendor/bumbummen99/shoppingcart/src/Calculation/DefaultCalculator.php:24)

Sartoric commented 1 year ago

Did you check if sometimes an empty value is passed to the calculator ? Anyway the error is self explanatory, maybe some numeric string value is passed instead of pure number

foRsxs commented 1 year ago

Did you check if sometimes an empty value is passed to the calculator ? Anyway the error is self explanatory, maybe some numeric string value is passed instead of pure number

As I know function Add in cart check empty and is_numeric of value for quantity and price. So I can't understand why I get this error))

At this template I use only $cart->count() and $cart->subtotalFloat() Maybe we have to clear all carts at 0:00 and this problem in sesssions

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days