graham's avatar

No matter how many time I look at it this bit jumps out as it gets all the options not just the available ones:

@foreach($item->options as $option)

I wonder what's in the $item

@if($item->availableColours() && $item->availableStock())
    // {{ dd($item) }}
    Colours
    @foreach($item->options as $option)
        {{ $option->colour }}
    @endforeach
@endif
graham's avatar

If you replace the existing if/endif in the html what does this give you?

@if($item->availableColours() && $item->availableStock()) {{ dd($item->availableColours()) }} Colours @foreach($item->options as $option) {{ $option->colour }} @endforeach @endif

graham's avatar

What colours are available for the product you're looking at?

graham's avatar

hmmmmm.

Can you find a product that has stock in at least 2 colours in stock and at least one colour out of stock just to make sure that we can tell if what 's being tested is working properly.

Then try the last bit again.

theUnforgiven's avatar

or is there a way to show if the colour has not stock then in the size select just show "no stock" or something?

Previous

Please or to participate in this conversation.