Crinsane购物车未更新

时间:2017-11-09 06:43:23

标签: php laravel laravel-5

我给他数字数量,但它没有在购物车中更新。我在哪里弄错了?

cart.blade.php

{!! Form::open(['route' => ['cart.update',$cartItem->id,$cartItem->qty], 'method' => 'POST']) !!}

                      <input class="qty"  min="0" max="" name="qty" value="{{$cartItem->qty}}" title="qty" size="4" pattern="[0-9]*" inputmode="numeric" type="text">
                    </td>

                    <td class="product-price" data-title="Price">{{$cartItem->price}}</td>
                    {{--<td class="product-subtotal" data-title="Total">$2.26</td>--}}
                    <span class="input-group-btn">
                      <td class="product-remove">

                        <input style="position: relative; top: 21px;" class="button success small" type="image" src="images/refresh.png" onmouseover="this.src='images/refresh2.png'" onmouseout="this.src='images/refresh.png'" alt="Submit" width="30" height="30">
                        {!! Form::close() !!}

1 个答案:

答案 0 :(得分:1)

请检查您的cart.update路线并仅传递一个参数,例如cart/{cart},并在表单中传递两个参数(即{!! Form::open(['route' => ['cart.update',$cartItem->id,$cartItem->qty], 'method' => 'POST']) !!}