Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I want to display one term reference field not in vertical tabs as "product catalog" but as ordinary field.
Is there any way how i can do it?
I was trying to do it with "form_alter" and "after_build", but haven`t succeed.
I was trying to find where it is controlled in "commerce" module, but I didn`t find it.
Will be very helpful for any information how to do it or where to find more information.
Comment | File | Size | Author |
---|---|---|---|
#11 | commerce_backoffice_product-1886466-11.patch | 3.01 KB | jsacksick |
#8 | not_product_catalog_instance_setting-1886466-8.patch | 2.99 KB | vasike |
#7 | product_catalog_vTab.png | 20.97 KB | logii |
#4 | not_product_catalog_instance_setting-1886466-4.patch | 1.71 KB | vasike |
Comments
Comment #1
rszrama CreditAttribution: rszrama commentedPretty sure this is coming from the Backoffice module.
Comment #2
lanzs CreditAttribution: lanzs commentedThanks a lot!
If someone will need to do the same thing - here is the way how to do it:
In your template.php file (because form_alter from template is called after all form_alters in modules, in my case my_module_form_alter was called before commerce_backoffice_product_form_alter) make a form_alter for required form with this code:
Comment #3
p4trizio CreditAttribution: p4trizio commentedMaybe the module shoud provide a settings page so that the user can set it up
Comment #4
vasikehere is a patch that should provide a solution for this issue.
- it adds new settings for the Term references field of the Product Displays content types.
- with this setting the field will be not included in Product Catalog vertical tab.
this means the default is in.
Comment #5
noopal CreditAttribution: noopal commentedhas the patch been added?
Comment #6
rszrama CreditAttribution: rszrama commentedNo. This issue would be marked "fixed" if it had.
Comment #7
logii CreditAttribution: logii commented#4 Works for me.
One small issue:
The vertical tab for "Product catalog" should be hidden when it is empty.
Comment #8
vasikeindeed, the tab is displayed no matter if there are term reference fields or not and it's not strictly related with the previous patch.
however here is a new patch that includes solution for this "new" issue.
Comment #9
dddbbb CreditAttribution: dddbbb commentedPatch in #8 appears to work as it says it does. Thanks for that.
While I'm here, and related to this subject, as a new user of this module I am rather surprised about how much it assumes about how I want to set up the admin experience of my store; this 'Product catalog' issue being a good example. There are a number of other features that I've had to 'un-override' in order to get them back to how I think I'd like them. In fact, I'm pretty sure I'm only in it for the Quick edit / Mega view functionality (which I think is great and am truly thankful for). Is this a common view?
Comment #10
logii CreditAttribution: logii commented#8 works for me. Thanks vasike.
Comment #11
jsacksick CreditAttribution: jsacksick commentedI committed a slightly different patch, the checkbox label is now "Used for categorizing products", and the approach is now to explicitly uncheck the checkbox if you want to hide a taxonomy field from the tab.
Comment #13
ace11 CreditAttribution: ace11 commented#11 worked for me! Nice, thanks!
Comment #14
masterperoo CreditAttribution: masterperoo commentedWhy does this patch assume variation type machine name is exact match to content type's machine name ?
I have spent quite a lot of time looking for this checkbox and it appears it will never show if you try to name things your way. In my opinion naming variation type (entity) to 'exactly' match content type (node) creates confusion (a lot of it). Since user has full control over machine names modules should not assume mirrored names will always be the case.
in_array($form['#instance']['bundle'] - variation type edited...
array_keys(commerce_product_reference_node_types() node types...