- Issue created by @andyd328
Report received & verified as reproducible at
https://www.drupal.org/project/commerce_cart_redirection/issues/3496009
🐛
Button looses CSS classes, when activating Redirection
Active
The Commerce Cart Redirection module allows the site admin to arbitrarily modify the text of the Add to cart button, this causes the add to cart button to lose its theming.
It seems that the class addition depends on the button text being "Add to Cart" fairly late in the rendering process.
In the Commerce Cart Redirection module, I modify the button text earlier in the workflow ( in a form_alter ), which results in the classes not being added as expected. I’ve implemented a workaround in the 3.3.x-dev version using string substitution on the rendered button markup in a post_render callback. It's functional but it's not a feel good solution and it may not be reliable.
I'd like to make the module work with the Belgrade theme while maintaining flexibility for sites that already use custom button text. Any insights or guidance you can provide would be greatly appreciated.
Thanks!
Active
2.0
Code