> ## Documentation Index
> Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Storefront Helper Methods

Here you can find a list of helper methods provided by Spree that are available in the Storefront. These methods can be used in every template.

## Context Helpers

### `current_store`

<ResponseField name="current_store" type="Spree::Store" description="The current store object.">
  <Expandable title="Properties">
    <ResponseField name="name" type="string">
      Store name
      Example: "My Store"
    </ResponseField>

    <ResponseField name="url" type="string">
      Store URL
      Example: `https://mystore.com`
    </ResponseField>

    <ResponseField name="code" type="string">
      Unique store identifier
      Example: `my-store`
    </ResponseField>

    <ResponseField name="mail_from_address" type="string">
      Email address used for sending emails
      Example: `store@example.com`
    </ResponseField>

    <ResponseField name="default_currency" type="string">
      Default store currency
      Example: `USD`
    </ResponseField>

    <ResponseField name="supported_currencies" type="string">
      List of supported currencies
      Example: `USD,EUR,GBP`
    </ResponseField>

    <ResponseField name="default_locale" type="string">
      Default store locale
      Example: `en`
    </ResponseField>

    <ResponseField name="supported_locales" type="string">
      List of supported locales
      Example: `en,es,fr`
    </ResponseField>

    <ResponseField name="default_country_id" type="integer">
      Default country ID
      Example: `1`
    </ResponseField>

    <ResponseField name="default_country" type="Spree::Country">
      Default country

      <Expandable title="properties">
        <ResponseField name="id" type="integer">
          Country ID
          Example: 1
        </ResponseField>

        <ResponseField name="name" type="string">
          Country name
          Example: `United States`
        </ResponseField>

        <ResponseField name="iso3" type="string">
          Country ISO3 code
          Example: `USA`
        </ResponseField>

        <ResponseField name="iso" type="string">
          Country ISO code
          Example: `US`
        </ResponseField>

        <ResponseField name="iso_name" type="string">
          Country ISO name
          Example: `UNITED STATES`
        </ResponseField>

        <ResponseField name="states_required" type="boolean">
          Whether states are required for this country
          Example: `true`
        </ResponseField>

        <ResponseField name="zipcode_required" type="boolean">
          Whether zipcodes are required for this country
          Example: `true`
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="checkout_zone_id" type="integer">
      Checkout zone ID
      Example: `2`
    </ResponseField>

    <ResponseField name="seo_title" type="string">
      SEO title
      Example: `My Amazing Store`
    </ResponseField>

    <ResponseField name="meta_description" type="string">
      Meta description for SEO
      Example: `The best products at the best prices`
    </ResponseField>
  </Expandable>
</ResponseField>

