Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Pricing Table

Jonathan Tsang edited this page Sep 1, 2017 · 1 revision

Description

Used On

  • Bundle
  • Course Landing
  • Site Landing

Template Markup

<section class="pricing-table {% if section.settings.background_color_preset != 'none' %}{{ section.settings.background_color_preset | append: '-section-color-preset' }}{% endif %}" data-preview-item="pricing-table">
  <div class="container">

    <div class="section__content">

      {% if section.settings.heading != blank %}
        <h3 class="section__heading">{{ section.settings.heading }}</h3>
        {% if section.settings.subheading != blank %}
          <h4 class="section__subheading">{{ section.settings.subheading }}</h4>
        {% endif %}
      {% endif %}

      <div class="pricing-table__list">
      {% for block in section.blocks %}
        <div class="pricing-table__list-item">
          <h5>{{ block.settings.po_price }}</h5>
          <h6>{{ block.settings.po_type }}</h6>
          <a href="{{ block.settings.po_button.links.add_to_cart }}" class="button button-primary">Buy Now</a>
        </div>
      {% endfor %}
      </div>

    </div>

  </div>
</section>

{% style %}
...
{% endstyle %}

{% schema %}
...
{% schema %}

Style

Alignment, Layout & Style modifiers will be encapsulated with {% style %} & {% endstyle %} tags.

section.pricing-table {

  .section__heading,
  .section__subheading {
    text-align: {{ section.settings.heading_alignment }};
  }
}

Schema

Schema will be encapsulated with {% schema %} & {% endschema %} tags.

{
  "label": "Pricing Table",
  "settings": [
    {
      "label": "Headings",
      "settings": [
        {
          "type": "text",
          "id": "heading",
          "label": "Heading",
          "default": "Pricing options"
        },
        {
          "type": "text",
          "id": "subheading",
          "label": "Subheading",
          "default": "Pay once, or save money with our payment plans"
        },
        {
          "type": "radio",
          "id": "heading_alignment",
          "label": "Alignment",
          "description": "Headings will inherit the same alignment",
          "default": "left",
          "options": [
            {
              "value": "left",
              "label": "Left"
            },
            {
              "value": "center",
              "label": "Center"
            },
            {
              "value": "right",
              "label": "Right"
            }
          ]
        }
      ]
    },
    {
      "label": "Background",
      "settings": [
        {
          "type": "select",
          "id": "background_color_preset",
          "label": "Color Preset",
          "description": "Presets can be configured in the Colors configuration menu",
          "default": "primary",
          "options": [
            { "value": "none", "label": "None" },
            { "value": "primary", "label": "Primary" },
            { "value": "secondary", "label": "Secondary" },
            { "value": "tertiary", "label": "Tertiary" }
          ]
        }
      ]
    }
  ],
  "blocks": {
    "label": "Add Pricing option",
    "limit": 9,
    "types": [
      {
        "type": "pricing_option",
        "label": "",
        "settings": [
          {
            "type": "text",
            "id": "po_price",
            "label": "Price"
          },
          {
            "type": "text",
            "id": "po_type",
            "label": "Type"
          },
          {
            "type": "prices_picker",
            "id": "po_button",
            "label": "Product Price"
          }
        ]
      }
    ],
    "defaults": [
      {
        "type": "pricing_option",
        "values": {
          "po_price": "6 x $100.00",
          "po_type": "6 month payment plan",
          "po_button": ""
        }
      },
      {
        "type": "pricing_option",
        "values": {
          "po_price": "$100.00/month",
          "po_type": "Subscription",
          "po_button": ""
        }
      },
      {
        "type": "pricing_option",
        "values": {
          "po_price": "$600.00",
          "po_type": "One time payment",
          "po_button": ""
        }
      }
    ]
  }
}
Clone this wiki locally