Created
August 4, 2014 18:01
-
-
Save aelaguiz/7eb7953d375fb5d2e89e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class="list-group"> | |
<li class="list-group-item"><h4>Your Subscription(s)</h4></li> | |
{% set exists = [] %} | |
{% for sub in customer.subscriptions %} | |
{% if sub.store_id == store.id %} | |
{# This makes sure we know if we found a sub tied to the store #} | |
{% do exists.append(1) %} | |
<li class="list-group-item"> | |
{% if sub.cart_products %} | |
<div><strong>{{ sub.cart_products[0].instance.product.name }}</strong></div> | |
{% if sub.cart_products[0].instance.variants|length == 2 %} | |
<div>{{ sub.cart_products[0].instance.variants[0].variant_value.value }}</div> | |
<div>{{ sub.cart_products[0].instance.variants[1].variant_value.value }}</div> | |
{% endif %} | |
<div>{{ sub.cart_products[0].price | currency }}</div> | |
{% endif %} | |
<div>{{ sub.term.name }}</div> | |
<div>Status: <strong>{{ sub.status_pretty_string }}</strong></div> | |
</li> | |
{% endif %} | |
{% endfor %} | |
{% if not exists %} | |
<li class="list-group-item">No active subscriptions</li> | |
{% endif %} | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When a subscriber updates their subscription,
cart_products
retains the old Subscription objects. Is there a way to see which products they changed it to?