Division by zero raised from wcfmmp-view-store-lists-loop.php

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Marketplace (WooCommerce Multivendor Marketplace) Division by zero raised from wcfmmp-view-store-lists-loop.php

Viewing 3 reply threads
  • Author
    Posts
    • #130745
      datacatalysr00t
      Participant

      Hello everyone,

      I’m using wordpress, Theme Child and WCFM Multivendor plugin, theapache2 error logs is full of this warning raised from wcfmmp-view-store-lists-loop.php file, please note that i’m not using pagination in store-list page, all the stores are listed in single page.

      child 21784 said into stderr: "NOTICE: PHP message: PHP Warning: Division by zero in /*/wp-content/plugins/wc-multivendor-marketplace/views/store-lists/wcfmmp-view-store-lists-loop.php on line 17"

      source file:
      https://codeshare.io/24okvL

      i’m not PHP developer but i think that exception is not rescued or something like that

      Thank you in advance.

    • #130770
      Sushobhan
      Keymaster

      Hi,

      By any chance, are you using the wcfm_stores shortcode like this [wcfm_stores per_page=”0″]? If yes, kindly choose a per_page value greater than 0. But if not, it could be a conflict with one of the plugins or the theme you are using. To determine that, please follow this troubleshooting guide:
      https://wclovers.com/knowledgebase/conflict-check/

      Only the site admin would know and your users won’t be affected by this troubleshooting.

      Please let us know if you find the cause.

      Looking forward to helping you.
      Thank You!

    • #131025
      datacatalysr00t
      Participant

      Thank you for your reply

      i checked and i found 2 shortcodes was defined there in the same page
      [wcfm_stores sidebar=”” map=”” includes=”0,38,18,14,17,6,36,218,77,262,16,0″ has_orderby=”” filter=””]
      and
      [wcfm_stores sidebar=”” excludes=”0,38,18,14,17,6,36,218,77,262,16,78,0″ map=”” filter=”” has_orderby=”” per_page=”60″]

      i changed [wcfm_stores sidebar=”” map=”” includes=”0,38,18,14,17,6,36,218,77,262,16,0″ has_orderby=”” filter=””]
      to [wcfm_stores sidebar=”” map=”” includes=”0,38,18,14,17,6,36,218,77,262,16,0″ has_orderby=”” filter=”” per_page=”10″]

      but the issue is not resolved.

      also the pagination shortcode was removed because the client want to scroll down and see all the stores in single page, is this can considered source of that problem?

      is there is any probability that the $limit variable has no value or already set to 0 somewhere or it’s an argument.
      if we see the source code:

      
      16. $user_count   = count($all_stores);
      17. $num_of_pages = ceil( $user_count / $limit );
      19. $args = array(
      	  ...
      		'limit'           => $limit,
      ...);
      60. <?php if ( $num_of_pages > 1 ) { $WCFMmp->template->get_template( 'store-lists/wcfmmp-view-store-lists-pagination.php', $args ); } ?>
      

      thank you for your help.

    • #131700
      Sushobhan
      Keymaster

      Hi,
      Try this- [wcfm_stores has_sidebar="no" has_map="no" includes="38,18,14,17,6,36,218,77,262,16" has_orderby="no" has_filter="no" per_page="10"] just make sure all the store ids that you have provided in includes attribute are correct store ids. I removed two 0’s from includes attribute as 0 can’t be a valid store id.
      For more information about wcfm_stores shortcode read here- https://docs.wclovers.com/store-list/
      Thank You!

Viewing 3 reply threads
  • You must be logged in to reply to this topic.