Wix Functions
Wix Functions: Adding Additional Fees at Checkout
Charge additional fees based on information like orders, customer details, or shipping info. For example, apply an extra handling fee when customers purchase fragile products from your store. Once you set up and activate an additional fees function, it automatically reviews the input data to calculate the necessary fees. The fees are displayed at checkout and added to the customer's total.
The current additional fees templates include a fragile packaging fee, a payment form fee, and a transaction fee. This article gives you step-by-step instructions for setting up each template. You can also create a function from scratch and add your own custom logic.
Note:
We're continually rolling out Wix Functions and updating our template list with new options to suit your unique business needs.
Fragile packaging fee
Apply a packaging fee when specific fragile items are added to the cart for extra shipping protection. This is useful for covering additional costs associated with safely packaging delicate items.
To build a fragile packaging fee function:
Go to Functions in your site's dashboard.
In the Function catalog, click Create Function under Additional fees.
Select Fragile packaging fee and click Use Template.
In the function builder, click the Condition step to update its logic.
Click 'Item Name' to update the condition to match your business needs (e.g., update the default product names to match the product names in your store).
Tip:
Click the Item Name property to change it. For example, you can set the condition to check 'Item ID' instead of the item name.
Click Apply to save the condition.
Click the Output step.
Set the additional fee details including the fee amount (not including tax) and the name of the fee displayed at checkout.
(Optional) Click the Collect tax toggle to make the additional fee taxable (this is calculated based on your site's tax settings).
(Optional) Click + Add Fee to add another fee.
Select your site's main currency from the drop-down.
Note: The function will not work if the selected currency does not match your site currency.Click Apply to save the output.
Give your function a name at the top left. This is only visible to you.
Click Activate at the top right.
Once the function is activated, customers see the fragile packaging fee at checkout when the criteria of the function is met.
Payment form fee
Apply additional fees to any orders placed through Wix Forms on your site.
Important:
This template's condition includes the Wix Forms App ID, ensuring all payment forms on your site are checked. Do not remove the App ID, as it is essential for functionality. An App ID is a unique identifier for all Wix apps (each has their own ID, including Wix Stores, Wix Bookings, etc). Learn more about App IDs.
To build a payment form fee function:
Go to Functions in your site's dashboard.
In the Function catalog, click Create Function under Additional fees.
Select Payment form fee and click Use Template.
Click the Output step in the function builder.
Set the fee details for all payment forms on your site including the amount and the name of the fee displayed at checkout.
(Optional) Click the Collect tax toggle to make the additional fee taxable (calculated based on your site's tax settings).
(Optional) Click + Add Fee to add another fee.
Select your site's main currency from the drop-down.
Note: The function will not work if the selected currency does not match your site currency.Click Apply to save the output.
Give your function a name at the top left. This is only visible to you.
Click Activate at the top right.
Once the function is activated, customers see the payment form fee at checkout when they make a purchase through a form on your site.
Transaction fee
Create a function that charges customers a fixed transaction fee per order. Since this template does not include a condition, it means the transaction fee will apply to all orders made on your site.
To build a transaction fee function:
Go to Functions in your site's dashboard.
In the Function catalog, click Create Function under Additional fees.
Select Transaction fee and click Use Template.
Set the additional fee details including the fee amount (not including tax) and the name of the transaction fee displayed at checkout.
(Optional) Click the Collect tax toggle to make the additional fee taxable (calculated based on your site's tax settings).
(Optional) Click + Add Fee to add additional fees.
Select your site's main currency from the drop-down.
Note: The function will not work if the selected currency does not match your site currency.Click Apply to save the output.
Give your function a name at the top left. This is only visible to you.
Click Activate at the top right.
Once the function is activated, customers see a fixed transaction fee at checkout.
FAQs
Click a question below to learn more about building custom rewards for your loyalty program.
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.
You can create a function from scratch or customize a premade template built for a specific Wix app.
Learn more about Wix Functions.
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
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 (e.g., a customer's cart and checkout data).
Condition: Conditions allow you to create complex flows using 'if/else' logic. For example, set criteria for a fragile item added to the cart: 'IF a fragile item is added, then add a fragile packing fee; ELSE don’t add a fee.' Ensure your logic is correct, or the function won’t run properly. A condition can include 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 function type has a different output (e.g., the output for the 'Additional fees' function type is the fee amount). The output is always the last step in the path.
Function configuration: Some function types have additional settings. For example, the Wix Loyalty Program custom rewards function requires you to add a reward name and description that's displayed for site visitors.
Actions: Actions allow you to perform additional tasks within the function flow. Use actions to streamline communication with your site visitors, deliver the right information at the right time, and optimize your business processes.
Note: Be careful with actions, as each one affects your function's performance, and a function can run multiple times during a site visit. For example, if you add a 'send an email' action without a defining condition, an email will be sent every time a customer updates their cart.
Can I further customize the condition and output of a template?
Yes. You can adjust the templates and create more complex flows by using the property picker. Click any field with the Customize option above it to open the property picker. Update the properties used in the function to match your needs.
What is the difference between Wix Functions and Wix 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 no other business processes rely on their outcome.
Functions enables you to 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.