- This topic has 1 reply, 2 voices, and was last updated 11 years, 11 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Troubleshooting › eStore – extra random shortcode bug with "number" parameter
Hello,
I hope it is a right place to report a bug.
When using [wp_eStore_random_products]
shortcode, if the parameter “number=” is greater than the total count of retrieved products, e.g.
number=5
total products for that query = 1
Then WordPress shows this error:
Warning: array_rand() [function.array-rand]: Second argument has to be between 1 and the number of elements in the array in /.../wp-content/plugins/eStore-extra-shortcodes/shortcode_include4.php on line 32
I fixed it by adding
$number = min($number, count($products_pool));
before the line #32
Thank you for reporting this. I will make the necessary change in the extra eStore shortcodes addon.