Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › Division by zero raised from wcfmmp-view-store-lists-loop.php
- This topic has 3 replies, 2 voices, and was last updated 4 years, 7 months ago by Sushobhan.
- AuthorPosts
- May 14, 2020 at 5:26 am #130745datacatalysr00tParticipant
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/24okvLi’m not PHP developer but i think that exception is not rescued or something like that
Thank you in advance.
- May 14, 2020 at 7:57 am #130770SushobhanKeymaster
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! - May 14, 2020 at 9:54 pm #131025datacatalysr00tParticipant
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.
- May 16, 2020 at 11:59 am #131700SushobhanKeymaster
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!
- AuthorPosts
- You must be logged in to reply to this topic.