The list is incomplete. We’re working on it!
current_currency
Returns the currently selected currency. By default in the Storefront this will be store.default_currency
. This can be changed in the Settings -> Store Defaults
page.
Copy
Ask AI
<%= current_currency %>
Copy
Ask AI
USD
current_locale
Returns the currently selected locale. By default in the Storefront this will be store.default_locale
. This can be changed in the Settings -> Store Defaults
page. If there are multiple locales available, it will return the locale that is currently selected by the user.
Copy
Ask AI
<%= current_locale %>
Locale also affects the storefront URLs. For example, if the default locale is
en
and the user selects fr
, the URL will be /fr/products/123
.current_order
Show properties
Show properties
The order number
Example:
R123456789
The total amount of the order
Example: 99.99
Formatted total with currency
Example: “$99.99”
Sum of all line item amounts pre-tax
Example: 89.99
Formatted item total with currency
Example: “$89.99”
Sum of all adjustments
Example: -10.00
Formatted adjustment total with currency
Example: ”-$10.00”
Sum of all tax amounts
Example: 13.25
Formatted tax total with currency
Example: “$13.25”
Sum of shipment amounts
Example: 10.00
Formatted shipment total with currency
Example: “$10.00”
Sum of all promotion adjustments
Example: -15.00
Formatted promotion total with currency
Example: ”-$15.00”
Sum of included tax amounts
Example: 8.25
Sum of additional tax amounts
Example: 5.00
Sum of completed payment amounts
Example: 99.99
Current order state
Example:
cart
Customer email address
Example:
[email protected]
Associated user ID
Example: 123
Associated user object
Show properties
Show properties
User ID
Example: 123
User email address
Example:
[email protected]
User first name
Example:
John
User last name
Example:
Doe
Default billing address object
Show properties
Show properties
Address ID
Example: 456
Address line 1
Example:
123 Main St
Address line 2
Example:
Apt 1
City
Example:
Anytown
Zipcode
Example:
12345
State name, used when the country doesn’t require a state object
Example:
Some Province
Returns either state.name (if state is present) or state_name
Example:
California
or Some Province
Country name
Example:
United States
Country ISO code
Example:
US
Country object
Show properties
Show properties
Country ID
Example: 1
Country name
Example:
United States
Country ISO3 code
Example:
USA
Country ISO code
Example:
US
Country ISO name
Example:
UNITED STATES
Whether states are required for this country
Example:
true
Whether zipcodes are required for this country
Example:
true
Default shipping address object
Show properties
Show properties
Address ID
Example: 456
Address line 1
Example:
123 Main St
Address line 2
Example:
Apt 1
City
Example:
Anytown
Zipcode
Example:
12345
State name, used when the country doesn’t require a state object
Example:
Some Province
Returns either state.name (if state is present) or state_name
Example:
California
or Some Province
Country name
Example:
United States
Country ISO code
Example:
US
Country object
Show properties
Show properties
Country ID
Example: 1
Country name
Example:
United States
Country ISO3 code
Example:
USA
Country ISO code
Example:
US
Country ISO name
Example:
UNITED STATES
Whether states are required for this country
Example:
true
Whether zipcodes are required for this country
Example:
true
User tags (tags are used manageable by store admins)
Example:
Copy
Ask AI
["vip", "wholesale"]
When the order was completed (placed and paid). For orders in
cart
state, this will be nil
.
Example: 2023-06-15 13:45:00
Billing address ID
Example: 456
Billing address object
Show properties
Show properties
Address ID
Example: 456
Address line 1
Example:
123 Main St
Address line 2
Example:
Apt 1
City
Example:
Anytown
Zipcode
Example:
12345
State name, used when the country doesn’t require a state object
Example:
Some Province
Returns either state.name (if state is present) or state_name
Example:
California
or Some Province
Country name
Example:
United States
Country ISO code
Example:
US
Country object
Show properties
Show properties
Country ID
Example: 1
Country name
Example:
United States
Country ISO3 code
Example:
USA
Country ISO code
Example:
US
Country ISO name
Example:
UNITED STATES
Whether states are required for this country
Example:
true
Whether zipcodes are required for this country
Example:
true
Shipping address ID
Example: 457
Shipping address object
Show properties
Show properties
Address ID
Example: 456
Address line 1
Example:
123 Main St
Address line 2
Example:
Apt 1
City
Example:
Anytown
Zipcode
Example:
12345
State name, used when the country doesn’t require a state object
Example:
Some Province
Returns either state.name (if state is present) or state_name
Example:
California
or Some Province
Country name
Example:
United States
Country ISO code
Example:
US
Country object
Show properties
Show properties
Country ID
Example: 1
Country name
Example:
United States
Country ISO3 code
Example:
USA
Country ISO code
Example:
US
Country ISO name
Example:
UNITED STATES
Whether states are required for this country
Example:
true
Whether zipcodes are required for this country
Example:
true
Payment state (balance_due, credit_owed, failed, paid, void)
Example:
paid
Shipment state (backorder, canceled, partial, pending, ready, shipped)
Example:
shipped
Order currency
Example:
USD
Associated store ID
Example: 1
Line items in the order
Show properties
Show properties
Line item ID
Example: 123
Quantity of the variant ordered
Example: 2
Unit price of the variant when ordered
Example: 29.99
Formatted unit price with currency
Example: “$29.99”
Total price for this line item (quantity * price)
Example: 59.98
Formatted total price with currency
Example: “$59.98”
Sum of all adjustments for this line item
Example: -5.00
Formatted adjustment total with currency
Example: ”-$5.00”
Sum of additional tax amounts
Example: 4.50
Sum of included tax amounts
Example: 2.75
Sum of promotion adjustments
Example: -10.00
Formatted promotion total with currency
Example: ”-$10.00”
Associated order ID
Example: 456
Associated product variant
Show properties
Show properties
Variant ID
Example: 123
Stock Keeping Unit - unique identifier for the variant
Example: “ABC-123”
Name of the variant (inherited from product)
Example: “Basic T-Shirt”
Formatted string of option values
Example: “Size: Large, Color: Blue”
Full descriptive name including master status or options
Example: “Basic T-Shirt - Size: Large, Color: Blue”
Base price of the variant
Example: 29.99
Formatted price with currency
Example: “$29.99”
Weight of the variant
Example: 1.5
Height of the variant
Example: 10.0
Width of the variant
Example: 5.0
Depth of the variant
Example: 2.0
Whether this is the master variant of the product
Example: false
Display order position
Example: 1
Whether inventory tracking is enabled for this variant
Example: true
Whether the variant is available for purchase (not discontinued and product is available)
Example: true
Whether the variant currently has stock available
Example: true
ID of the associated tax category
Example: 1
Cost price of the variant
Example: 15.00
Currency of the cost price
Example: “USD”
ID of the associated product
Example: 456
Currency of the line item
Example: “USD”
nil
.
Order is automatically created when a user adds a product to the cart.
current_store
Show Properties
Show Properties
Store name
Example: “My Store”
Store URL
Example:
https://mystore.com
Unique store identifier
Example:
my-store
Email address used for sending emails
Example:
[email protected]
Default store currency
Example:
USD
List of supported currencies
Example:
USD,EUR,GBP
Default store locale
Example:
en
List of supported locales
Example:
en,es,fr
Default country ID
Example:
1
Default country
Show properties
Show properties
Country ID
Example: 1
Country name
Example:
United States
Country ISO3 code
Example:
USA
Country ISO code
Example:
US
Country ISO name
Example:
UNITED STATES
Whether states are required for this country
Example:
true
Whether zipcodes are required for this country
Example:
true
Checkout zone ID
Example:
2
SEO title
Example:
My Amazing Store
Meta description for SEO
Example:
The best products at the best prices
current_theme
Show properties
Show properties
Theme ID
Example: 1
Theme name
Example:
Winter Sale Theme
Checkout sidebar text color
Example:
#000000
Custom font code
Example:
@import url('https://fonts.googleapis.com/css2?family=Inter&display=swap');
Font family
Example:
Inter
Font size scale
Example:
100
Header font family
Example:
Inter
Header font size scale
Example:
100
Headings uppercase
Example:
true
Button border thickness
Example:
1
Button border opacity
Example:
100
Button border radius
Example:
100
Button shadow opacity
Example:
0
Button shadow horizontal offset
Example:
0
Button shadow vertical offset
Example:
4
Button shadow blur
Example:
5
Input border thickness
Example:
1
Input border opacity
Example:
100
Input border radius
Example:
8
Input shadow opacity
Example:
0
Input shadow horizontal offset
Example:
0
Input shadow vertical offset
Example:
4
Input shadow blur
Example:
5
Border width
Example:
1
Border radius
Example:
6
Border shadow opacity
Example:
0
Border shadow horizontal offset
Example:
0
Border shadow vertical offset
Example:
4
Border shadow blur
Example:
5
Product listing image height
Example:
300
Product listing image width
Example:
300
Product listing image height mobile
Example:
190
Product listing image width mobile
Example:
190
Primary color
Example:
#000000
Accent color
Example:
#F0EFE9
Danger color
Example:
#C73528
Neutral color
Example:
#999999
Background color
Example:
#FFFFFF
Text color
Example:
#000000
Success color
Example:
#00C773
Button background color
Example:
#000000
Button text color
Example:
#ffffff
Button hover background color
Example:
#000000
Button hover text color
Example:
#ffffff
Button border color
Example:
#000000
Border color
Example:
#E9E7DC
Sidebar border color
Example:
#E9E7DC
Secondary button background color
Example:
#000000
Secondary button text color
Example:
#ffffff
Secondary button hover background color
Example:
#000000
Secondary button hover text color
Example:
#ffffff
Input text color
Example:
#6b7280
Input background color
Example:
#ffffff
Input border color
Example:
#000000
Input focus border color
Example:
#000000
Input focus background color
Example:
#ffffff
Input focus text color
Example:
#000000
Checkout sidebar background color
Example:
#f3f4f6
Checkout divider background color
Example:
#f3f4f6
Checkout sidebar text color
Example:
#000000
local_time
Displays a time in the user’s timezone in a human readable format (based on the browser’s timezone).
Copy
Ask AI
<%= local_time(order.sent_to_erp_at) %>
supported_currencies
Returns the list of supported currencies for the current store as an array of strings.
Copy
Ask AI
<%= supported_currencies %>
Copy
Ask AI
["USD", "EUR"]
try_spree_current_user
Show properties
Show properties
User ID
Example: 123
User email address
Example:
[email protected]
User first name
Example:
John
User last name
Example:
Doe
Default billing address object
Show properties
Show properties
Address ID
Example: 456
Address line 1
Example:
123 Main St
Address line 2
Example:
Apt 1
City
Example:
Anytown
Zipcode
Example:
12345
State name, used when the country doesn’t require a state object
Example:
Some Province
Returns either state.name (if state is present) or state_name
Example:
California
or Some Province
Country name
Example:
United States
Country ISO code
Example:
US
Country object
Show properties
Show properties
Country ID
Example: 1
Country name
Example:
United States
Country ISO3 code
Example:
USA
Country ISO code
Example:
US
Country ISO name
Example:
UNITED STATES
Whether states are required for this country
Example:
true
Whether zipcodes are required for this country
Example:
true
Default shipping address object
Show properties
Show properties
Address ID
Example: 456
Address line 1
Example:
123 Main St
Address line 2
Example:
Apt 1
City
Example:
Anytown
Zipcode
Example:
12345
State name, used when the country doesn’t require a state object
Example:
Some Province
Returns either state.name (if state is present) or state_name
Example:
California
or Some Province
Country name
Example:
United States
Country ISO code
Example:
US
Country object
Show properties
Show properties
Country ID
Example: 1
Country name
Example:
United States
Country ISO3 code
Example:
USA
Country ISO code
Example:
US
Country ISO name
Example:
UNITED STATES
Whether states are required for this country
Example:
true
Whether zipcodes are required for this country
Example:
true
User tags (tags are used manageable by store admins)
Example:
Copy
Ask AI
["vip", "wholesale"]
Spree.admin_user_class
configuration). If the user is not signed in, it will return nil
.
If you want to check if the user is signed in, you can use the following:
Copy
Ask AI
<%= try_spree_current_user.present? %>