• bklogos

    (@bklogos)


    Hi,

    WooCommerce PDF Invoice Italian Add-on v0.7.6 & PHP v8.1

    Nov 8, 2024 9:13:21 AM PHP message: PHP Warning: Trying to access array offset on value of
    type bool in /var/www/html/wp-content/plugins/woocommerce-pdf-invoices-italian-add-on/woocommerce-pdf-italian-add-on.php
    on line 170″

    Nov 8, 2024 9:13:21 AM PHP message: PHP Warning: Trying to access array offset on value of type bool in /var/www/html/wp-content/plugins/woocommerce-pdf-invoices-italian-add-on/woocommerce-pdf-italian-add-on.php
    on line 171″

    Nov 8, 2024 9:13:21 AM PHP message: PHP Warning: Trying to access array offset on value of
    type bool in /var/www/html/wp-content/plugins/woocommerce-pdf-invoices-italian-add-on/woocommerce-pdf-italian-add-on.php
    on line 172″

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author labdav

    (@labdav)

    It is better to save all required setting options first. These errors may be caused by this.

    Thread Starter bklogos

    (@bklogos)

    Settings saved and server restarted. No sign of the warnings so far, however inside the plugin PDF Invoices & Packing Slips for WooCommerce v3.9.0, one of documents ( receipt ) no longer displays and shows 200: parsererror

    Thread Starter bklogos

    (@bklogos)

    using the “display receipt” button inside an order throws an error…

    <table class=”head container receipt1″><tbody><tr><td class=”header”>


    <h3>Fatal error: Call to a member function get_header_logo_id() on null</h3>
    /var/www/html/wp-content/themes/blank/woocommerce/pdf/yourtemplates/receipt.php (6)

    #0 /var/www/html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Documents/OrderDocument.php(1494): include()
    #1 /var/www/html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Documents/OrderDocument.php(1352): WPO\IPS\Documents\OrderDocument->render_template('/var/www/html/w...', Array)
    #2 /var/www/html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Documents/OrderDocument.php(1307): WPO\IPS\Documents\OrderDocument->get_html()
    #3 /var/www/html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Documents/OrderDocument.php(1374): WPO\IPS\Documents\OrderDocument->get_pdf()
    #4 /var/www/html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Main.php(528): WPO\IPS\Documents\OrderDocument->output_pdf('inline')
    #5 /var/www/html/wp-includes/class-wp-hook.php(324): WPO\IPS\Main->generate_document_ajax('')
    #6 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
    #7 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #8 /var/www/html/wp-admin/admin-ajax.php(192): do_action('wp_ajax_generat...')
    #9 {main}

    </td></tr></tbody></table>

    Plugin Author labdav

    (@labdav)

    Try to check the Document -> Receipt options of PDF Invoices & Packing Slips.

    And also, try to specify a Logo for your invoices.

    Thread Starter bklogos

    (@bklogos)

    The options are set for both the invoice and receipt, and the logo is set. The invoice document works properly, the receipt document does not.

    Under PHP v8.1.29, PDF Invoices & Packing Slips for WooCommerce v3.9.0 & WooCommerce PDF Invoices Italian Add-on v0.7.4 both work

    Under PHP v8.1.29, PDF Invoices & Packing Slips for WooCommerce
    v3.9.0 & WooCommerce PDF Invoices Italian Add-on v0.7.6 the receipt does not work

    Plugin Author labdav

    (@labdav)

    try to deactivate and remove WooCommerce PDF Invoices Italian Add-on plugin and reinstall it.

    Thread Starter bklogos

    (@bklogos)

    Same results, and if I roll-back to WooCommerce PDF Invoices Italian Add-on v0.7.4 both work

    Plugin Author labdav

    (@labdav)

    maybe you are using a customized version of receipt.php ?

    In this case you should copy the original corresponding invoice.php to receipt.php

    Thread Starter bklogos

    (@bklogos)

    Comparison of the original to the custom, there is only one difference. We removed the meta section Lines 90, 91 & 92.

    <?php $description_label = __( 'SKU', 'woocommerce-pdf-italian-add-on' ); // registering alternate label translation ?>

    <?php if( !empty( $item['sku'] ) ) : ?><dt class="sku"><?php _e( 'SKU:', 'woocommerce-pdf-italian-add-on' ); ?></dt><dd class="sku"><?php echo $item['sku']; ?></dd><?php endif; ?>

    <?php if( !empty( $item['weight'] ) ) : ?><dt class="weight"><?php _e( 'Weight:', 'woocommerce-pdf-italian-add-on' ); ?></dt><dd class="weight"><?php echo $item['weight']; ?><?php echo get_option('woocommerce_weight_unit'); ?></dd><?php endif; ?>
    Thread Starter bklogos

    (@bklogos)

    Original template in the above post = the template from WooCommerce PDF Invoices Italian Add-on v0.7.4

    There is only 1 template file in the folder under WooCommerce PDF Invoices Italian Add-on v0.7.6, it is named receipt.php and it has only a few lines of code.

    <?php 
    if(defined("WP_PLUGIN_DIR") && file_exists(WP_PLUGIN_DIR . "/woocommerce-pdf-invoices-packing-slips/templates/Simple/invoice.php")){
    include WP_PLUGIN_DIR . "/woocommerce-pdf-invoices-packing-slips/templates/Simple/invoice.php";
    }
    Plugin Author labdav

    (@labdav)

    The code of receipt.php must be the same of the corresponding invoice.php.
    The last invoice.php template file must be used for the receipt also.

    Thread Starter bklogos

    (@bklogos)

    I duplicated the last invoice.php template, named it receipt.php and uploaded it to yourtemplates. This resolved any PHP errors, HOWEVER the Receipt Number & Receipt Date fields are now empty.

    OK… If I change relevant code from invoice_number() & invoice_date() to receipt_number() & receipt_date() respectively, it appears to function correctly.

    • This reply was modified 1 week, 4 days ago by bklogos.
    Thread Starter bklogos

    (@bklogos)

    Tried to display a few different orders and received this PHP Warning

    PHP message: PHP Warning: Undefined array key “txtVatExemptUE” in /var/www/html/wp-content/plugins/woocommerce-pdf-invoices-italian-add-on/includes/class-wcpdf-integration3.php on line 448″

    Plugin Author labdav

    (@labdav)

    Maybe the last error happens because of some options not are saved correctly.
    txtVatExemptUE is in the first page of options of WooCommerce PDF Invoice Italian Add-on

    Thread Starter bklogos

    (@bklogos)

    I saved the options page first, but just to double check I saved them again and ran the tests, same PHP Warning

    Nov 11, 2024 12:19:24 PM
    PHP message: PHP Warning: Undefined array key “txtVatExemptUE” in /var/www/html/wp-content/plugins/woocommerce-pdf-invoices-italian-add-on/includes/class-wcpdf-integration3.php
    on line 448″

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