Functions: About Functions
3 min read
Learn more about Wix Functions and how to create customized flows for your business.
What is a function?
Functions let you incorporate custom logic into Wix apps (e.g. Wix Stores and Wix Loyalty Program) to better tailor them to your business.
The Functions builder is a no-code interface where you set up custom outcomes for different business scenarios using conditions, formulas, and dynamic values. The builder helps you see your logic in a visual flow where you can create multiple branches.
Create a function from scratch or customize a premade template built for a specific Wix app.
How can I use functions for my business?
Wix provides a wide range of business solutions designed to work with your site (e.g. Wix Stores, Wix Restaurants, Wix Loyalty program). However, every business is unique and has specific ways they like managing their processes.
With Functions, you can manipulate the Wix apps you use daily to better work with your unique needs–all without using code.
What is an example of a function?
Here are a few examples of functions across different Wix apps:
Custom rewards (Wix Loyalty Program)
- Frequent buyer perk: Stella has an online store as well as an active loyalty program for her customers. Using this function, she can award frequent buyers by giving them the ability to convert their loyalty points into a discount, based on the amount of orders they placed within the last 30 days (e.g. 5 orders in 30 days = $5 off).
- Total spend bonus: Stella has an online store as well as an active loyalty program for her customers. Using this function, she can award her most loyal customers by giving them the ability to convert loyalty points into a discount based on the total amount they have spent in her shop.
Additional fees at checkout (available for eCommerce)
- Fragile packing fee: Apply a packaging fee when specific fragile items are added to the cart for extra shipping protection.
- Transaction fee: Add a fixed transaction fee applicable to all orders.
What are the different components that make up a function flow?
Every function is made up of the following parts:
- Input: The input is the starting point of your function flow. It is a read-only step that represents the data you can expect to receive when the function runs. For Wix Loyalty Program custom rewards, the Input data is the loyalty program customer data.
- Conditions: Conditions let you create complex flows by defining criteria with 'If / Else' logic. For example, set parameters on a fragile item like: "IF this product is ordered, THEN add an additional fragile packing fee, ELSE do not add an additional fee." Make sure your logic makes sense, otherwise the function won't run correctly. A condition can consist of up to 20 criteria.
- Output: The output is the result you want to occur in existing Wix app flows. You set an output for every function you create. Each type of function will have a different output (e.g., the output for a 'fragile packing fee' function is the fee in your site currency, whereas the output for 'custom loyalty program rewards' is the reward you want members to receive). The output will always be the last step in the path.
- Function configuration: Some function types have additional settings. For example, the Wix Loyalty program custom rewards function allows you to add a reward name and description that's displayed for site visitors.
What is the difference between Functions and Automations?
Although Wix Functions and Wix Automations both allow you to create custom flows and logic for your business, they differ in how they affect any installed Wix apps on your site.
Wix Automations is designed to help you perform specific actions (e.g. send an email, create a task) in response to pre-defined triggers. Automations are useful when setting up repetitive, predefined tasks such as sending invoices for multiple customer orders. Automations operate independently, meaning they don't affect the way Wix apps work on your site.
Functions let you build custom logic within Wix apps. You can extend and modify the standard processes in the Wix app (e.g. Wix Stores) according to your unique needs. In a function, the Wix app waits for the function response before proceeding with the rest of the workflow. The function's output directly influences how the Wix app behaves.
What Wix apps can I build functions with?
Wix Functions works with these apps:
- Wix Stores
- Wix Bookings
- Wix Restaurants Orders (New)
- Wix Table Reservations
- Wix Donations
- Wix Forms
- Wix Loyalty Program
Did this help?
|