Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create a Product column that will display our products. The column will have these option attributes:
    • label, default attribute, that will show the names of our products.
    • price, that will store info about the price of our products.
    • currency, which will store info about our product currency.

    Tip

    Check the following articles for more information:

    Lists in a grid

    Adding option attributes to a list


  2. Add options with products for the Product column. We will enter option attributes we set up earlier, such as price and currency.
  3. Save the column.
  4. Create an Amount column, that will display the amount of products we want to order. It will have a Number column type.
  5. Now, let's create three formula columns:

    • Price — the price of our product.
    • Total price — the total price of our products.
    • Currency — the currency of our order.
    Tip

    For more information, check out Formulas in a grid.

    Each column will have a different formula:

    • The Price column will reuse the data from the price option attribute from the Product column. To do so, we will input the following formula:

      Code Block
      languagejs
      themeFadeToGrey
      return $(product).price

      Formula parameters:

      product — The Identifier of the Product column.

      price — Key of the Price option attribute.

    • The Total price column will multiply the data from the price option attribute by the data from the Amount column. To do this, we will use the formula:

      Code Block
      languagejs
      themeFadeToGrey
      return $(price) * return $(amount)

      price — Identifier of the Price column.

      amount — Identifier of the Amount column.

    • The Currency column will display the data from the currency option attribute from the Product column. We will use the following formula to do this:

      Code Block
      languagejs
      themeFadeToGrey
      return $(product).currency

      Formula parameters:

      productIdentifier of the Product column.

      price — Key of the Price option attribute.

...