I have found when using the PayPal module that the user has to click
the 'Return to store' link at the end of the PayPal process from
within PayPal for the the stock quantity and items sold to be updated.

in payment.views.checkout.success the code is:

# Added to track total sold for each product
    for item in order.orderitem_set.all():
        product = item.product
        product.total_sold += item.quantity
        product.items_in_stock -= item.quantity
        product.save()

This only gets run if the user returns to the store from PayPal.

For PayPal I think this code should be in the payment.views.ipn
function, which will fire even if the user doesn't click Return to
store. However that would mean removing the code from
payment.views.checkout.success.

I'm going to attempt to add the code to the ipn function, unless
anyone thinks there is a better way to do this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to