• Resolved agwebcom123

    (@agwebcom123)


    Hello,
    
    I would like the invoices to appear 2 decimal places after the commas. Apart from the general wordpress settings and therefore the prices displayed on the site in the store, I want it to remain at 0 decimal places, what should I do?
    
    Thank you
Viewing 1 replies (of 1 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hello @agwebcom123

    Please try the code snippet below:

    add_action( 'wpo_wcpdf_before_html', function ( $document_type, $document ) {
    	add_filter( 'wc_price_args', 'wpo_wcpdf_currency_price_args', 10, 1 );
    }, 10, 2 );
    add_action( 'wpo_wcpdf_after_html', function ( $document_type, $document ) {
    	remove_filter( 'wc_price_args', 'wpo_wcpdf_currency_price_args', 10, 1 );
    }, 10, 2 );
    
    function wpo_wcpdf_currency_price_args( $args ) {
    	$args['decimals'] = 2;
    	return $args;
    }

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

Viewing 1 replies (of 1 total)
  • The topic ‘Number of decimal’ is closed to new replies.