Hi, looking for some advice or thoughts regarding a dynamic product page.
Imagine I have a cake store. Customers can buy individual cakes, but can also choose a selection box of 6 - they can should be able to choose the individual flavours and quantities themselves.
The flavour options and quantities displayed should be tied into current individual stock availability - eg if a particular flavour has only two in stock, then that is all that should be make available for selection.
There should also be some logic that ensures that 6 products have been selected before allowing add to basket.
Are there any apps out there that offer this functonality? If not, any pointers about the best way to code this up?
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
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
Create a Database and then within that Database, create a Column for the Product Name, Image, Description, etc… then on a Dynamic Page of that Database, add a drop-down box which contains the possible quantities they can buy. I’m fairly certain you can create different payments for different quantities, in fact I found Documentation on this the other day: