Button looses CSS classes, when activating Redirection

Created on 26 December 2024, 8 days ago

Problem/Motivation

The HTML code of the button before activating Cart Redirection:
<input class="button--add-to-cart button button--primary js-form-submit form-submit btn btn-primary bi-btn-basket bi-btn-add" data-drupal-selector="edit-submit" type="submit" id="edit-submit" name="op" value="Add to cart">

And the HTML after:
<input class="button--add-to-cart button button--primary js-form-submit form-submit bi-btn-add" data-drupal-selector="edit-submit" type="submit" id="edit-submit" name="op" value="Add To Cart">

Steps to reproduce

- Install Drupal Commerce
- Install Belgrade
- Create a Product
- Install and Activate Commerce Cart Redirection

Remaining tasks

How do I get the predefined classes / styles back?

🐛 Bug report
Status

Active

Version

3.3

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @transmitter
    • andyd328 committed 81af0594 on 3.3.x
      Issue #3496009 by andyd328: Button loses CSS classes, when activating...
  • 🇳🇿New Zealand andyd328 Lyttelton, NZ 🇳🇿

    Hi transmitter,

    I've uploaded a 3.3 dev version for you to try, and I'm pretty certain it will work for you without any problems.
    However, I'm not really happy to make it a full release yet as it does a string substitution on the rendered button markup. Apart from just not liking that approach I haven't decided if represents a bc break ie if it's going to have any effect on sites already using the module that depend on the current behaviour.

    I suspect this is more of an issue with how the Belgrade theme adds the classes than this module - it's dependant on the text of the button being 'Add to cart' fairly late in the process. By the time it gets to adding the classes this module has already changed the text and the classes don't get added.

    I'll open a support request on Belgrade and see what better ideas they have.

  • 🇳🇿New Zealand andyd328 Lyttelton, NZ 🇳🇿
Production build 0.71.5 2024