Table Of Contents

Previous topic

Satchmo Template Filters and Tags

Next topic

Signals in Satchmo

Documentation Version:

Satchmo Views

URLs by Name

Here’s an overview showing the name and view for URLs in Satchmo.

URL paths are relative to SHOP_BASE.

satchmo_shop_home
Url :/
View :satchmo_store.shop.views.home.home()
satchmo_category_index
Url :/<CATEGORY_SLUG>/
View :product.views.category_index()
satchmo_category
Url :/<CATEGORY_SLUG>/slug1/slug2/.../<slug>/
View :product.views.category_view()
satchmo_product
Url :/<PRODUCT_SLUG>/<slug>/
View :product.views.get_product()
satchmo_cart
Url :/cart/
View :satchmo_store.shop.views.cart.display()
satchmo_checkout-step1
Url :/checkout/
View :payment.views.contact.contact_info_view()
satchmo_balance_remaining
Url :/checkout/balance/
View :payment.views.balance.balance_remaining_order()
satchmo_balance_remaining_order
Url :/checkout/balance/<id>/
View :payment.views.balance.balance_remaining()
satchmo_charge_remaining
Url :/checkout/custom/charge/
View :payment.views.balance.charge_remaining_post()
satchmo_charge_remaining_post
Url :/checkout/custom/charge/<id>/
View :payment.views.balance.charge_remaining()
satchmo_checkout_auth_required
Url :/checkout/mustlogin/
View :payment.views.contact.authentication_required()
satchmo_checkout-success
Url :/checkout/success/
View :payment.views.checkout.success()
satchmo_contact
Url :/contact/
View :satchmo_store.shop.views.contact.form()
satchmo_contact_thanks
Url :/contact/thankyou/
View :Contact thanks
satchmo_order_history
Url :/history/
View :satchmo_store.shop.views.orders.order_history()
satchmo_quick_order
Url :/quickorder/
View :satchmo_store.shop.views.cart.add_multiple()
Url :/search/
View :satchmo_store.shop.views.search.search_view()
satchmo_order_tracking
Url :/tracking/
View :satchmo_store.shop.views.orders.order_tracking()

Use of Generic Django Views

Contact thanks

The view satchmo_store.shop.views.contact.form() redirects the user to this page after sending the email successfully.

url:satchmo_contact_thanks
template:shop/contact_thanks.html
context:None

Views by App

payment

payment.views.balance.balance_remaining()
Url :satchmo_balance_remaining
Template :shop/checkout/balance_remaining.html
Context :
form:an instance of payment.forms.PaymentMethodForm
paymentmethod_ct:
 the length of the return value of payment.active_gateways()
order:
payment.views.balance.balance_remaining_order()
Url :satchmo_balance_remaining_order
Template :shop/checkout/balance_remaining.html
Context :see balance_remaining’s context.
payment.views.balance.charge_remaining()

Displays a confirmation form for the order with id id.

Url :

satchmo_charge_remaining_post

Template :

payment/admin/charge_remaining_confirm.html

Context :
form:an instance of payment.forms.CustomChargeForm
payment.views.balance.charge_remaining_post()

Handles the submit response to payment.views.balance.charge_remaining().

Url :

satchmo_charge_remaining

Template :

payment/admin/charge_remaining_confirm.html

Context :
form:an instance of payment.forms.CustomChargeForm
payment.views.contact.authentication_required()
Url :satchmo_checkout_auth_required
Template :shop/checkout/authentication_required.html
Context :None
payment.views.contact.contact_info_view()
Url :

satchmo_checkout-step1

Template :

shop/checkout/form.html

Context :
form:an instance of payment.forms.PaymentContactInfoForm
country:
paymentmethod_ct:
 the length of the return value of payment.active_gateways(), passed through the payment_choices signal
payment.views.checkout.success()

The order has been succesfully processed. This can be used to generate a receipt or some other confirmation

Url :

satchmo_checkout-success

Template :

shop/checkout/success.html

Context :
order:

product

product.views.category_index()

Display all categories.

Parameters: - root_only: If true, then only show root categories.

Url :

satchmo_category_index

Template :

product/category_index.html

Context :
categorylist:list of all root categories
product.views.category_view()

Display the category, its child categories, and its products.

Parameters:
  • slug: slug of category
  • parent_slugs: ignored
Url :

satchmo_category

Template :

product/category.html

Context :
category:the category with slug name
child_categories:
 child categories of category
products:active products in category
sale:see sale.
product.views.get_product()
Url :

satchmo_product

Template :

product/product.html

Context :
product:the product with slug slug
current_product:
 clone of product for product variations
default_view_tax:
 see default_view_tax.
sale:see sale.
error_message:errors

satchmo_store

satchmo_store.shop.views.cart.add_multiple()
Url :

satchmo_quick_order

Template :

shop/multiple_product_form.html

Context :
form:an instance of satchmo_store.shop.forms.MultipleProductForm
satchmo_store.shop.views.cart.display()
Url :

satchmo_cart

Template :

shop/cart.html

Context :
cart:cart
default_view_tax:
 see default_view_tax.
error_message:errors
sale:see sale.
satchmo_store.shop.views.contact.form()
Url :

