• Resolved Newt Labs

    (@newtlabs)


    Please fix deprecations overwhelming error log:

    1. The method invoice_number() is deprecated since version 3.7.3, please use the method number() instead.
    2. The method invoice_date() is deprecated since version 3.7.3, please use the method date() instead.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Mohamad

    (@mohamadntr)

    Hi @newtlabs,

    Are you using a custom template? If so, then you need to update those methods that you used in your custom template to stop the deprecation logs.

    Best regards

    Thread Starter Newt Labs

    (@newtlabs)

    good point, cheers.

    Thread Starter Newt Labs

    (@newtlabs)

    Hi, after changing invoice_number to number and invoice_date to date the pdfs stopped working and returned a fatal error:

    Fatal error: Too few arguments to function WPO\WC\PDF_Invoices\Documents\Order_Document::number(), 0 passed in /themes/ico/woocommerce/pdf/iCO/invoice.php on line 119 and exactly 1 expected.

    This is how the code is being used in the custom template:

                <?php if ( isset($this->settings['display_number']) ) { ?>
    
                <tr class="invoice-number">
    
                    <th><?php echo $this->get_number_title(); ?></th>
    
                    <td><?php $this->invoice_number(); ?></td>
    
                </tr>
    
                <?php } ?>
    
                <?php if ( isset($this->settings['display_date']) ) { ?>
    
                <tr class="invoice-date">
    
                    <th><?php echo $this->get_date_title(); ?></th>
    
                    <td><?php $this->invoice_date(); ?></td>
    
                </tr>
    
                <?php } ?>

    Please can you confirm what needs changing so we are not using deprecations?

    Plugin Contributor Mohamad

    (@mohamadntr)

    Hi @newtlabs,

    Please try this code:

    <?php $this->number( $this->get_type() ); ?>

    Do the same for the date:

    <?php $this->date( $this->get_type() ); ?>

    Best regards

    Thread Starter Newt Labs

    (@newtlabs)

    that seems to work, thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.