Given that you don't show your code, I can only guess what you are handling.
@foreach ($colors as $color)
@foreach ($sizes as $size)
{{ $color.' / '.$size }}
@endforeach
@endforeach
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
For the product entry section, I want to give the admin the ability to register a combination of different variable states with different prices. For example, after selecting size and color as variables, they should be able to enter or select one or more values for each, such as color and size with green, red, large, and small as their values. Up to this point, there is no problem, but when I want to show the admin the combination of these values so they can register different prices for each combination if available, I have a problem. I don't know how to create a loop in the view to generate 2x2 combinations, which results in 4 different states. For example:
State 1: Green with medium size - $100 State 2: Green with large size - $110 State 3: Red with medium size - $120 State 4: Red with large size - $130
In summary, I want a method that allows me to create forms for entering prices, quantities, etc., after selecting values and variables, and to register each one that the user sets a price for in the SKU table. If sending the tables would help, let me know so I can send them. Currently, my tables are these:
Product | SKU | Attribute | Value | sku_value
Please or to participate in this conversation.