• It is coming up with the following – Warning: Division by zero in /var/sites/c/champade.co.uk/public_html/wp-content/plugins/woocommerce/templates/content-product.php on line 38

    I have refreshed a back up from before this happened, but it is still there.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Can you try downloading a fresh package from the WooThemes site and copying the file across onto your server? It might have been an odd file that has glitched in an update or something.

    Also, could you paste the line of code here that is causing the problem. If you paste line 38 between back ticks, then we can see what’s actually playing up.

    Thread Starter Champade

    (@champade)

    I just don’t want to lose anything that I have done by re-downloading.

    The code is as follows:

    // Extra post classes
    $classes = array();
    if ( 0 == ( $woocommerce_loop[‘loop’] – 1 ) % $woocommerce_loop[‘columns’] || 1 == $woocommerce_loop[‘columns’] ) {
    $classes[] = ‘first’;
    }
    if ( 0 == $woocommerce_loop[‘loop’] % $woocommerce_loop[‘columns’] ) {
    $classes[] = ‘last’;
    }

    Thread Starter Champade

    (@champade)

    I tried deleting this code, but it then did not show any images with my products, although it did remove the error message.

    Which of the above lines is line 38 exactly?

    Thread Starter Champade

    (@champade)

    Sorry, it’s the first line which starts with if…

    if ( 0 == ( $woocommerce_loop[‘loop’] – 1 ) % $woocommerce_loop[‘columns’] || 1 ==

    I am not too familiar with WooCommerce but maybe you have set the value of columns to 0 somewhere in the settings?

    Thread Starter Champade

    (@champade)

    I have looked into the settings and cannot find anywhere that I have put 0. After playing around with things, it now looks like this…

    https://snag.gy/WzWnN.jpg

    Does anyone know how I can get my images back?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Getting a warning in woocommerce’ is closed to new replies.