The problem with per-item notifications is that we'll end up with duplicate notifications (one of our more anticipated common use cases is purchasing 3 paid registrations), so there needs to be order-level logic too.  Maybe I should factor it out into a function like Order.get_receipt_notifications?  Would that be better?




On Sep 25, 2013, at 7:40 AM, Diana Huang <notifications@github.com> wrote:

> In lms/djangoapps/shoppingcart/views.py:
> 
> > @@ -103,12 +110,20 @@ def show_receipt(request, ordernum):
> >      order_items = OrderItem.objects.filter(order=order).select_subclasses()
> >      any_refunds = any(i.status == "refunded" for i in order_items)
> >      receipt_template = 'shoppingcart/receipt.html'
> > +
> > +    # messaging if PaidRegistration was part of order
> > +    any_paid_reg = any(isinstance(i, PaidCourseRegistration) for i in order_items)
> > +    notification = None
> > +    if any_paid_reg:
> > +        notification = (_('Please visit your <a href="{dashboard_link}">dashboard</a> to see your new enrollments.')
> > +                        .format(dashboard_link=reverse('dashboard')))
> I'm not a big fan of this, because it's doing something similar to what we were doing with our custom receipt work, but not really. I'd really like a better framework for OrderItems to insert custom notifications into the receipt page so we don't have to look for PaidCourseRegistrations specifically here. Maybe each order item can append their own custom notification onto a list of notifications?
> 
> —
> Reply to this email directly or view it on GitHub.
>