Returns the current store [Spree::Store](https://github.com/spree/spree/blob/master/core/app/models/spree/store.rb) instance.

### `current_theme`

<ResponseField name="current_theme" type="Spree::Theme" description="The current theme object.">
  <Expandable title="properties">
    <ResponseField name="id" type="integer">
      Theme ID
      Example: 1
    </ResponseField>

    <ResponseField name="name" type="string">
      Theme name
      Example: `Winter Sale Theme`
    </ResponseField>

    <ResponseField name="preferred_checkout_sidebar_text_color" type="string">
      Checkout sidebar text color
      Example: `#000000`
    </ResponseField>

    <ResponseField name="preferred_custom_font_code" type="string">
      Custom font code
      Example: `@import url('https://fonts.googleapis.com/css2?family=Inter&display=swap');`
    </ResponseField>

    <ResponseField name="preferred_font_family" type="string">
      Font family
      Example: `Inter`
    </ResponseField>

    <ResponseField name="preferred_font_size_scale" type="integer">
      Font size scale
      Example: `100`
    </ResponseField>

    <ResponseField name="preferred_header_font_family" type="string">
      Header font family
      Example: `Inter`
    </ResponseField>

    <ResponseField name="preferred_header_font_size_scale" type="integer">
      Header font size scale
      Example: `100`
    </ResponseField>

    <ResponseField name="preferred_headings_uppercase" type="boolean">
      Headings uppercase
      Example: `true`
    </ResponseField>

    <ResponseField name="preferred_button_border_thickness" type="integer">
      Button border thickness
      Example: `1`
    </ResponseField>

    <ResponseField name="preferred_button_border_opacity" type="integer">
      Button border opacity
      Example: `100`
    </ResponseField>

    <ResponseField name="preferred_button_border_radius" type="integer">
      Button border radius
      Example: `100`
    </ResponseField>

    <ResponseField name="preferred_button_shadow_opacity" type="integer">
      Button shadow opacity
      Example: `0`
    </ResponseField>

    <ResponseField name="preferred_button_shadow_horizontal_offset" type="integer">
      Button shadow horizontal offset
      Example: `0`
    </ResponseField>

    <ResponseField name="preferred_button_shadow_vertical_offset" type="integer">
      Button shadow vertical offset
      Example: `4`
    </ResponseField>

    <ResponseField name="preferred_button_shadow_blur" type="integer">
      Button shadow blur
      Example: `5`
    </ResponseField>

    <ResponseField name="preferred_input_border_thickness" type="integer">
      Input border thickness
      Example: `1`
    </ResponseField>

    <ResponseField name="preferred_input_border_opacity" type="integer">
      Input border opacity
      Example: `100`
    </ResponseField>

    <ResponseField name="preferred_input_border_radius" type="integer">
      Input border radius
      Example: `8`
    </ResponseField>

    <ResponseField name="preferred_input_shadow_opacity" type="integer">
      Input shadow opacity
      Example: `0`
    </ResponseField>

    <ResponseField name="preferred_input_shadow_horizontal_offset" type="integer">
      Input shadow horizontal offset
      Example: `0`
    </ResponseField>

    <ResponseField name="preferred_input_shadow_vertical_offset" type="integer">
      Input shadow vertical offset
      Example: `4`
    </ResponseField>

    <ResponseField name="preferred_input_shadow_blur" type="integer">
      Input shadow blur
      Example: `5`
    </ResponseField>

    <ResponseField name="preferred_border_width" type="integer">
      Border width
      Example: `1`
    </ResponseField>

    <ResponseField name="preferred_border_radius" type="integer">
      Border radius
      Example: `6`
    </ResponseField>

    <ResponseField name="preferred_border_shadow_opacity" type="integer">
      Border shadow opacity
      Example: `0`
    </ResponseField>

    <ResponseField name="preferred_border_shadow_horizontal_offset" type="integer">
      Border shadow horizontal offset
      Example: `0`
    </ResponseField>

    <ResponseField name="preferred_border_shadow_vertical_offset" type="integer">
      Border shadow vertical offset
      Example: `4`
    </ResponseField>

    <ResponseField name="preferred_border_shadow_blur" type="integer">
      Border shadow blur
      Example: `5`
    </ResponseField>

    <ResponseField name="preferred_product_listing_image_height" type="integer">
      Product listing image height
      Example: `300`
    </ResponseField>

    <ResponseField name="preferred_product_listing_image_width" type="integer">
      Product listing image width
      Example: `300`
    </ResponseField>

    <ResponseField name="preferred_product_listing_image_height_mobile" type="integer">
      Product listing image height mobile
      Example: `190`
    </ResponseField>

    <ResponseField name="preferred_product_listing_image_width_mobile" type="integer">
      Product listing image width mobile
      Example: `190`
    </ResponseField>

    <ResponseField name="preferred_primary_color" type="string">
      Primary color
      Example: `#000000`
    </ResponseField>

    <ResponseField name="preferred_accent_color" type="string">
      Accent color
      Example: `#F0EFE9`
    </ResponseField>

    <ResponseField name="preferred_danger_color" type="string">
      Danger color
      Example: `#C73528`
    </ResponseField>

    <ResponseField name="preferred_neutral_color" type="string">
      Neutral color
      Example: `#999999`
    </ResponseField>

    <ResponseField name="preferred_background_color" type="string">
      Background color
      Example: `#FFFFFF`
    </ResponseField>

    <ResponseField name="preferred_text_color" type="string">
      Text color
      Example: `#000000`
    </ResponseField>

    <ResponseField name="preferred_success_color" type="string">
      Success color
      Example: `#00C773`
    </ResponseField>

    <ResponseField name="preferred_button_background_color" type="string">
      Button background color
      Example: `#000000`
    </ResponseField>

    <ResponseField name="preferred_button_text_color" type="string">
      Button text color
      Example: `#ffffff`
    </ResponseField>

    <ResponseField name="preferred_button_hover_background_color" type="string">
      Button hover background color
      Example: `#000000`
    </ResponseField>

    <ResponseField name="preferred_button_hover_text_color" type="string">
      Button hover text color
      Example: `#ffffff`
    </ResponseField>

    <ResponseField name="preferred_button_border_color" type="string">
      Button border color
      Example: `#000000`
    </ResponseField>

    <ResponseField name="preferred_border_color" type="string">
      Border color
      Example: `#E9E7DC`
    </ResponseField>

    <ResponseField name="preferred_sidebar_border_color" type="string">
      Sidebar border color
      Example: `#E9E7DC`
    </ResponseField>

    <ResponseField name="preferred_secondary_button_background_color" type="string">
      Secondary button background color
      Example: `#000000`
    </ResponseField>

    <ResponseField name="preferred_secondary_button_text_color" type="string">
      Secondary button text color
      Example: `#ffffff`
    </ResponseField>

    <ResponseField name="preferred_secondary_button_hover_background_color" type="string">
      Secondary button hover background color
      Example: `#000000`
    </ResponseField>

    <ResponseField name="preferred_secondary_button_hover_text_color" type="string">
      Secondary button hover text color
      Example: `#ffffff`
    </ResponseField>

    <ResponseField name="preferred_input_text_color" type="string">
      Input text color
      Example: `#6b7280`
    </ResponseField>

    <ResponseField name="preferred_input_background_color" type="string">
      Input background color
      Example: `#ffffff`
    </ResponseField>

    <ResponseField name="preferred_input_border_color" type="string">
      Input border color
      Example: `#000000`
    </ResponseField>

    <ResponseField name="preferred_input_focus_border_color" type="string">
      Input focus border color
      Example: `#000000`
    </ResponseField>

    <ResponseField name="preferred_input_focus_background_color" type="string">
      Input focus background color
      Example: `#ffffff`
    </ResponseField>

    <ResponseField name="preferred_input_focus_text_color" type="string">
      Input focus text color
      Example: `#000000`
    </ResponseField>

    <ResponseField name="preferred_checkout_sidebar_background_color" type="string">
      Checkout sidebar background color
      Example: `#f3f4f6`
    </ResponseField>

    <ResponseField name="preferred_checkout_divider_background_color" type="string">
      Checkout divider background color
      Example: `#f3f4f6`
    </ResponseField>

    <ResponseField name="preferred_checkout_sidebar_text_color" type="string">
      Checkout sidebar text color
      Example: `#000000`
    </ResponseField>
  </Expandable>
</ResponseField>

Returns the current theme [Spree::Theme](https://github.com/spree/spree/blob/master/core/app/models/spree/theme.rb) instance.

### `current_page`

Returns the current [Spree::Page](https://github.com/spree/spree/blob/main/core/app/models/spree/page.rb) instance for the current route.

```erb theme={"theme":"night-owl"}
<%= current_page.name %>
```

### `current_order`

<ResponseField name="current_order" type="Spree::Order" description="The current order object.">
  <Expandable title="properties">
    <ResponseField name="number" type="string">
      The order number
      Example: `R123456789`
    </ResponseField>

    <ResponseField name="total" type="decimal">
      The total amount of the order
      Example: 99.99
    </ResponseField>

    <ResponseField name="display_total" type="string">
      Formatted total with currency
      Example: "\$99.99"
    </ResponseField>

    <ResponseField name="item_total" type="decimal">
      Sum of all line item amounts pre-tax
      Example: 89.99
    </ResponseField>

    <ResponseField name="display_item_total" type="string">
      Formatted item total with currency
      Example: "\$89.99"
    </ResponseField>

    <ResponseField name="adjustment_total" type="decimal">
      Sum of all adjustments
      Example: -10.00
    </ResponseField>

    <ResponseField name="display_adjustment_total" type="string">
      Formatted adjustment total with currency
      Example: "-\$10.00"
    </ResponseField>

    <ResponseField name="tax_total" type="decimal">
      Sum of all tax amounts
      Example: 13.25
    </ResponseField>

    <ResponseField name="display_tax_total" type="string">
      Formatted tax total with currency
      Example: "\$13.25"
    </ResponseField>

    <ResponseField name="shipment_total" type="decimal">
      Sum of shipment amounts
      Example: 10.00
    </ResponseField>

    <ResponseField name="display_shipment_total" type="string">
      Formatted shipment total with currency
      Example: "\$10.00"
    </ResponseField>

    <ResponseField name="promo_total" type="decimal">
      Sum of all promotion adjustments
      Example: -15.00
    </ResponseField>

    <ResponseField name="display_promo_total" type="string">
      Formatted promotion total with currency
      Example: "-\$15.00"
    </ResponseField>

    <ResponseField name="included_tax_total" type="decimal">
      Sum of included tax amounts
      Example: 8.25
    </ResponseField>

    <ResponseField name="additional_tax_total" type="decimal">
      Sum of additional tax amounts
      Example: 5.00
    </ResponseField>

    <ResponseField name="payment_total" type="decimal">
      Sum of completed payment amounts
      Example: 99.99
    </ResponseField>

    <ResponseField name="state" type="string">
      Current order state
      Example: `cart`
    </ResponseField>

    <ResponseField name="email" type="string">
      Customer email address
      Example: `customer@example.com`
    </ResponseField>

    <ResponseField name="user_id" type="integer">
      Associated user ID
      Example: 123
    </ResponseField>

    <ResponseField name="user" type="Spree::User">
      Associated user object

      <Expandable title="properties">
        <ResponseField name="id" type="integer">
          User ID
          Example: 123
        </ResponseField>

        <ResponseField name="email" type="string">
          User email address
          Example: `customer@example.com`
        </ResponseField>

        <ResponseField name="first_name" type="string">
          User first name
          Example: `John`
        </ResponseField>

        <ResponseField name="last_name" type="string">
          User last name
          Example: `Doe`
        </ResponseField>

        <ResponseField name="bill_address" type="Spree::Address">
          Default billing address object

          <Expandable title="properties">
            <ResponseField name="id" type="integer">
              Address ID
              Example: 456
            </ResponseField>

            <ResponseField name="address1" type="string">
              Address line 1
              Example: `123 Main St`
            </ResponseField>

            <ResponseField name="address2" type="string">
              Address line 2
              Example: `Apt 1`
            </ResponseField>

            <ResponseField name="city" type="string">
              City
              Example: `Anytown`
            </ResponseField>

            <ResponseField name="zipcode" type="string">
              Zipcode
              Example: `12345`
            </ResponseField>

            <ResponseField name="state" type="Spree::State">
              State object, if the country requires a state.

              <Expandable title="properties">
                <ResponseField name="id" type="integer">
                  State ID
                  Example: 1
                </ResponseField>

                <ResponseField name="name" type="string">
                  State name
                  Example: `California`
                </ResponseField>

                <ResponseField name="abbr" type="string">
                  State abbreviation
                  Example: `CA`
                </ResponseField>

                <ResponseField name="country_id" type="integer">
                  Country ID
                  Example: 1
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name="state_name" type="string">
              State name, used when the country doesn't require a state object
              Example: `Some Province`
            </ResponseField>

            <ResponseField name="state_text" type="string">
              Returns either state.name (if state is present) or state\_name
              Example: `California` or `Some Province`
            </ResponseField>

            <ResponseField name="country_name" type="string">
              Country name
              Example: `United States`
            </ResponseField>

            <ResponseField name="country_iso" type="string">
              Country ISO code
              Example: `US`
            </ResponseField>

            <ResponseField name="country" type="Spree::Country">
              Country object

              <Expandable title="properties">
                <ResponseField name="id" type="integer">
                  Country ID
                  Example: 1
                </ResponseField>

                <ResponseField name="name" type="string">
                  Country name
                  Example: `United States`
                </ResponseField>

                <ResponseField name="iso3" type="string">
                  Country ISO3 code
                  Example: `USA`
                </ResponseField>

                <ResponseField name="iso" type="string">
                  Country ISO code
                  Example: `US`
                </ResponseField>

                <ResponseField name="iso_name" type="string">
                  Country ISO name
                  Example: `UNITED STATES`
                </ResponseField>

                <ResponseField name="states_required" type="boolean">
                  Whether states are required for this country
                  Example: `true`
                </ResponseField>

                <ResponseField name="zipcode_required" type="boolean">
                  Whether zipcodes are required for this country
                  Example: `true`
                </ResponseField>
              </Expandable>
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="ship_address" type="Spree::Address">
          Default shipping address object

          <Expandable title="properties">
            <ResponseField name="id" type="integer">
              Address ID
              Example: 456
            </ResponseField>

            <ResponseField name="address1" type="string">
              Address line 1
              Example: `123 Main St`
            </ResponseField>

            <ResponseField name="address2" type="string">
              Address line 2
              Example: `Apt 1`
            </ResponseField>

            <ResponseField name="city" type="string">
              City
              Example: `Anytown`
            </ResponseField>

            <ResponseField name="zipcode" type="string">
              Zipcode
              Example: `12345`
            </ResponseField>

            <ResponseField name="state" type="Spree::State">
              State object, if the country requires a state.

              <Expandable title="properties">
                <ResponseField name="id" type="integer">
                  State ID
                  Example: 1
                </ResponseField>

                <ResponseField name="name" type="string">
                  State name
                  Example: `California`
                </ResponseField>

                <ResponseField name="abbr" type="string">
                  State abbreviation
                  Example: `CA`
                </ResponseField>

                <ResponseField name="country_id" type="integer">
                  Country ID
                  Example: 1
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name="state_name" type="string">
              State name, used when the country doesn't require a state object
              Example: `Some Province`
            </ResponseField>

            <ResponseField name="state_text" type="string">
              Returns either state.name (if state is present) or state\_name
              Example: `California` or `Some Province`
            </ResponseField>

            <ResponseField name="country_name" type="string">
              Country name
              Example: `United States`
            </ResponseField>

            <ResponseField name="country_iso" type="string">
              Country ISO code
              Example: `US`
            </ResponseField>

            <ResponseField name="country" type="Spree::Country">
              Country object

              <Expandable title="properties">
                <ResponseField name="id" type="integer">
                  Country ID
                  Example: 1
                </ResponseField>

                <ResponseField name="name" type="string">
                  Country name
                  Example: `United States`
                </ResponseField>

                <ResponseField name="iso3" type="string">
                  Country ISO3 code
                  Example: `USA`
                </ResponseField>

                <ResponseField name="iso" type="string">
                  Country ISO code
                  Example: `US`
                </ResponseField>

                <ResponseField name="iso_name" type="string">
                  Country ISO name
                  Example: `UNITED STATES`
                </ResponseField>

                <ResponseField name="states_required" type="boolean">
                  Whether states are required for this country
                  Example: `true`
                </ResponseField>

                <ResponseField name="zipcode_required" type="boolean">
                  Whether zipcodes are required for this country
                  Example: `true`
                </ResponseField>
              </Expandable>
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="tag_list" type="array">
          User tags (tags are used manageable by store admins)
          Example:

          ```ruby theme={"theme":"night-owl"}
          ["vip", "wholesale"]
          ```
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="completed_at" type="datetime">
      When the order was completed (placed and paid). For orders in `cart` state, this will be `nil`.
      Example: `2023-06-15 13:45:00`
    </ResponseField>

    <ResponseField name="bill_address_id" type="integer">
      Billing address ID
      Example: 456
    </ResponseField>

    <ResponseField name="bill_address" type="Spree::Address">
      Billing address object

      <Expandable title="properties">
        <ResponseField name="id" type="integer">
          Address ID
          Example: 456
        </ResponseField>

        <ResponseField name="address1" type="string">
          Address line 1
          Example: `123 Main St`
        </ResponseField>

        <ResponseField name="address2" type="string">
          Address line 2
          Example: `Apt 1`
        </ResponseField>

        <ResponseField name="city" type="string">
          City
          Example: `Anytown`
        </ResponseField>

        <ResponseField name="zipcode" type="string">
          Zipcode
          Example: `12345`
        </ResponseField>

        <ResponseField name="state" type="Spree::State">
          State object, if the country requires a state.

          <Expandable title="properties">
            <ResponseField name="id" type="integer">
              State ID
              Example: 1
            </ResponseField>

            <ResponseField name="name" type="string">
              State name
              Example: `California`
            </ResponseField>

            <ResponseField name="abbr" type="string">
              State abbreviation
              Example: `CA`
            </ResponseField>

            <ResponseField name="country_id" type="integer">
              Country ID
              Example: 1
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="state_name" type="string">
          State name, used when the country doesn't require a state object
          Example: `Some Province`
        </ResponseField>

        <ResponseField name="state_text" type="string">
          Returns either state.name (if state is present) or state\_name
          Example: `California` or `Some Province`
        </ResponseField>

        <ResponseField name="country_name" type="string">
          Country name
          Example: `United States`
        </ResponseField>

        <ResponseField name="country_iso" type="string">
          Country ISO code
          Example: `US`
        </ResponseField>

        <ResponseField name="country" type="Spree::Country">
          Country object

          <Expandable title="properties">
            <ResponseField name="id" type="integer">
              Country ID
              Example: 1
            </ResponseField>

            <ResponseField name="name" type="string">
              Country name
              Example: `United States`
            </ResponseField>

            <ResponseField name="iso3" type="string">
              Country ISO3 code
              Example: `USA`
            </ResponseField>

            <ResponseField name="iso" type="string">
              Country ISO code
              Example: `US`
            </ResponseField>

            <ResponseField name="iso_name" type="string">
              Country ISO name
              Example: `UNITED STATES`
            </ResponseField>

            <ResponseField name="states_required" type="boolean">
              Whether states are required for this country
              Example: `true`
            </ResponseField>

            <ResponseField name="zipcode_required" type="boolean">
              Whether zipcodes are required for this country
              Example: `true`
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="ship_address_id" type="integer">
      Shipping address ID
      Example: 457
    </ResponseField>

    <ResponseField name="ship_address" type="Spree::Address">
      Shipping address object

      <Expandable title="properties">
        <ResponseField name="id" type="integer">
          Address ID
          Example: 456
        </ResponseField>

        <ResponseField name="address1" type="string">
          Address line 1
          Example: `123 Main St`
        </ResponseField>

        <ResponseField name="address2" type="string">
          Address line 2
          Example: `Apt 1`
        </ResponseField>

        <ResponseField name="city" type="string">
          City
          Example: `Anytown`
        </ResponseField>

        <ResponseField name="zipcode" type="string">
          Zipcode
          Example: `12345`
        </ResponseField>

        <ResponseField name="state" type="Spree::State">
          State object, if the country requires a state.

          <Expandable title="properties">
            <ResponseField name="id" type="integer">
              State ID
              Example: 1
            </ResponseField>

            <ResponseField name="name" type="string">
              State name
              Example: `California`
            </ResponseField>

            <ResponseField name="abbr" type="string">
              State abbreviation
              Example: `CA`
            </ResponseField>

            <ResponseField name="country_id" type="integer">
              Country ID
              Example: 1
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="state_name" type="string">
          State name, used when the country doesn't require a state object
          Example: `Some Province`
        </ResponseField>

        <ResponseField name="state_text" type="string">
          Returns either state.name (if state is present) or state\_name
          Example: `California` or `Some Province`
        </ResponseField>

        <ResponseField name="country_name" type="string">
          Country name
          Example: `United States`
        </ResponseField>

        <ResponseField name="country_iso" type="string">
          Country ISO code
          Example: `US`
        </ResponseField>

        <ResponseField name="country" type="Spree::Country">
          Country object

          <Expandable title="properties">
            <ResponseField name="id" type="integer">
              Country ID
              Example: 1
            </ResponseField>

            <ResponseField name="name" type="string">
              Country name
              Example: `United States`
            </ResponseField>

            <ResponseField name="iso3" type="string">
              Country ISO3 code
              Example: `USA`
            </ResponseField>

            <ResponseField name="iso" type="string">
              Country ISO code
              Example: `US`
            </ResponseField>

            <ResponseField name="iso_name" type="string">
              Country ISO name
              Example: `UNITED STATES`
            </ResponseField>

            <ResponseField name="states_required" type="boolean">
              Whether states are required for this country
              Example: `true`
            </ResponseField>

            <ResponseField name="zipcode_required" type="boolean">
              Whether zipcodes are required for this country
              Example: `true`
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="payment_state" type="string">
      Payment state (balance\_due, credit\_owed, failed, paid, void)
      Example: `paid`
    </ResponseField>

    <ResponseField name="shipment_state" type="string">
      Shipment state (backorder, canceled, partial, pending, ready, shipped)
      Example: `shipped`
    </ResponseField>

    <ResponseField name="currency" type="string">
      Order currency
      Example: `USD`
    </ResponseField>

    <ResponseField name="store_id" type="integer">
      Associated store ID
      Example: 1
    </ResponseField>

    <ResponseField name="items" type="array">
      Line items in the order

      <Expandable title="properties">
        <ResponseField name="id" type="integer">
          Line item ID
          Example: 123
        </ResponseField>

        <ResponseField name="quantity" type="integer">
          Quantity of the variant ordered
          Example: 2
        </ResponseField>

        <ResponseField name="price" type="decimal">
          Unit price of the variant when ordered
          Example: 29.99
        </ResponseField>

        <ResponseField name="display_price" type="string">
          Formatted unit price with currency
          Example: "\$29.99"
        </ResponseField>

        <ResponseField name="total" type="decimal">
          Total price for this line item (quantity \* price)
          Example: 59.98
        </ResponseField>

        <ResponseField name="display_total" type="string">
          Formatted total price with currency
          Example: "\$59.98"
        </ResponseField>

        <ResponseField name="adjustment_total" type="decimal">
          Sum of all adjustments for this line item
          Example: -5.00
        </ResponseField>

        <ResponseField name="display_adjustment_total" type="string">
          Formatted adjustment total with currency
          Example: "-\$5.00"
        </ResponseField>

        <ResponseField name="additional_tax_total" type="decimal">
          Sum of additional tax amounts
          Example: 4.50
        </ResponseField>

        <ResponseField name="included_tax_total" type="decimal">
          Sum of included tax amounts
          Example: 2.75
        </ResponseField>

        <ResponseField name="promo_total" type="decimal">
          Sum of promotion adjustments
          Example: -10.00
        </ResponseField>

        <ResponseField name="display_promo_total" type="string">
          Formatted promotion total with currency
          Example: "-\$10.00"
        </ResponseField>

        <ResponseField name="order_id" type="integer">
          Associated order ID
          Example: 456
        </ResponseField>

        <ResponseField name="variant" type="Spree::Variant">
          Associated product variant

          <Expandable title="properties">
            <ResponseField name="id" type="integer">
              Variant ID
              Example: 123
            </ResponseField>

            <ResponseField name="sku" type="string">
              Stock Keeping Unit - unique identifier for the variant
              Example: "ABC-123"
            </ResponseField>

            <ResponseField name="name" type="string">
              Name of the variant (inherited from product)
              Example: "Basic T-Shirt"
            </ResponseField>

            <ResponseField name="options_text" type="string">
              Formatted string of option values
              Example: "Size: Large, Color: Blue"
            </ResponseField>

            <ResponseField name="descriptive_name" type="string">
              Full descriptive name including master status or options
              Example: "Basic T-Shirt - Size: Large, Color: Blue"
            </ResponseField>

            <ResponseField name="price" type="decimal">
              Base price of the variant
              Example: 29.99
            </ResponseField>

            <ResponseField name="display_price" type="string">
              Formatted price with currency
              Example: "\$29.99"
            </ResponseField>

            <ResponseField name="weight" type="decimal">
              Weight of the variant
              Example: 1.5
            </ResponseField>

            <ResponseField name="height" type="decimal">
              Height of the variant
              Example: 10.0
            </ResponseField>

            <ResponseField name="width" type="decimal">
              Width of the variant
              Example: 5.0
            </ResponseField>

            <ResponseField name="depth" type="decimal">
              Depth of the variant
              Example: 2.0
            </ResponseField>

            <ResponseField name="is_master" type="boolean">
              Whether this is the master variant of the product
              Example: false
            </ResponseField>

            <ResponseField name="position" type="integer">
              Display order position
              Example: 1
            </ResponseField>

            <ResponseField name="track_inventory" type="boolean">
              Whether inventory tracking is enabled for this variant
              Example: true
            </ResponseField>

            <ResponseField name="available?" type="boolean">
              Whether the variant is available for purchase (not discontinued and product is available)
              Example: true
            </ResponseField>

            <ResponseField name="in_stock?" type="boolean">
              Whether the variant currently has stock available
              Example: true
            </ResponseField>

            <ResponseField name="tax_category_id" type="integer">
              ID of the associated tax category
              Example: 1
            </ResponseField>

            <ResponseField name="cost_price" type="decimal">
              Cost price of the variant
              Example: 15.00
            </ResponseField>

            <ResponseField name="cost_currency" type="string">
              Currency of the cost price
              Example: "USD"
            </ResponseField>

            <ResponseField name="product_id" type="integer">
              ID of the associated product
              Example: 456
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="currency" type="string">
          Currency of the line item
          Example: "USD"
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

Returns the current order object. If no order is found, it will return `nil`.

<Tip>
  Order is automatically created when a user adds a product to the cart.
</Tip>

### `try_spree_current_user`

<ResponseField name="try_spree_current_user" type="Spree.user_class" description="The current user object.">
  <Expandable title="properties">
    <ResponseField name="id" type="integer">
      User ID
      Example: 123
    </ResponseField>

    <ResponseField name="email" type="string">
      User email address
      Example: `customer@example.com`
    </ResponseField>

    <ResponseField name="first_name" type="string">
      User first name
      Example: `John`
    </ResponseField>

    <ResponseField name="last_name" type="string">
      User last name
      Example: `Doe`
    </ResponseField>

    <ResponseField name="bill_address" type="Spree::Address">
      Default billing address object

      <Expandable title="properties">
        <ResponseField name="id" type="integer">
          Address ID
          Example: 456
        </ResponseField>

        <ResponseField name="address1" type="string">
          Address line 1
          Example: `123 Main St`
        </ResponseField>

        <ResponseField name="address2" type="string">
          Address line 2
          Example: `Apt 1`
        </ResponseField>

        <ResponseField name="city" type="string">
          City
          Example: `Anytown`
        </ResponseField>

        <ResponseField name="zipcode" type="string">
          Zipcode
          Example: `12345`
        </ResponseField>

        <ResponseField name="state" type="Spree::State">
          State object, if the country requires a state.

          <Expandable title="properties">
            <ResponseField name="id" type="integer">
              State ID
              Example: 1
            </ResponseField>

            <ResponseField name="name" type="string">
              State name
              Example: `California`
            </ResponseField>

            <ResponseField name="abbr" type="string">
              State abbreviation
              Example: `CA`
            </ResponseField>

            <ResponseField name="country_id" type="integer">
              Country ID
              Example: 1
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="state_name" type="string">
          State name, used when the country doesn't require a state object
          Example: `Some Province`
        </ResponseField>

        <ResponseField name="state_text" type="string">
          Returns either state.name (if state is present) or state\_name
          Example: `California` or `Some Province`
        </ResponseField>

        <ResponseField name="country_name" type="string">
          Country name
          Example: `United States`
        </ResponseField>

        <ResponseField name="country_iso" type="string">
          Country ISO code
          Example: `US`
        </ResponseField>

        <ResponseField name="country" type="Spree::Country">
          Country object

          <Expandable title="properties">
            <ResponseField name="id" type="integer">
              Country ID
              Example: 1
            </ResponseField>

            <ResponseField name="name" type="string">
              Country name
              Example: `United States`
            </ResponseField>

            <ResponseField name="iso3" type="string">
              Country ISO3 code
              Example: `USA`
            </ResponseField>

            <ResponseField name="iso" type="string">
              Country ISO code
              Example: `US`
            </ResponseField>

            <ResponseField name="iso_name" type="string">
              Country ISO name
              Example: `UNITED STATES`
            </ResponseField>

            <ResponseField name="states_required" type="boolean">
              Whether states are required for this country
              Example: `true`
            </ResponseField>

            <ResponseField name="zipcode_required" type="boolean">
              Whether zipcodes are required for this country
              Example: `true`
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="ship_address" type="Spree::Address">
      Default shipping address object

      <Expandable title="properties">
        <ResponseField name="id" type="integer">
          Address ID
          Example: 456
        </ResponseField>

        <ResponseField name="address1" type="string">
          Address line 1
          Example: `123 Main St`
        </ResponseField>

        <ResponseField name="address2" type="string">
          Address line 2
          Example: `Apt 1`
        </ResponseField>

        <ResponseField name="city" type="string">
          City
          Example: `Anytown`
        </ResponseField>

        <ResponseField name="zipcode" type="string">
          Zipcode
          Example: `12345`
        </ResponseField>

        <ResponseField name="state" type="Spree::State">
          State object, if the country requires a state.

          <Expandable title="properties">
            <ResponseField name="id" type="integer">
              State ID
              Example: 1
            </ResponseField>

            <ResponseField name="name" type="string">
              State name
              Example: `California`
            </ResponseField>

            <ResponseField name="abbr" type="string">
              State abbreviation
              Example: `CA`
            </ResponseField>

            <ResponseField name="country_id" type="integer">
              Country ID
              Example: 1
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="state_name" type="string">
          State name, used when the country doesn't require a state object
          Example: `Some Province`
        </ResponseField>

        <ResponseField name="state_text" type="string">
          Returns either state.name (if state is present) or state\_name
          Example: `California` or `Some Province`
        </ResponseField>

        <ResponseField name="country_name" type="string">
          Country name
          Example: `United States`
        </ResponseField>

        <ResponseField name="country_iso" type="string">
          Country ISO code
          Example: `US`
        </ResponseField>

        <ResponseField name="country" type="Spree::Country">
          Country object

          <Expandable title="properties">
            <ResponseField name="id" type="integer">
              Country ID
              Example: 1
            </ResponseField>

            <ResponseField name="name" type="string">
              Country name
              Example: `United States`
            </ResponseField>

            <ResponseField name="iso3" type="string">
              Country ISO3 code
              Example: `USA`
            </ResponseField>

            <ResponseField name="iso" type="string">
              Country ISO code
              Example: `US`
            </ResponseField>

            <ResponseField name="iso_name" type="string">
              Country ISO name
              Example: `UNITED STATES`
            </ResponseField>

            <ResponseField name="states_required" type="boolean">
              Whether states are required for this country
              Example: `true`
            </ResponseField>

            <ResponseField name="zipcode_required" type="boolean">
              Whether zipcodes are required for this country
              Example: `true`
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="tag_list" type="array">
      User tags (tags are used manageable by store admins)
      Example:

      ```ruby theme={"theme":"night-owl"}
      ["vip", "wholesale"]
      ```
    </ResponseField>
  </Expandable>
</ResponseField>

Returns the current user object (class depends on the `Spree.user_class` configuration). If the user is not signed in, it will return `nil`.

<Tip>
  If you want to check if the user is signed in, you can use the following:

  ```erb theme={"theme":"night-owl"}
  <%= try_spree_current_user.present? %>
  ```
</Tip>

### `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.

```erb theme={"theme":"night-owl"}
<%= current_currency %>
```

will return

```
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.

```erb theme={"theme":"night-owl"}
<%= current_locale %>
```

<Info>
  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`.
</Info>

### `current_taxon`

Returns the current taxon when viewing a category/collection page.

```erb theme={"theme":"night-owl"}
<%= current_taxon&.name %>
```

### `current_wishlist`

Returns the current user's default wishlist for the current store.

```erb theme={"theme":"night-owl"}
<% if current_wishlist.present? %>
  <%= current_wishlist.wished_items.count %> items
<% end %>
```

## Page Rendering Helpers

### `render_page`

Renders a page with all its sections. This is the main method for rendering page content.

```erb theme={"theme":"night-owl"}
<%= render_page(current_page, pickup_locations: @pickup_locations) %>
```

**Parameters:**

* `page` - The page to render (defaults to `current_page`)
* `variables` - Hash of variables to pass to section templates

### `render_section`

Renders a single section.

```erb theme={"theme":"night-owl"}
<%= render_section(section, product: @product) %>
```

### `render_header_sections`

Renders all header sections (announcement bar, header).

```erb theme={"theme":"night-owl"}
<%= render_header_sections %>
```

### `render_footer_sections`

Renders all footer sections (newsletter, footer).

```erb theme={"theme":"night-owl"}
<%= render_footer_sections %>
```

## Section & Block Helpers

### `section_styles`

Returns inline CSS styles for a section based on its preferences (padding, colors, borders).

```erb theme={"theme":"night-owl"}
<div style="<%= section_styles(section) %>">
  <!-- Section content -->
</div>
```

### `block_attributes`

Returns data attributes for a block (used for Page Builder editing).

```erb theme={"theme":"night-owl"}
<h2 <%= block_attributes(block) %>>
  <%= block.text %>
</h2>
```

### `page_builder_enabled?`

Returns `true` when the page is being viewed in Page Builder preview mode.

```erb theme={"theme":"night-owl"}
<% cache_unless page_builder_enabled?, cache_key do %>
  <!-- Cached content -->
<% end %>
```

### `page_builder_link_to`

Renders a link from a `Spree::PageLink` object.

```erb theme={"theme":"night-owl"}
<%= page_builder_link_to section.link, class: 'btn-primary' %>

<%# With custom content %>
<%= page_builder_link_to section.link do %>
  <span class="icon">→</span> Click here
<% end %>
```

## Currency & Price Helpers

### `supported_currencies`

Returns the list of supported currencies for the current store as an array of strings.

```erb theme={"theme":"night-owl"}
<%= supported_currencies %>
```

will return

```ruby theme={"theme":"night-owl"}
["USD", "EUR"]
```

### `display_price`

Displays a formatted price with currency symbol.

```erb theme={"theme":"night-owl"}
<%= display_price(product.price_in(current_currency)) %>
```

## Date & Time Helpers

### `local_time`

Displays a time in the user's timezone in a human readable format (based on the browser's timezone).

```erb theme={"theme":"night-owl"}
<%= local_time(order.sent_to_erp_at) %>
```

Provided by [local\_time gem](https://github.com/basecamp/local_time).

## URL Helpers

### `spree_storefront_resource_url`

Generates a URL for a Spree resource (product, taxon, post, page).

```erb theme={"theme":"night-owl"}
<%= link_to product.name, spree_storefront_resource_url(product) %>
<%= link_to taxon.name, spree_storefront_resource_url(taxon) %>
```

### `spree.nested_taxons_path`

Generates a URL for a taxon using its full permalink.

```erb theme={"theme":"night-owl"}
<%= link_to taxon.name, spree.nested_taxons_path(taxon) %>
<%# => /t/categories/clothing/shirts %>
```

## Image Helpers

### `spree_image_tag`

Renders an optimized image tag with automatic WebP conversion and retina support.

```erb theme={"theme":"night-owl"}
<%= spree_image_tag product.images.first,
    width: 400,
    height: 400,
    alt: product.name,
    loading: :lazy %>
```

### `spree_image_url`

Generates a URL for an image with specified dimensions.

```erb theme={"theme":"night-owl"}
<%= spree_image_url(product.images.first, width: 800, height: 600) %>
```

<Info>
  See [Media](/docs/developer/core-concepts/media) for more details on image helpers.
</Info>

## Product Helpers

### `taxon_products`

Returns products for a given taxon, useful in section templates.

```erb theme={"theme":"night-owl"}
<% taxon_products(section.taxon).limit(4).each do |product| %>
  <%= render 'spree/products/card', product: product %>
<% end %>
```

### `storefront_products`

Returns products based on current filters and sorting.

```erb theme={"theme":"night-owl"}
<% storefront_products.each do |product| %>
  <%= render 'spree/products/card', product: product %>
<% end %>
```

## Cache Helpers

### `spree_storefront_base_cache_key`

Returns the base cache key for storefront caching.

```erb theme={"theme":"night-owl"}
<% cache [spree_storefront_base_cache_key, product] do %>
  <%= render 'product_card', product: product %>
<% end %>
```

### `spree_storefront_base_cache_scope`

Returns a cache scope proc for section caching.

```erb theme={"theme":"night-owl"}
<% cache_unless page_builder_enabled?, spree_storefront_base_cache_scope.call(section) do %>
  <!-- Section content -->
<% end %>
```

## Preview Helpers

These helpers are used for Page Builder preview functionality:

| Helper                     | Description                                  |
| -------------------------- | -------------------------------------------- |
| `current_theme_preview`    | Returns the theme preview if in preview mode |
| `current_page_preview`     | Returns the page preview if in preview mode  |
| `current_theme_or_preview` | Returns theme preview or active theme        |
| `current_page_or_preview`  | Returns page preview or active page          |

## Related Documentation

* [Sections](/docs/developer/storefront/rails/sections) - Section rendering and customization
* [Blocks](/docs/developer/storefront/rails/blocks) - Block rendering
* [Media](/docs/developer/core-concepts/media) - Image helper methods
