
Display fresh, random WooCommerce related products on every single product page load (in a slider or not) based on the current product’s category, tags, or attributes.
Related products can be configured to display in posts, pages, and sidebar widgets, and can be configured to exclude categories.
Use the shortcode [woo-related] for product pages or [woo-related id='XX'] / [woo-related product-id='XX' show-title='no'] for posts, pages, and widgets.
Exclude taxonomies using the the option field in the settings page.
The shortcode accepts id, title and number.
[woo-related id='15']
will display related products based on product ID 15.
[woo-related id='15' title='no']
is the same as above but will hide Related Products title. For sidebars, etc. you can use the widget title.
[woo-related id='15' title='no' number='1']
is the same as above but will return only 1 product.
[woo-related]
will use current product’s ID. This should be used on product pages only.
Related Products for WooCommerce uses WordPress hooks to display related products on product pages. If you need to move the related products block you can remove the action and add it again using a different hook or priority. This is extremly helpful if you code your own theme or child theme.
To remove related products block you can use
remove_action( 'woocommerce_after_single_product', 'wrprrdisplay' );
in your theme’s functions.php file.
If you want to add it again you can do something like this
add_action( 'woocommerce_after_single_product', 'wrprrdisplay', 55 );
or
add_action( 'ANY-OTHER-HOOK', 'wrprrdisplay', PRIORITY );
Check GitHub for all single product page actions.
You can see a demo of the plugin here.
Download & install the zip archive
The plugin package installer can be downloaded from the WP2E project tab called “code”.
1 – Select the version to download if this option is available otherwise the “latest” version of the main plugin will be used.
2 – After downloading the zip archive install the plugin package installer in you local environment and activate the script from the plugin list.
3 – Under the section “Plugins” of the admin dashboard you should see a new “Dependencies & Licenses” link. Follow the instructions from this panel to finalize the installation of the missing dependencies.
Tips: Use the WP2E panel to add/suggest new dependencies to the local installation. Press F5 in the list of dependencies if the changes are not displayed right away.