Automattic\WooCommerce\Blocks\BlockTypes
ProductButton::get_in_the_cart_text
Get the inTheCartText text for a given product.
Method of the class: ProductButton{}
No Hooks.
Returns
String. The inTheCartText string.
Usage
// private - for code of main (parent) class only $result = $this->get_in_the_cart_text( $product );
- $product(WC_Product) (required)
- The product.
ProductButton::get_in_the_cart_text() ProductButton::get in the cart text code WC 10.7.0
private function get_in_the_cart_text( $product ) {
if ( $product->is_type( ProductType::GROUPED ) ) {
return __( 'Added to cart', 'woocommerce' );
}
return sprintf(
/* translators: %s: product number. */
__( '%s in cart', 'woocommerce' ),
'###'
);
}