Added missing HTML filter for quantity
New filter into wc_add_to_cart_message which allows modify printed product quantity into message – for example in case of floats units – 1.2 kg (add_filter('woocommerce_stock_amount', 'floatval');)
This commit is contained in:
parent
ec0613ad78
commit
34300a1c52
|
@ -107,7 +107,7 @@ function wc_add_to_cart_message( $products, $show_qty = false, $return = false )
|
||||||
|
|
||||||
foreach ( $products as $product_id => $qty ) {
|
foreach ( $products as $product_id => $qty ) {
|
||||||
/* translators: %s: product name */
|
/* translators: %s: product name */
|
||||||
$titles[] = ( $qty > 1 ? absint( $qty ) . ' × ' : '' ) . apply_filters( 'woocommerce_add_to_cart_item_name_in_quotes', sprintf( _x( '“%s”', 'Item name in quotes', 'woocommerce' ), strip_tags( get_the_title( $product_id ) ) ), $product_id );
|
$titles[] = ( $qty > 1 ? ( has_filter( 'woocommerce_add_to_cart_message_qty_html' ) ? apply_filters( 'woocommerce_add_to_cart_message_qty_html', $product_id, $qty ) : absint( $qty ) ) . ' × ' : '' ) . apply_filters( 'woocommerce_add_to_cart_item_name_in_quotes', sprintf( _x( '“%s”', 'Item name in quotes', 'woocommerce' ), strip_tags( get_the_title( $product_id ) ) ), $product_id );
|
||||||
$count += $qty;
|
$count += $qty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue