How do I enable buyers to buy products from same seller?

Hi guys!

In my B2B app, I have a cart functionality (page) where multiple products are being shown from the “Cart Item” data type (these products may be from the same seller, or may be different sellers), in my workflow I am using “create a new thing” to convert “Cart Item” data type, “SelectedProducts” (a custom state on the page) using checkbox element and “SelectedProducts” custom state to “Order” data type.

If the selected products are from the same seller, there should only be a single “Orders_Details” page, but if the chosen products are from different sellers there should be multiple “Orders_Details” pages like AliExpress do. I want to do it all automated.

Also, there should be a functionality to give a discount if the selected products are from the same seller, or if a single product is worth over 24,000 in weight.

Please help me with it, I highly appreciate any of your help, I am super stressed because of it!

Thanks!