Automattic / woocommerce-subscriptions-core

Subscriptions core package for WooCommerce
Other
80 stars 29 forks source link

Add support for additional classes for the add to cart button #569

Closed senadir closed 3 months ago

senadir commented 4 months ago

Describe the bug

WooCommerce added support for additional classes in the add to cart button 15 months go, this is still not reflected in the Woo Subs add to cart custom buttons, causing a broken style.

<button type="submit" name="add-to-cart" value="<?php echo esc_attr( $product->get_id() ); ?>" class="single_add_to_cart_button button alt<?php echo esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '' ); ?>"><?php echo esc_html( $product->single_add_to_cart_text() ); ?></button>

image image

To Reproduce

  1. In 2024 theme, go to a subscription product page, see the button is without styles.
  2. Go to a regular product page, see that the button has regular styles.

Expected behavior

Subscription button should match the regular button styles.

Actual behavior

Button is without styles.

Product impact