Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qty and not showing more than 1 item in table #20

Closed
lstables opened this issue Oct 28, 2014 · 0 comments
Closed

Qty and not showing more than 1 item in table #20

lstables opened this issue Oct 28, 2014 · 0 comments

Comments

@lstables
Copy link

I have the following which adds to the cart:

      {{ Form::open(['route' => 'cart']) }}
                <input type="hidden" name="path" value="{{ Request::path() }}">
                <input type="hidden" name="image" value="{{ $item->image }}">
                <input type="hidden" name="product" value="{{ $item->name }}">
                <input type="hidden" name="description" value="{{ $item->seo_description }}">
                <input type="hidden" name="qty" value="1">
                <input type="hidden" name="size" value="{{ Session::get('size') }}">
                <input type="hidden" name="colour" value="{{ Session::get('colour') }}">
                <input type="hidden" name="price" value="{{ $item->price }}">
            @if ($item->stock > 0) <button class="btn btn-success">Add to Bag</button>  @else <a href="" class="btn btn-primary">Email us</a> @endif
            {{ Form::close() }}

Then I have this which shows the items of the carts.

  @foreach($items as $item)
                    <tr>
                        <td class="col-sm-8 col-md-6">
                        <div class="media">
                            <span class="thumbnail pull-left"> <img class="media-object" src="/uploads/product-images/{{$item->image}}" style="width: 72px; height: 72px;"> </span>
                            <div class="media-body">
                                <h4 class="media-heading"><a href="{{ $item->path }}">{{ $item->name }}</a></h4>
                                <span>Status: </span><span class="text-success"><strong>In Stock</strong></span>
                            </div>
                        </div></td>
                        <td class="col-sm-1 col-md-1" style="text-align: center">
                        <input type="email" class="form-control" id="exampleInputEmail1" value="1">
                        </td>
                        <td class="col-sm-1 col-md-1 text-center"><strong>&pound;{{ $item->price }}</strong></td>
                        <td class="col-sm-1 col-md-1">
                        </td>
                    </tr>
                    @endforeach
                    <tr>
                        <td>   </td>
                        <td>   </td>
                        <td>   </td>
                        <td><h5>Subtotal</h5></td>
                        <td class="text-right"><h5><strong>&pound;{{ $item->price }}</strong></h5></td>
                    </tr>
                    <tr>
                        <td>   </td>
                        <td>   </td>
                        <td>   </td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td>   </td>
                        <td>   </td>
                        <td>   </td>
                        <td><h3>Total</h3></td>
                        <td class="text-right"><h3><strong>&pound;{{ Cart::total(false) }}</strong></h3></td>
                    </tr>
                    <tr>
                        <td>   </td>
                        <td>   </td>
                        <td><a href="/remove/{{ $item->identifier }}" class="btn btn-danger"><span class="glyphicon glyphicon-remove"></span> Remove</a>
Continue Shopping Checkout

But like I said it only shows one item, but yet the amount in £ is correct.
Show what should I be doing? Or what am I doing wrong?

Also a suggestion would be to update the docs a little more with more info like this to show people like me more examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants