29 lines
2.8 KiB
HTML
29 lines
2.8 KiB
HTML
{% extends 'base.html' %}{% load static %}
|
|
{% block scripts %}<link rel="stylesheet" href="{% static 'storefront.css' %}">{% endblock %}
|
|
{% block title %}{{ product.title }} · Shop · SLUMP X LAND{% endblock %}
|
|
{% block content %}
|
|
<main class="section slx-store">
|
|
<div class="store-bar"><a href="{% url 'shop-index' %}">← Back to Shop</a><a href="{% url 'shop-cart' %}">Cart ({{ cart_count }})</a></div>
|
|
<article class="store-detail">
|
|
<div class="store-cover">{% if product.image %}<img src="{{ product.image.url }}" alt="{{ product.title }}">{% else %}<span>SLX</span>{% endif %}</div>
|
|
<div class="store-product-info"><h1>{{ product.title }}</h1><p>{{ product.get_kind_display }}</p>{% include "shop/_seller_badge.html" %}
|
|
<p>{{ product.summary }}</p><p class="store-price">${{ product.price_usd }}{% if product.kind == 'subscription' %} / {{ product.billing_interval }}{% endif %}</p>
|
|
{% if product.kind == 'subscription' %}
|
|
<p><a href="{% url 'membership' %}#compare-plans">Compare Fan Club plans →</a></p>
|
|
{% if not user.is_authenticated %}<a class="store-button" href="{% url 'fan-login' %}?next={% url 'shop-product' product.slug %}">Sign in to subscribe</a>
|
|
{% else %}<form method="post" action="{% url 'shop-subscribe' product.slug %}">{% csrf_token %}
|
|
{% if not user.email %}<label>Email for receipts <input type="email" name="email" required></label>{% endif %}
|
|
{% if stripe_enabled %}<button name="gateway" value="stripe" class="store-button">Subscribe with Stripe</button>{% endif %}
|
|
{% if not product.member_tier and paypal_enabled and product.paypal_plan_id %}<button name="gateway" value="paypal" class="store-button">Subscribe with PayPal</button>{% endif %}
|
|
</form>{% endif %}
|
|
{% elif product.in_stock %}
|
|
<form method="post" action="{% url 'shop-cart-add' product.pk %}">{% csrf_token %}<label>Quantity <input type="number" name="quantity" value="1" min="1" max="20"></label><button class="store-button">Add to cart</button></form>
|
|
{% else %}<p>Sold out</p>{% endif %}
|
|
</div>
|
|
<aside class="store-format"><h2>Format & delivery</h2>{% if product.kind == 'physical' %}<p>Ships to you · {% if product.in_stock %}In stock{% else %}Sold out{% endif %}</p>{% elif product.kind == 'digital' %}<p>Digital edition</p>{% else %}<p>Recurring membership · {{ product.get_member_tier_display }}</p>{% endif %}{% if sample_chapter %}<a href="{% url 'chapter' sample_chapter.number %}">Open chapter reader →</a>{% endif %}</aside>
|
|
</article>
|
|
{% if product.description %}<section class="store-section"><h2>Overview</h2><div>{{ product.description|linebreaks }}</div></section>{% endif %}
|
|
{% if related_products %}<section class="store-section"><h2>You may also like</h2><div class="store-grid">{% for product in related_products %}{% include 'shop/card.html' %}{% endfor %}</div></section>{% endif %}
|
|
</main>
|
|
{% endblock %}
|