satchmo_contact

Template :

shop/contact_form.html

Context :
form:an instance of satchmo_store.shop.views.contact.ContactForm
satchmo_store.shop.views.home.home()
Url :

satchmo_shop_home

Template :

shop/index.html

Context :
all_products_list:
 
is_paginated:
page_obj:
paginator:
satchmo_store.shop.views.orders.order_history()
Url :

satchmo_order_history

Template :

shop/order_history.html

Context :
contact:
default_view_tax:
 see default_view_tax.
orders:
satchmo_store.shop.views.orders.order_tracking()
Url :

satchmo_order_tracking

Template :

shop/order_tracking.html

Context :
contact:
default_view_tax:
 see default_view_tax.
order:
satchmo_store.shop.views.search.search_view()
Url :satchmo_search
Template :shop/search.html
Context :

Payment Processor Views

PayPal

URLs by Name

URLs are relative to /checkout/PAYMENT_PAYPAL.URL_BASE/.

PAYPAL_satchmo_checkout-step2
Url :/
View :payment.modules.paypal.views.pay_ship_info()
PAYPAL_satchmo_checkout-step3
Url :/confirm/
View :payment.modules.paypal.views.confirm_info()
PAYPAL_satchmo_checkout_free-confirm
Url :/confirmorder/
View :payment.views.confirm.confirm_free_order
PAYPAL_satchmo_checkout-ipn
Url :/ipn/
View :payment.modules.paypal.views.ipn
PAYPAL_satchmo_checkout-success
Url :/success/
View :payment.views.checkout.success()

Views

payment.modules.paypal.views.pay_ship_info()
Url :

PAYPAL_satchmo_checkout-step2

Template :

shop/checkout/paypal/pay_ship.html

Context :
form:an instance of payment.views.payship.simple_pay_ship_process_form
PAYMENT_LIVE:whether the Paypal module is ‘live’
payment.modules.paypal.views.confirm_info()
Url :

PAYPAL_satchmo_checkout-step3

Template :

shop/checkout/paypal/confirm.html

Context :
order:the instance of satchmo_store.shop.models.Order being paid for.
post_url:either PAYMENT_PAYPAL.POST_URL or PAYMENT_PAYPAL.POST_TEST_URL, depending on whether the Paypal module is 'live'.
default_view_tax:
 see default_view_tax.
business:either PAYMENT_PAYPAL.BUSINESS or PAYMENT_PAYPAL.BUSINESS_TEST, depending on whether the Paypal module is 'live'.
currency_code:the value of PAYMENT_PAYPAL.CURRENCY_CODE.
return_address:the value of PAYMENT_PAYPAL.RETURN_ADDRESS.
invoice:the id of order
subscription:
PAYMENT_LIVE:whether the Paypal module is 'live'.

Forms

class satchmo_store.shop.views.contact.ContactForm
contents

a CharField with a TextArea widget.

inquiry
a ChoiceField with choices:
  • General Question
  • Order Problem
name

a CharField.

sender

an EmailField

subject

a CharField.

class payment.forms.CustomChargeForm
amount

a DecimalField.

notes

a CharField.

orderitem

a hidden IntegerField field.

shipping

a DecimalField.

class satchmo_store.shop.forms.MultipleProductForm

A form populated with PositiveRoundedDecimalField fields, one for each active product.

class payment.forms.PaymentContactInfoForm

Subclasses payment.forms.PaymentMethodForm

and satchmo_store.contact.forms.ContactInfoForm.

class payment.forms.PaymentMethodForm
paymentmethod

a radio-button selection with choices payment.config.labelled_gateway_choices().

class satchmo_store.contact.forms.ContactInfoForm(*args, **kwargs)
email

an EmailField.

title

a CharField.

first_name

a CharField.

last_name

a CharField.

phone

a CharField.

addressee

a CharField.

organization

a CharField.

street1

a CharField.

street2

a CharField.

city

a CharField.

state

a CharField.

postal_code

a CharField.

copy_address

a BooleanField to determine whether the data in billing fields is to be copied into shipping fields.

ship_addressee

a CharField.

ship_street1

a CharField.

ship_street2

a CharField.

ship_city

a CharField.

ship_state

a CharField.

ship_postal_code

a CharField.

next

a hidden CharField.

Context variables

Variables provided by Satchmo’s context processor

Here are the variables provided in the context by Satchmo’s context processor, satchmo_store.shop.context_processor.settings.

shop_base:the value SHOP_BASE of in SATCHMO_SETTINGS in your local_settings.py
shop:the current satchmo_store.shop.models.Config in use
shop_name:the store_name value from the config
media_url:
cart_count:number of items in the cart
cart:user’s current cart; an instance of satchmo_store.shop.models.Cart
categories:all categories in the site
is_secure:
request:
login_url:the LOGIN_URL setting in your settings.py
logout_url:the LOGOUT_URL setting in your settings.py
sale:

Common variables

default_view_tax

The configuration value with group ‘TAX’ and key ‘DEFAULT_VIEW_TAX’ from livesettings.

sale

The return value of product.utils.find_best_auto_discount(), which is the discount with the highest discount percentage.