138 lines
3.6 KiB
Python
138 lines
3.6 KiB
Python
from django.urls import path, include
|
|
from . import views
|
|
|
|
urlpatterns = [
|
|
path('about/', views.AboutView.as_view(), name='about'),
|
|
path('fair-trade/', views.FairTradeView.as_view(), name='fair-trade'),
|
|
path('reviews/', views.ReviewListView.as_view(), name='reviews'),
|
|
|
|
path(
|
|
'categories/<int:pk>/',
|
|
views.ProductCategoryDetailView.as_view(),
|
|
name='category-detail'
|
|
),
|
|
path('', views.ProductListView.as_view(), name='product-list'),
|
|
path('products/<int:pk>/', include([
|
|
path('', views.ProductDetailView.as_view(), name='product-detail'),
|
|
])),
|
|
|
|
path('cart/', views.CartView.as_view(), name='cart-detail'),
|
|
path(
|
|
'cart/<int:pk>/add/',
|
|
views.CartAddProductView.as_view(),
|
|
name='cart-add'
|
|
),
|
|
path(
|
|
'cart/<int:pk>/update/',
|
|
views.CartItemUpdateView.as_view(),
|
|
name='cart-update',
|
|
),
|
|
path(
|
|
'cart/<int:pk>/remove/',
|
|
views.cart_remove_product_view,
|
|
name='cart-remove',
|
|
),
|
|
path(
|
|
'coupon/apply/',
|
|
views.CouponApplyView.as_view(),
|
|
name='coupon-apply'
|
|
),
|
|
path(
|
|
'paypal/order/<slug:transaction_id>/capture/',
|
|
views.paypal_order_transaction_capture,
|
|
name='paypal-capture',
|
|
),
|
|
path(
|
|
'checkout/address/',
|
|
views.CheckoutAddressView.as_view(),
|
|
name='checkout-address',
|
|
),
|
|
path(
|
|
'checkout/shipping/',
|
|
views.CheckoutShippingView.as_view(),
|
|
name='checkout-shipping',
|
|
),
|
|
path(
|
|
'checkout/',
|
|
views.OrderCreateView.as_view(),
|
|
name='order-create'
|
|
),
|
|
path(
|
|
'checkout/free/',
|
|
views.FreeOrderCreateView.as_view(),
|
|
name='free-order-create'
|
|
),
|
|
path(
|
|
'done/',
|
|
views.PaymentDoneView.as_view(),
|
|
name='payment-done'
|
|
),
|
|
path(
|
|
'canceled/',
|
|
views.PaymentCanceledView.as_view(),
|
|
name='payment-canceled'
|
|
),
|
|
path('customers/<int:pk>/', include([
|
|
path(
|
|
'',
|
|
views.CustomerDetailView.as_view(),
|
|
name='customer-detail'
|
|
),
|
|
path(
|
|
'update/',
|
|
views.CustomerUpdateView.as_view(),
|
|
name='customer-update',
|
|
),
|
|
# path(
|
|
# 'delete/',
|
|
# views.CustomerDeleteView.as_view(),
|
|
# name='customer-delete'
|
|
# ),
|
|
path(
|
|
'orders/<int:order_pk>/',
|
|
views.OrderDetailView.as_view(),
|
|
name='order-detail',
|
|
),
|
|
path(
|
|
'addresses/new/',
|
|
views.CustomerAddressCreateView.as_view(),
|
|
name='customer-address-create',
|
|
),
|
|
path(
|
|
'addresses/<int:address_pk>/update/',
|
|
views.CustomerAddressUpdateView.as_view(),
|
|
name='address-update',
|
|
)
|
|
])),
|
|
|
|
path(
|
|
'stripe-webhook/',
|
|
views.stripe_webhook,
|
|
name='stripe-webhook'
|
|
),
|
|
# Subscriptions
|
|
path('subscriptions/', include([
|
|
path('', views.SubscriptionAdView.as_view(), name='subscription-ad'),
|
|
path(
|
|
'form/',
|
|
views.SubscriptionFormView.as_view(),
|
|
name='subscription-form'
|
|
),
|
|
path(
|
|
'address/',
|
|
views.SubscriptionAddAddressView.as_view(),
|
|
name='subscription-address'
|
|
),
|
|
path(
|
|
'new/',
|
|
views.SubscriptionCreateView.as_view(),
|
|
name='subscription-create'
|
|
),
|
|
path(
|
|
'done/',
|
|
views.SubscriptionDoneView.as_view(),
|
|
name='subscription-done'
|
|
),
|
|
])),
|
|
]
|