Permalink
Fetching contributors…
Cannot retrieve contributors at this time
219 lines (118 sloc) 3.61 KB

Signals

Oscar implements a number of custom signals that provide useful hook-points for adding functionality.

product_viewed

Raised when a product detail page is viewed.

Arguments sent with this signal:

.. attribute:: product

    The product being viewed

.. attribute:: user

    The user in question

.. attribute:: request

    The request instance

.. attribute:: response

    The response instance

product_search

Raised when a search is performed.

Arguments sent with this signal:

.. attribute:: query

    The search term

.. attribute:: user

    The user in question

user_registered

Raised when a user registers

Arguments sent with this signal:

.. attribute:: request

    The request instance

.. attribute:: user

    The user in question

basket_addition

Raised when a product is added to a basket

Arguments sent with this signal:

.. attribute:: request

    The request instance

.. attribute:: product

    The product being added

.. attribute:: user

    The user in question

voucher_addition

Raised when a valid voucher is added to a basket

Arguments sent with this signal:

.. attribute:: basket

    The basket in question

.. attribute:: voucher

    The voucher in question

start_checkout

Raised when the customer begins the checkout process

Arguments sent with this signal:

.. attribute:: request

    The reuqest instance

pre_payment

Raised immediately before attempting to take payment in the checkout.

Arguments sent with this signal:

.. attribute:: view

    The view class instance

post_payment

Raised immediately after payment has been taken.

Arguments sent with this signal:

.. attribute:: view

    The view class instance

order_placed

Raised by the :class:`oscar.apps.order.utils.OrderCreator` class when creating an order.

Arguments sent with this signal:

.. attribute:: order

    The order created

.. attribute:: user

    The user creating the order (not necessarily the user linked to the order
    instance!)

post_checkout

Raised by the :class:`oscar.apps.checkout.mixins.OrderPlacementMixin` class when a customer completes the checkout process

.. attribute:: order

    The order created

.. attribute:: user

    The user who completed the checkout

.. attribute:: request

    The request instance

.. attribute:: response

    The response instance

review_created

Raised when a review is added.

Arguments sent with this signal:

.. attribute:: review

    The review that was created

.. attribute:: user

    The user performing the action

.. attribute:: request

    The request instance

.. attribute:: response

    The response instance