简体   繁体   中英

Woocommerce Related Products only showing the same products on reload

Woocommerce version 2.3.10 Wordpress 4.2.2

The related products are cycling through the same products, which seem to be the first few products added to the shop.

It displays them in random order, but doesn't randomly show all of the products in the category.

I've read that this could be due to a plugin conflict preventing random products from being shown, but I haven't been able to find any conflict.

Get the same problem here. Find something that worked: in related.php is like that:

$related = $product->get_related( '$posts_per_page' );

I changed the value "$posts_per_page" to "99", like this:

$related = $product->get_related( '99' );

So this worked! I was suspecting that the woo gets only the X number of products from the related and because of that was cycling through them (here was 4 products). Obviously the problem is in the value this variable gets, but for now i will leave like this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM