samedi 31 août 2019

Laravel cart - button and cart update

On the products page the button click links to add to cart page with the product id shown in the url however on the add to cart page the cart still shows no items in cart. Also the if statement relating to the session also doesn't appear to be working. So the problem is the cart is not updating.


                          <a href=""
                                   class="btn btn-success pull-right" role="button">Add to Cart</a>
                                @if(Session::has('success'))
       <div class="row">
          <div class="col-sm-6 col-md-4 col-md-offset-4 col-sm-offset-3">
                <div id="charge-message" class="alert alert-success">
                    
                   @endif

   ```shopping cart               

@if(Session::has('cart'))

        <div class="row">
            <div class="col-sm-6 col-md-6 col-md-offset-3 col-sm-offset-3">
                <ul class="list-group">
                   @foreach ((object)$products as $product)
                            <li class="list-group-item">
                                <span class="badge"></span>
                                <strong></strong>
                                <span class="label label-success"></span>
                                <div class="btn-group">
                                    <button type="button" class="btn btn-primary btn-xs dropdown-toogle" data-toggle="dropdown">Action <span class="caret"></span></button>
                                    <ul class="dropdown-menu">
                                        <li><a href="">Reduce by 1</a></li>
                                        <li><a href="">Reduce All</a></li>
                                    </ul>
                                </div>
                            </li>
                     @endforeach
                </ul>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6 col-md-6 col-md-offset-3 col-sm-offset-3">
                <strong>Total: </strong>
            </div>
        </div>
        <hr>
        <div class="row">
            <div class="col-sm-6 col-md-6 col-md-offset-3 col-sm-offset-3">
                <a href="" type="button" class="btn btn-success">Checkout</a>
            </div>
        </div>





via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire