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.
Hello,
How could one pass any cck fields of a node/product into cart template?
Adding usual
print $node->field_sklad_stav[0]['value'];
does not work.
Thank you
Comments
Comment #1
stewart.adam CreditAttribution: stewart.adam commentedI haven't double checked this, but I believe you'll need to implement hook_cart_item() to load the additional item data you desire into the cart item structure, then modify your template file (copy it from the 'templates' folder into your theme folder) and output the additional fields.
Comment #2
loparr CreditAttribution: loparr commentedI created a simple custom module using hook_cart_item
And try to display the values using a template file for cart like this
So far I am getting no results.
Comment #3
loparr CreditAttribution: loparr commentedAnybody knows how to accomplish this? Thank you
I would reeeally appreciate if someone could help me with this. I managed to show custom ckk field inside cart page with a custom module
but not inside cart block. Where could be the problem?
Comment #3.0
loparr CreditAttribution: loparr commentededit