Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kazzuya's avatar

Change quantity when changing image

Hello.. I'm bad with JQuery and Ajax.. I have this photos

                        @foreach ($images as $image)
                            <div class="product-image-thumb"><img
                                    src="{{ asset('/multiple_images') . '/' . $image->image }}" alt="Product Image"
                                    class="image-thumb">
                            </div>
                        @endforeach

Each photo has a quantity

<span>{{ $image->quantity }} pieces left</span>

How i can change the quantity when changing the photo.. Thanks.

0 likes
3 replies
kazzuya's avatar

@martinbean It's like a product with multiple images.. Each image of those has a quantity I don't know if understand me :c

aliabdm's avatar

I think you have a logic error , the product should have types and the types should have quantities and images then on update the type or selling it you decrement the quantity of that type

Please or to participate in this conversation.