• Resolved nicole0155

    (@nicole0155)


    Hello,

    I started to have the following error at the menu Woocommerce, Print:

    “There has been a critical error on this website. Please check your site admin email inbox for instructions.”

    The email contains:

    “line 465 wp-content/plugins/woocommerce-delivery-notes/includes/class-wcdn-settings.php. Error: Uncaught DivisionByZeroError: Division by zero in wp-content/plugins/woocommerce-delivery-notes/includes/class-wcdn-settings.php:465”

    I can print invoices, however the company Logo disappeared. Also I can not see the any menus so, is not possible to upload again the logo.

    Can you help?

    Thank you

    PS. Versions:

    WordPress 6.4.1
    Flatsome (3.18.0)
    Plugin Print Invoice & Delivery Notes for WooCommerce (vers?o 4.8.1)
    PHP 8.2.12

    • This topic was modified 1 year ago by nicole0155.
    • This topic was modified 1 year ago by nicole0155.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter nicole0155

    (@nicole0155)

    Dear Team,

    We have checked the line 465, and a division by zero started because the logo picture disappeared.

    We have commented the line at the following function, added the logo again and it started to work.

    		public function create_image( $attachment_id ) {
    			$attachment_src = wp_get_attachment_image_src( $attachment_id, 'medium', false );
    			$orientation    = 'landscape';
    			if ( ( $attachment_src[1] / $attachment_src[2] ) < 1 ) {
    				$orientation = 'portrait';
    			}
    
    			?>
    			<img src="<?php echo esc_url( $attachment_src[0] ); ?>" class="<?php echo esc_attr( $orientation ); ?>" alt="" />
    			<?php
    		}
    

    Please consider a correction in future versions.

    Thanks.

    nick1122

    (@nick1122)

    Hi,

    We have fixed this issue, & I am sending you a patch file to resolve this issue.

    1. You can download the code patch from this link – https://www.dropbox.com/scl/fi/qbx14ukjrzo2dx2mrsimi/class-wcdn-settings.php?rlkey=tptq1elrn4cxhi21za3kbwsup&dl=0
    2. After downloading the file, you can replace it with the original file in the \wp-content\plugins\woocommerce-delivery-notes\includes.

    Please let me know if the provided solution resolves your issue. If it doesn’t work, please create the ticket?here?on our support tool so that we can communicate in detail.

    Regards,
    Nikhil.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Critical Error’ is closed to new replies.