Variables
Learn about what Variables you can use on your Webstore
Introduction
Each page on your store has access to certain variables. These variables can be used by you when customising your template to display certain data. To access a variable, you can use the following syntax
{{ webstore.name }}
Below is a list of all variables accessible on pages on the webstore. Where you can access each variable is explained in each section.
Webstore
The webstore that is currently being viewed. Can be accessed on all pages.
- sub_domain - Full sub domain of the webstore
- name - The name of the webstore
- logo - The path to the webstore's logo
- home_banner - The path to the webstore's home banner (displayed at the top of the default template)
- homepage_message - The homepage message
- terms_and_conditions - The terms and conditions of the webstore
- privacy_policy - The privacy policy of the webstore
- email_note - The email note that is sent to the user when a payment is complete
- currency - The default currency set in the control panel for the webstore
- minimum_basket_amount - The minute basket amount that the customer must have to proceed with a payment
- maximum_coupons_per_basket - Maximum number of coupons a customer can have on a basket
- maximum_gift_cards_per_basket - Maximum number of gift cards a customer can have on a basket
- free_basket - True or False, if free baskets are allowed
- require_billing_details - True or False, if billing details are required or not
- spending_limit - The max amount a customer can spend
- support_tickets - True or False, if Support Tickets are enabled on the webstore
- home_page_tagline - The homepage tagline
- allow_gifting - True or False, whether or not gifting is allowed
- notify_referral - True or False, whether or not the customer should be told they are buying through a referral
- tell_what_packages_are_required - True or False, whether or not to list the packages required to buy a certain package
- language - The default language of the webstore
- template - The name of the webstore's currently active template
- sale_email - The email that is notified when sales occur
- payment_complete_page - The text that is displayed when a payment is complete
- admin_email - The admin email associated with the webstore
Categories
A query set containing the webstore's categories. Can be accessed on all pages. It must be iterated over like this
{% for category in categories %}
{{ category.name }}
{% endfor %}
Once iterated over, you can access the following values on each category
- order - The order (a whole number) in which this category should be displayed. By default the query set is ordered in ascending order
- name - The name of the category
- description - The category's description
- parent - If set (defaults to None), the parent category object (same as the current)
- display_as - L or G representing List or Grid (the display preference)
- image - The path to the category's image
- active - True or False, whether or not the category is active/should be displayed
- cumulate - True or False, whether or not the category should cumulate packages
- disable_lower_priced_packages - True or False, whether or not the category should display lower priced packages compared to the current bought package from that category
- allow_only_one_purchase - True or False, whether or not to limit the number of purchases in the category to one
- order_by_price - True or False, whether or not the packages should be ordered by price or not
- do_not_display_in_subcategory_dropdown - True or False, whether or not (if it has a parent category), it should be displayed in the sub category dropdown of that parent
Pages
A query set containing the webstore's pages.Can be accessed on all pages. It must be iterated over like this
{% for page in pages %}
{{ page.name }}
{% endfor %}
Once iterated over, you can access the following values on each page
- title - The title of the page
- url - The URL that this page is accessed through
- layout - The layout of the page. L: small left column, R: small right column, E: 3 even columns
- status - True of False, whether or not the page is active or not
- logged_in_to_view - True of False, whether or not you need to be logged in to view the page
- add_to_menu - True or False, whether or not the page should be added to the store nav bar
- password_protect - True or False, whether the page should be password protected or not
- column1 - Query set of modules for the left column of the page which can be iterated over
- column2 - Query set of modules for the middle column of the page which can be iterated over
- column3 - Query set of modules for the right column of the page which can be iterated over
Cart
A list of items in the cart, the package ID and the quantity of that package. Can be accessed on all pages.
Can also get the cart total
{% for item in cart %}
{{ item.id }}
{{ item.quantity }}
{{ cart_total }}
{% endfor %}
It's worth noting that the ID might not be sufficient for your needs. To help with that, there is a get cart template tag that is described in the Template Tags doc. This will return the actual package objects so you can get data on them. The package information you can access is listed in the next section.
Package
A package object. Not directly accessible on any particular page, but can be accessed through using a Template Tag like get cart, or through a module like the Featured Package Module
Each package object has the following fields you can access
- order - The order (a whole number) in which this package should be displayed. By default the query set is ordered in ascending order
- name - The name of the package
- description - The description of the store
- image - The path to the package's image
- price - The packages price
- expire_after - The value of the expire period
- expire_after_period - The period that the package should expire after, with the expiry value. (N: None, M: Minutes, H: Hours, D: Days, W: Weeks)
- purchase_type - Purchase type, O: Once Off, S: Subscription
- category - The category object (can use the aforementioned category fields on this object), that this package is in
- global_limit - The value of the global limit
- global_limit_period - The period that the global limit applies (N: None, M: Minutes, H: Hours, D: Days, W: Weeks)
- user_limit - The value of the user limit
- user_limit_period - The period that the user limit applies (N: None, M: Minutes, H: Hours, D: Days, W: Weeks)
- servers - The list of servers this package should execute on. Iterate over to get each one. Check the following sections for the server object
- variables - The list of variables this package has. Iterate over to get each one. Check the following sections for the variable objects.
- required_packages - List of required package objects
- only_require_one_package - True of False, whether or not 1 package on the required packages list is allowed
- active - True of False, whether or not the package is active
- allow_customer_change_qty - True of False, whether or not the customer can change the quantity of this package
- allow_customer_change_price - True of False, whether or not the customer can change the price of this package
- choose_server_to_execute - True of False, whether or not the customer can choose what server they want the package to execute on
- disable_gifting - True of False, whether or not the package can be gifted
- allow_gift_cards - True of False, whether or not to allow gift cards on this package
- show_package_until - Date time to show the package until
Server
A server object. Mostly retrieved from a package that has servers listed. You can iterate through a package's servers using
{% for server in package.servers.all %}
{% endfor %}
- name - The server name
- secret_key - The server's secret key
Variable
A variable object. Mostly retrieved from a package that has variables listed. You can iterate through a package's variables using
{% for variable in package.variables.all %}
{% endfor %}
- identifier - The variables unique identifier
- description - The variables description
- type - Variable Type. A: Alphabetic. N: Numeric. AN: Alphanumeric. E: Email. M: Minecraft Username. D: Dropdown
- minimum_length - If appropriate, the minimum length of the variable
- maximum_length - If appropriate, the maximum length of the variable
Need More Information?
The above is a non-exhaustive list of the objects in Donation Store. There is quite a bit that is left out because they are not essential to the front viewing of the store. The above is provided so you can create templates for the webstore and most of the other stuff is hidden away. If there is information you'd like and want docs about, please Open a Support Ticket and request it.
Have Questions? Open a Support Ticket
View Common Issues on the Knowledgebase
Video Guides on YouTube
Other clients and Donation Store developers hang out on our Discord server, where you can ask for support in #ds-chat, or if you are a Client and you don't uet have your Client role on Discord, let us know and we can add it. Once added you get access to our private Client's support channel.