For the latest Shopify themes a method price app block will be available soon
Copy
Ask AI
{% assign sc_product = product %}
Copy
Ask AI
{% assign sc_product = product_card %}
Copy
Ask AI
{% supercycle_methods == false %}
Copy
Ask AI
<!-- Assign the product resource (Change this if needed) -->
{% assign sc_product = closest.product %}
<!-- Get the supercycle methods data -->
{% assign calendar_config     = sc_product.metafields.supercycle.calendar_configuration.value %}
{% assign membership_config   = sc_product.metafields.supercycle.membership_configuration.value %}
{% assign resale_config       = sc_product.metafields.supercycle.resale_configuration.value %}
{% assign subscription_config = sc_product.metafields.supercycle.subscription_configuration.value %}
<!-- Check if the product has any supercycle methods -->
{% assign supercycle_methods = false %}
{% if calendar_config.rental_periods or membership_config or resale_config or subscription_config %}
  {% assign supercycle_methods = true %}
{% endif %}
{% if supercycle_methods %}
  <div class="sc-prices">
    <!-- Resale Method: Buy -->
    {% if resale_config and sc_product.compare_at_price != blank %}
      <div class="sc-method-price">
        <span class="type">Buy:</span>
        <span class="price">
          {%- if settings.currency_code_enable -%}
            {{ sc_product.price | money_with_currency }}
          {%- else -%}
            {{ sc_product.price | money }}
          {%- endif -%}
        </span>
      </div>
    {% endif %}
    <!-- Calendar Price -->
    {% if calendar_config and calendar_config.rental_periods %}
      {% assign cheapest_period      = calendar_config.rental_periods | sort: 'total_price' | first %}
      {% assign rental_periods_count = calendar_config.rental_periods | size %}
      {% if cheapest_period %}
        <div class="sc-method-price">
          <span class="type">
            {% if rental_periods_count > 1 %}
              Rent from:
            {% else %}
              Rent:
            {% endif %}
          </span>
          <span class="price">
            {%- if settings.currency_code_enable -%}
              {{ cheapest_period.total_price | money_with_currency }}
            {%- else -%}
              {{ cheapest_period.total_price | money }}
            {%- endif -%}
          </span>
        </div>
      {% endif %}
    {% endif %}
    <!-- Subscription Price -->
    {% if subscription_config and subscription_config.pricing_groups %}
      {% assign cheapest_group = subscription_config.pricing_groups | sort: 'price_cents_per_day' | first %}
      {% assign groups_count   = subscription_config.pricing_groups | size %}
      {% if cheapest_group %}
        {%- assign interval_count = cheapest_group.billing_interval_info.count -%}
        {%- assign interval_unit  = cheapest_group.billing_interval_info.unit | downcase -%}
        {%- assign interval_duration = cheapest_group.billing_interval_info.duration -%}
        {%- if interval_count == 1 -%}
          {%- assign interval_label = interval_unit -%}
        {%- else -%}
          {%- assign interval_label = interval_duration -%}
        {%- endif -%}
        <div class="sc-method-price">
          <span class="type">
            {% if groups_count > 1 %}
              Subscribe from:
            {% else %}
              Subscribe:
            {% endif %}
          </span>
          <span class="price">
            {%- if settings.currency_code_enable -%}
              {{ cheapest_group.reccuring_price_cents | money_with_currency }}
            {%- else -%}
              {{ cheapest_group.reccuring_price_cents | money }}
            {%- endif -%}
            <span class="interval">/ {{ interval_label }}</span>
          </span>
        </div>
      {% endif %}
    {% endif %}
    <!-- Membership Price -->
    {% if membership_config and membership_config.credit_costs %}
      <div class="sc-method-price">
        <span class="type">Free with membership</span>
      </div>
    {% endif %}
    <!-- RRP Price -->
    {% if sc_product.compare_at_price and sc_product.compare_at_price > sc_product.price %}
      <div class="sc-method-price sc-price--rrp">
        <span class="type">RRP:</span>
        <span class="price">
          {%- if settings.currency_code_enable -%}
            <s>{{ sc_product.compare_at_price | money_with_currency }}</s>
          {%- else -%}
            <s>{{ sc_product.compare_at_price | money }}</s>
          {%- endif -%}
        </span>
      </div>
    {% endif %}
  </div>
{% endif %}