feat(course_page.html): use stripe payment links

This commit is contained in:
2026-05-18 18:08:21 +02:00
parent 4dbfb8fc41
commit d2c870414f

View File

@@ -52,10 +52,11 @@
{% else %}
<div class="not-prose mt-8 p-4 bg-yellow-100 border-l-4 border-yellow-500 text-yellow-700">
<p>{% trans "You don't have access to this course. Please purchase it to view the modules." %}</p>
<form action="{% url 'test_purchase' %}" method="post">
{% csrf_token %}
<button type="submit" class="mt-4 inline-block bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700 transition">{% trans "Purchase Course" %}</button>
</form>
<h2 class="not-prose text-2xl mt-4 text-gray-700 font-semibold">
{{ page.purchasable_products.first.price | floatformat:2 }} {{ page.purchasable_products.first.currency | upper }}
</h2>
<a href="{{ page.purchasable_products.first.stripe_payment_url }}?prefilled_email={{ user.email }}"
class="mt-2 inline-block bg-green-600 text-white px-4 py-2 rounded hover:bg-green-700 transition">{% trans "Purchase Course" %}</a>
</div>
{% endif %}
{% endblock content %}