Hi all,

I injected the neck_size field to both CartItem and OrderItem like this

    (
        "cartridge.shop.models.OrderItem.neck_size",
        "DecimalField",
        (u"Neck Size",),
        {"null": True, "blank": True, "max_digits": 4, "decimal_places": 2},
    ),
    (
        "cartridge.shop.models.CartItem.neck_size",
        "DecimalField",
        (u"Neck Size",),
        {"null": True, "blank": True, "max_digits": 4, "decimal_places": 2},
    ),


I added a new step during the order process, so when a user clicks "Buy" , 
it will not go straight to the "Your Cart" page, but instead, it will go to 
the "SizeForm" page.
I did that by monkey patching def product() to return 
HttpResponseRedirect("sizeForm"). After filling the form out, I did return 
redirect("shop_cart")

I already have the form set up so user can enter their "neck_size" in, but 
I couldn't figure out how to set the entered value to CartItem.neck_size 
and OrderItem.neck_size so they show up under the box Items in the Order 
admin page.
I tried monkey patched the def complete() to do this

        current_order_items = OrderItem.objects.filter(order=self)
        for item in current_order_items:
            if (item is not None):
                setattr(item, 'neck_size', request.session["neck_size"]) 
#assume 
request.session['neck_size'] = 10 


It still doesn't work. Does anyone know how to set/update the extra field 
of the selected item (i.e neck_size) after it's already added to cart?

Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to