Right now we only have the standard Drupal classes on the submit button for the Add to Cart form, but we can't guarantee there won't be other "actions" on the form. To simplify theming, can we put a unique class on this, something simple like "add-to-cart" so it can be directly selected?

Comments

rszrama created an issue. See original summary.

krzysztof domański’s picture

StatusFileSize
new539 bytes
krzysztof domański’s picture

Status: Active » Needs review
hubbs’s picture

Good idea. Patch applies cleanly but does need a slight modification. Drupal 8 follows the BEM methodology (here) so the class should actually be button--add-to-cart since it's modifying the base button element.

New patch attached.

Nils Loewen’s picture

Assigned: Unassigned » Nils Loewen
Status: Needs review » Reviewed & tested by the community

unique-add-to-cart-button-class_2985777_4.patch Successfully adds the class "button--add-to-cart" to the Add to Cart Button.

Nils Loewen’s picture

bojanz’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, everyone!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.