For sake of conversation, I have a product in my store: "Beer". This
product comes in 3 sizes:
Beer (12oz)
Beer (24oz)
Beer (40oz)
Customers can also personalize the label, naming their beer however
they like.
If I make this a CustomProduct, I can add the CustomTextField for
"Label", then create the Option Group for the 3 sizes.
The problem is that if I want to run a Discount on just the 40oz
bottle, I can't target this in the Discount admin's "Available Valid
Products". It just shows "Beer" and if this is selected as the "Valid
Chosen Products" then customers will be able to get the discount on
all sizes rather than just the 40oz bottle.
I removed the M2M relationship between this OptionGroup and the
CustomProduct and instead created a ConfigurableProduct and added the
M2M to it. Now I can "Create Variations" which creates individual
'products' based on the size options. This gives me the individual
sizes which I can then select in the Discount admin, targeting only "
Beer (40oz)".
I now have a Product that has both a CustomProduct 1-to-1 (for the
personalized label) and a ConfigurableProduct 1-to-1 (for selecting
the size).
So the Discount problem is solved. But now ``product.get_subtypes()``
returns ``('ConfigurableProduct', 'CustomProduct')`` which means the
template that will be auto-magically chosen for this product will be
detail_configurableproduct.html. [1]
Now my problem is that the 'wrong' template is chosen,
detail_configurableproduct.html does not render a form field for the
CustomTextField "Label" field but detail_customproduct.html does.
Am I approaching this whole thing the wrong way? Or do I need to make
my own custom payment module just so Satchmo will auto-magically
render a separate template?
I do not see a built in method to override the template chosen in
``product.views.get_product``. Although from looking at
``active_product_types()`` in product/__init__.py, it appears I could
'trick' Satchmo by reordering my INSTALLED_APPS but that smells so bad
my nose hurts.
Thanks,
John-Scott
[1] Just accept that I also have 'pure' ConfigurableProduct and
CustomProduct that each need their own template.
--
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.