| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 | =======
Signals
=======
Oscar implements a number of custom signals_ that provide useful hook-points
for adding functionality.
.. _signals: https://docs.djangoproject.com/en/stable/topics/signals/
``product_viewed``
------------------
.. class:: oscar.apps.catalogue.signals.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``
------------------
.. class:: oscar.apps.catalogue.signals.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_signal:
``user_registered``
-------------------
.. class:: oscar.apps.customer.signals.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_signal:
``basket_addition``
-------------------
.. class:: oscar.apps.basket.signals.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``
--------------------
.. class:: oscar.apps.basket.signals.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_signal:
``start_checkout``
------------------
.. class:: oscar.apps.checkout.signals.start_checkout
   Raised when the customer begins the checkout process
Arguments sent with this signal:
.. attribute:: request
    The request instance
``pre_payment``
---------------
.. class:: oscar.apps.checkout.signals.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``
----------------
.. class:: oscar.apps.checkout.signals.post_payment
   Raised immediately after payment has been taken.
Arguments sent with this signal:
.. attribute:: view
    The view class instance
``order_placed``
----------------
.. class:: oscar.apps.order.signals.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``
-----------------
.. class:: oscar.apps.checkout.signals.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``
------------------
.. class:: oscar.apps.catalogue.reviews.signals.review_added
    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
 |