Automattic\WooCommerce\Blocks\BlockTypes
ProductButton::get_in_the_cart_text
Get the inTheCartText text for a given product.
Метод класса: ProductButton{}
Хуков нет.
Возвращает
string. The inTheCartText string.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_in_the_cart_text( $product );
- $product(WC_Product) (обязательный)
- The product.
Код ProductButton::get_in_the_cart_text() ProductButton::get in the cart text WC 11.1.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' ),
'###'
);
}