Product Price by Quantity
Options
![brian](https://us.v-cdn.net/6037124/uploads/userpics/11OHPI6GVCSP/nPOPOEI090I2H.png)
brian
Administrator
ADMIN
in ✂️ Snippets
Set your product prices based on the quantity of items ordered.
- Snippet: https://www.xano.com/snippet/0y4bkQyR
- Video walk-through: https://www.loom.com/share/0396b8f475bc4de8b5605935f4d78cd0
- Instructions: how to add a snippet
It features:
- GET /product_price - find the price for a product using the inputs of product_id and quantity.
- GET /create_product - create a new product and set as many prices you want for a quantity range using a JSON object.
- TABLE product - to set the product's name.
- TABLE price - to set the price for a product based on a quantity range.
You can use this snippet to learn how to:
- Use a function to populate data based on business logic built into your API
- Iterate through an array using a variable (array_index) for faster testing
- Use Database Transaction to protect your database from errors, by only uploading a new product if every price range was successfully set
Feel free to add suggestions, requests, or questions in the comments!
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback