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.
#1538094: Drupal Commerce - number of items in the basket on a menu element discusses the altering of the cart menu link title provided by Commerce with various solutions proposed. It seems to me that this would be best handled using a theme function.
Comment | File | Size | Author |
---|---|---|---|
#6 | cart-menu-link-title-theme-2535070-6.patch | 2.16 KB | rattusrattus |
#5 | cart-menu-link-title-theme-2535070-2.patch | 1.33 KB | rattusrattus |
#1 | cart-menu-link-title-theme-2535070-1.patch | 1.35 KB | rattusrattus |
Comments
Comment #1
rattusrattus CreditAttribution: rattusrattus commentedPatch provides:
To use override theme_commerce_cart_menu_link_title in your template.php, e.g.:
Comment #2
rattusrattus CreditAttribution: rattusrattus commentedComment #3
rattusrattus CreditAttribution: rattusrattus commentedComment #4
rattusrattus CreditAttribution: rattusrattus commentedComment #5
rattusrattus CreditAttribution: rattusrattus commentedPatch without commeted out lines
Comment #6
rattusrattus CreditAttribution: rattusrattus commentedWhoops! missed the default title.
Updated example:
Comment #7
bverc CreditAttribution: bverc as a volunteer commentedI really like this idea. I think it should be committed (yet to test).
Do you think it could be modified to allow it to be hidden when empty. (Not sure if setting to empty string is an elegant solution)
EDIT: On second thought, my problem might be too complex and best to implement entirely using THEME_menu_link()
Comment #8
calbasiNot running for me... Please, if need more info to debug, just tell me...