Skip to content

Commit

Permalink
Fix Related post offset.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Feb 20, 2015
1 parent 321d38b commit 6c95621
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion includes/abstracts/abstract-wc-product.php
Expand Up @@ -1313,7 +1313,7 @@ public function get_related( $limit = 5 ) {
}

// Generate limit
$offset = absint( rand( 0, $max_related_posts - $limit ) );
$offset = $max_related_posts < $limit ? 0 : absint( rand( 0, $max_related_posts - $limit ) );
$query['limits'] = " LIMIT {$offset}, {$limit} ";

// Get the posts
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Expand Up @@ -143,6 +143,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Fix - Unhook wc_page_endpoint_title after it is ran once (main page title).
* Fix - Taxes save issue when page is paginated.
* Fix - Cross/up-sells should not search variations.
* Fix - Related post offset.
* Tweak - Round report values.
* Tweak - Text in plain text emails.
* Tweak - Improve category coupon message.
Expand Down

0 comments on commit 6c95621

Please sign in to comment.