How to do if loop check with value in rivets.js

Topic summary

A user is seeking help with implementing conditional logic in Rivets.js within a Shopify cart drawer template. The posted code shows a cart implementation using Rivets.js data binding, including:

Key Elements:

  • Cart item display with product images, titles, variants, and prices
  • Empty cart state handling using rv-show="cart.item_count | lt 1"
  • Item removal functionality
  • Quantity fields and product options display
  • Free shipping message logic based on cart total

Specific Issue:
The code contains a problematic section for displaying selling plan information:

rv-show="item.selling_plan_allocation | lt 1"

This appears to be attempting to conditionally show/hide subscription plan details, but the logic seems inverted or incorrect. The user likely needs guidance on:

  • Proper Rivets.js conditional syntax for checking if a value exists or is null
  • How to correctly evaluate selling_plan_allocation objects
  • Whether to use rv-show, rv-hide, or other Rivets directives

The discussion remains open with no responses yet. The code also shows reversed/garbled text in the checkout section, suggesting possible encoding or copy-paste issues.

Summarized with AI on November 17. AI used: claude-sonnet-4-5-20250929.

{{ 'cart.general.title' | t }}

  • {{ 'cart.general.empty' | t }}

  • :
    • {property.name}: {property.value}
    - +
    {%- if settings.free_ship_minicart and settings.free_ship != blank and settings.free_ship_msg != blank -%} {%- assign shipProd = all_products[settings.free_ship] -%}
  • {{settings.free_ship_msg | replace: '$','' }}

  • {{settings.got_free_ship }}

  • {%- endif -%}
  • {{ 'cart.general.subtotal' | t }}:
  • {%- if settings.shippingTax -%}

    {{ 'cart.general.shipping_at_checkout' | t }}

    {%- endif -%} {% unless settings.hide_checkout_cart == true %} {%- if settings.terms_checkbox -%}
    {{ settings.terms_text}}
    {%- endif -%} {% endunless %} {{ 'cart.general.view_cart' | t }}

Need to do if loop check with values for the options.value