Getting the parent product of a product variant

8 views
Skip to first unread message

Thomas

unread,
Apr 4, 2012, 12:47:04 PM4/4/12
to satchm...@googlegroups.com
Hi,

Is there a (standard) way to find out what the parent of a product variant is? e.g. the parent of "large red hat" would be "hat".

Many thanks,
Thomas

Thomas

unread,
Apr 5, 2012, 3:50:03 AM4/5/12
to satchm...@googlegroups.com
p = product.get_subtype_with_attr('parent', 'product')
parent_product = p.parent.product
Reply all
Reply to author
Forward
0 new messages