Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Contributed modules
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
4 Feb 2011 at 10:30 UTC
Updated:
25 Apr 2013 at 15:12 UTC
Im not sure if this is a flags issue or commerce. Im wondering why products isnt a regular content type. That way products would integrate with modules such as flags. Not knowing a lot about drupal and commerce, is there a reason for this choice?
Comments
Comment #1
rszrama commentedYeah, check out http://www.drupalcommerce.org/node/49. A product's definition isn't content. A product display is content. Regardless, Flag should work with any entity type, not just nodes.
Comment #2
joachim commentedHaving taken a look at #1035410: Flag any entity, I reckon that because product entities don't have a direct view page but just a form, we're going to need so do some extra integration to get the flag widget into the product form.
Comment #3
rszrama commentedJust a bit of maintenance on the title / tags.
Comment #4
joachim commentedI'm working on this at the moment.
Blocker: #1689538: product form has entity ID as '' rather than NULL.
Comment #5
joachim commentedShould all be working now.
Comment #7
sambaynham commentedAfter a morning' hacking, I've found out that you can make this happen by embedding flag_create_link('flag_name',$product_id) in a hook_form_alter for whatever add to cart form you're using. It ain't elegant, but it works!
In future, I imagine it'll be a matter of placing a more elegant version of this code in the hook_widget_view of the flag module's add to cart form.
Peace
Sam B
Comment #8
Sinan Erdem commentedI am using Display Suite in the product display. How can I put a flag link so that when the user uses the link, he flags a product variation (entity) instead of node?
Comment #9
Sinan Erdem commented@Sam B, can you please share how do you get the product_id?
Comment #10
Sinan Erdem commentedI wrote a way to use Flag with the product displays here: #1911568: How is this module different from Flag module?