• Resolved brighit

    (@brighit)


    Hi there,
    I use the plugin product subtitle for Woocommerce which gives me the option to add a subtitle under the product title and is also visible in the PDF invoice (template plugin) and all would be perfect if only I could remove the text Subtitle before the actual subtitle text.

    So instead of
    Hoody long sleeve
    Subtitle:
    Retailprice: ¢10.00

    I would like it to be
    Hoody long sleeve
    Retailprice: ¢10.00

    Any ideas would be great since I am out of options at the moment.
    Thanks in advance, regards, Brigit

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hello @brighit

    Please disable that integration setting under the Product Subtitle for WooCommerce plugin settings, and add this to your theme functions.php file:

    add_action( 'wpo_wcpdf_after_item_meta', 'wpo_wcpdf_subtitle_wcpdf', 10, 3 );
    function wpo_wcpdf_subtitle_wcpdf( $template_type, $item, $order ) {
    	if ( !empty($order) && !empty( $item['product'] ) ) {
    		if ( $item['product']->is_type( 'variation' ) ) {
    			$item['product'] = wc_get_product( $item['product']->get_parent_id() );
    		}
    	
    		$subtitle = get_product_subtitle( $item['product']->get_id() );
    		if ( ! empty( $subtitle ) ) {
    			echo '<div class="product-subtitle"><small>' . $subtitle . '</small></div>';
    		}	
    	}
    }

    If you never worked with action/filters please read this documentation page: How to use filters

    • This reply was modified 4 years, 8 months ago by alexmigf.
    • This reply was modified 4 years, 8 months ago by alexmigf.
    Thread Starter brighit

    (@brighit)

    Hi Alexmigf,

    That works perfect!! Thank you so much.
    Regards Brigit

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Product subtitle on invoice’ is closed to new replies.