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.
how do you add this functionality to the drupal commerce products? Since "products" are not in the "content" category.
Comments
Comment #2
freelylw CreditAttribution: freelylw commentedsame question here ? OR the answer is addtoany is not support the commerce product ??
Comment #3
micropat CreditAttribution: micropat commentedUse
hook_addtoany_entity_types_alter()
to add thecommerce_product
entity type.Then the AddToAny field will be available in:
Administration > Commerce > Configuration > Product types > Manage display
Comment #5
calbasiHi,
I've done a sandbox module to do it: https://www.drupal.org/sandbox/calbasi/3041534
and it's not working
Could you test or examine it? I've just pasted your code...
Comment #6
calbasiIn fact, I wonder if this hook is running, because I can see addtoany pseudofield on my terms, and I think I should because this hook is used at:
https://cgit.drupalcode.org/addtoany/tree/addtoany.api.php
Comment #7
rovo#3 worked for me.