Getting started: custom order contents

Hey Georgina!

You might want to check this Bundled & Connected Inventory app, I am not familiar with it, but there are some examples there and it has a 7 days free trial :slight_smile:

There are some Velo functionalities that might help with such logic, I just want to make sure I fully understand the case here…

You say - ā€œCustomers can buy individual cakesā€,
but then you added "There should also be some logic that ensures that 6 products have been selected before allowing add to basket. "

So allowing customers to buy only 3 individual cakes for example is possible, but not if choosing this ā€œbox of 6 productā€?

If this is the case - there are some ways to do it using Velo -

Let’s call this box of 6 product - package product.

You can build a custom product page when entering ā€œpackage productā€ (using the wix-location api you will know when you are on the ā€œpackage productā€ page) , there creating some kind of form that customers will be able to choose the cakes options and adding them to the ā€˜custom text field’ product property of the package product .
You can use wix-data query to fetch the available cakes to be shown on the form.

After the package product is added to the the cart and purchased, there is an event called onOrderPaid() ( that is fired after an order was paid) you can check the event object, if it has the package product in it, you can check the chosen cakes from the custom text field and decrement their inventory quantity using wixStoresBackend.decrementInventory()

Velo gives you a lot of flexabiltiy along the way so there are few ways to implement it… and that is one way to do it :slight_smile:

Let me know if you need any more help :slight_smile:

Omri