Variables
Last updated
Last updated
The variables feature allows you request custom 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 we are going to use in this guide. Just like how you would use the {username} variable when creating package commands, 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 use a drop-down menu 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!
Go to Settings > Variables.
Click Create Your First Variable.
Enter the identifier of your variable - this is what you will use in your package commands (such as {colour}).
Enter the description of your variable - this is what the customers will see when presented with the selection.
Select the type of your variable, we are going to choose Dropdown for this tutorial. We have several other types such as Email Address, Username, Alphanumeric, Numeric, etc.
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 has the following:
Name - This is what 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 - If you want to charge an additional amount if the customer selects this option you can enter it here.
Following on with our example our options list now looks like the following:
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 on the package configuration page.
In your package commands section, you can now use the {colour} variable as you would any other variable that we provide. Once your customer purchases the package we will replace the {colour} variable with the option they chose.