WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: WooCommerce] Warning: Division by zero (12 posts)

  1. johnsorci
    Member
    Posted 7 months ago #

    I am using WooCommerce with the Themeforest X Ultimate WordPress Theme.

    I cannot get the product thumbnails to show on the main shop page or any page. Instead I get this:

    Warning: Division by zero in /home/content/86/7154286/html/doodlesncompany/wp-content/plugins/woocommerce/templates/content-product.php on line 33
    
    Warning: Division by zero in /home/content/86/7154286/html/doodlesncompany/wp-content/plugins/woocommerce/templates/content-product.php on line 35

    When going into my files, these are the lines it is referencing:

    // 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';
    ?>

    I have searched around for answers and nothing that I have found/tried has worked.

    Thanks for any help.

  2. johnsorci
    Member
    Posted 7 months ago #

    Figured it out.

  3. nestito
    Member
    Posted 7 months ago #

    Glad you found the resolution. What did it end up being? How did you fix it?

  4. gazza777
    Member
    Posted 6 months ago #

    What was the solution? I have the same issue.

  5. esmi
    Forum Moderator
    Posted 6 months ago #

    @gazza777: If you require assistance then, as per the Forum Welcome, please post your own topic.

  6. gazza777
    Member
    Posted 6 months ago #

    Why would I open ANOTHER topic when my problem is EXACTLY the same?

  7. EedAbba
    Member
    Posted 6 months ago #

    I am not sure of the etiquette but I also need this resolved. Any tips would be appreciated. I don't complete understand PHP but I can edit it with some direction.

  8. tozq
    Member
    Posted 6 months ago #

    I have the same problem here too.

  9. tozq
    Member
    Posted 6 months ago #

    solved the problem.
    just disable all plugins and delete all products.

  10. tozq
    Member
    Posted 6 months ago #

    it is the "WooCommerce Customizer" cause the problem. Disable it everything ok.

  11. Tiresias28
    Member
    Posted 5 months ago #

    For those who are having the problem, you don't have to modify code or disable the plugin. Within the Customizer, there is a tab that gives WooCommerce Options. Just go in there, choose your settings, save, and the error will go away.

  12. Robey Lawrence
    Member
    Posted 4 months ago #

    @Tiresias28 Thank You!
    fixed for me.

    hmmm, I wonder what caused it to lose it's settings in the first place though. scary thought...

Reply

You must log in to post.

About this Topic