Update "Add to cart" aria-label value so it matches the visible text pattern (#41389)

Fixes #41368
This commit is contained in:
Corey McKrill 2023-11-14 13:17:12 -08:00 committed by GitHub
commit aabee87c67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: update
Add to cart button aria-label text should match or use similar text pattern as the visible text

View File

@ -70,7 +70,7 @@ class WC_Product_Simple extends WC_Product {
*/
public function add_to_cart_description() {
/* translators: %s: Product title */
$text = $this->is_purchasable() && $this->is_in_stock() ? __( 'Add “%s” to your cart', 'woocommerce' ) : __( 'Read more about “%s”', 'woocommerce' );
$text = $this->is_purchasable() && $this->is_in_stock() ? __( 'Add to cart: “%s”', 'woocommerce' ) : __( 'Read more about “%s”', 'woocommerce' );
return apply_filters( 'woocommerce_product_add_to_cart_description', sprintf( $text, $this->get_name() ), $this );
}