Ask Your Question
4

How can I replace the default 'Qty' header of an item in Woocommerce with a customized value?

asked 2023-05-09 22:29:32 +0000

pufferfish gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-05-09 22:42:02 +0000

david gravatar image

To replace the default 'Qty' header of an item in Woocommerce with a customized value, you will need to add the following code to your functions.php file:

add_filter( 'woocommerce_quantity_input_args', 'custom_qty_label', 10, 2 );

function custom_qty_label( $args, $product ) {
    $args['label'] = __( 'Custom Label', 'woocommerce' );
    return $args;
}

Replace 'Custom Label' with your desired label. Save the changes and refresh your website to see the updated quantity label.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-09 22:29:32 +0000

Seen: 12 times

Last updated: May 09 '23