Hey there,

Those CartItem objects are created by:

 def add_item(self, variation, quantity):

which resides inside  Cart model.

As far as I understand, the product view inside shop.views.py (def
product(request, slug, template="shop/product.html")) processes the POST
and calls cart.add_item() passing the valid instance of
AddProductForm() to it.

add_item function grabs the data from the form and saves it inside the CartItem
model.

Cheers,

M



On Wed, Jul 2, 2014 at 1:15 PM, 董健 <[email protected]> wrote:

> yea. awesome. i have an another question here ... i check the code.
>
>
> class CartItem(SelectedProduct):
>
>     cart = models.ForeignKey("Cart", related_name="items")
>     url = CharField(max_length=2000)
>     image = CharField(max_length=200, null=True)
>
>     def get_absolute_url(self):
>         return self.url
>
> here. i can not fiugre out when url and image are assigned. so can you
> give some instructions?
>
> 在 2014年7月1日星期二UTC+8下午9时41分59秒,Josh Cartmell写道:
>>
>> Orders do have a relation to OrderItem, which has a sku field which you
>> could use to look up the purchased variation/product,
>> https://github.com/stephenmcd/cartridge/blob/master/
>> cartridge/shop/models.py#L665.
>>
>> The reason (as far as I know) that there isn't a direct relation to
>> product is that products could be deleted while orders should never be
>> deleted.
>>
>>
>> On Tue, Jul 1, 2014 at 2:10 AM, 董健 <[email protected]> wrote:
>>
>>> I want to add more function for "post orders".But i have questions below:
>>> 1. i want to add product image ,shipping information and so on.
>>> 2. i found that order has no relation with product in cartridge. i check
>>> code and try in admin.
>>> 3. i need a clue about implementing this function .
>>>
>>> thanks for help!
>>>
>>>
>>>  --
>>> 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.
>>>
>>
>>  --
> 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.
>



-- 

Mario Gudelj
M: 0415 193775

www.twoblokeswithapostie.com - Talk to us before you tell your clients:
"No, Business Catalyst can't do that."

-- 
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