Related Products – Product Recommendations for WooCommerce plugin by WebToffee allows you to display related product recommendations on your product pages. This strategic method can greatly enhance user experience, increase cross-selling opportunities, boost average order value, and drive more sales and revenue. Additionally, the plugin offers several other perks. In this article, we will explain how you can easily display related products on the WooCommerce Checkout page with the help of a code snippet.
Set up related products
To begin with, once the plugin is installed and activated:
- From the WordPress dashboard, navigate to WooCommerce > Related products.
- Configure the Related product recommendations as you prefer.
- You can choose to display WooCommerce’s default-related product recommendation or set a customized recommendation version.
- Save your changes.
Display related products on checkout
To display the related product recommendations on the checkout page, use the code snippet provided below in your theme’s functions.php file. To do so,
- Navigate to Appearance > Theme File Editor > functions.php file from the WordPress dashboard.
- Copy the code snippet provided below.
- Paste the code snippet into the bottom of the functions.php file.
- Save the functions.php file.
- Alternatively, if you can’t find the functions.php file for your theme, refer to this article to learn how to add the code snippet to your store.
Code snippet
Once the snippet is added successfully, the related product recommendation will be displayed on the checkout page.
The provided code snippet showcases related products on the checkout page after the checkout form. If you prefer to place them in a different location on the checkout page other than after the checkout form, you can replace the following action hook in the code snippet, woocommerce_after_checkout_form
, with one of your choices.
Refer to the following article to explore different action hooks available on the checkout page and change the position as per your preference: WooCommerce Visual Hook Guide – Checkout Page.