Custom Variables
Last updated
Was this helpful?
Last updated
Was this helpful?
The Custom Variables feature allows you request information from the customer when they add a product to their basket. You could, for example, request which colour name tag they would like when purchasing a VIP rank and this is the example that we are going to use in this guide.
Just like how you might use the {username} command variable when creating packages, this feature allows you to create your own variables, such as {colour} in this instance.
This video will explain and walk you through creating a package with custom variable options. This is an ideal system to use for many servers, so you can simply ask the customer for relevant information instead of having to create many different packages.
As an example, this is particularly useful for servers running game modes like Pixelmon, due to the many customisation options available for that game mode - but this is really suitable in a wide variety of situations, servers and game modes, use your imagination and get creative!
From the left-sidebar click 'Settings' then 'Variables'.
Click 'Create Your First Variable' or 'Create Variable'.
Choose an identifier for your variable - this is what you will use in your package commands, such as {colour} for example.
Enter a description for your variable - this is what customers will see when asked for a selection for the variable.
Select the type of your variable, we are going to choose Dropdown for this example. We have several other types such as Email Address, Username, Alphanumeric, Numeric and more.
Because we are creating a variable which asks which colour name tag the player would like with the rank, we are going to add three options below. To add your first option, click 'Add Option'.
Each variable option needs to have the following setup for it:
Name - This is the option name that will be displayed to your customer.
Value - This is what the {colour} variable (as defined previously) will be replaced with when the commands are executed on your server.
Price - Optionally, if you want to charge an additional amount on top of the package price, if the customer selects the option in question, you can enter it here. You can also define a percentage increase of the package price on a per-option basis instead, if you'd like.
Following on with our example our options list now looks like the following:
As well, optionally, you can select an option as the default for the package - useful if you'd like to offer a 'base' option you'd like to preselect for the customer.
Once you are happy with your variable, click 'Create'.
You then need to add this variable to whatever packages you like; you can do this by editing each package and selecting this variable when you go to edit or create a package - you'll find it in the 'Variables' section - just check the variable you've just created and add the identifier, {colour} in the example above, into the command(s) for the package(s) in question.
In your package commands section, you can now use the {colour} variable as you would any other Command Variable that we provide. Once your customer purchases the package we will replace the {colour} variable with the value corresponding to the option they chose.