Quantity hook | WordPress.org

I am using EDDiMark PDF Watermark and wonder if there any way to hook the quantity in a similar way like this:

function wc_pdf_watermark_extend_template_tags( $parsed_text, $unparsed_text, $order, $product ) {

    foreach ($order->get_items() as $item_id => $item ) {
        $item_quantity  = $item->get_quantity(); // Get the item quantity
	// Look for {quantity} in text and replace it with the quantity
	$parsed_text = str_replace( '{quantity}', $item_quantity, $parsed_text );
	return $parsed_text;
add_filter( 'woocommerce_pdf_watermark_parse_template_tags', 'wc_pdf_watermark_extend_template_tags', 10, 4);



This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer