WooCommerce: Add Upsell Area @ Checkout Page

If you want to increase your AOV (Average Order Value), you can definitely start from the WooCommerce Checkout page.

A client asked me to place a “Donation Area” close to the “Place Order” button (so at the bottom of the page, once customers are ready to pay) to drive more awareness around this add-on. All I had to do was creating hidden products with a donation value, use my own “Custom Add to Cart URL” guide to create add to cart links and print an HTML box right above the checkout button by using my WooCommerce Visual Hook Guide for the Checkout Page. Enjoy!

How to show an upsell / add-on area @ WooCommerce Checkout (suggesting to add more products to cart)

PHP Snippet: Show Add-Ons Area @ WooCommerce Checkout Page


  1. Product IDs you want to add to Cart (14877, 14879, 15493 in my example)
  2. No “redirect to Cart after add to cart” option checked in WooCommerce settings
 * @snippet       Upsell Area - WooCommerce Checkout
 * @how-to        Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 3.6.1
 * @donate $9     https://businessbloomer.com/bloomer-armada/

add_action( 'woocommerce_review_order_before_submit', 'bbloomer_checkout_add_on', 9999 );

function bbloomer_checkout_add_on() {
	$product_ids = array( 14877, 14879, 15493 );
	$in_cart = false;
	foreach( WC()->cart->get_cart() as $cart_item ) {
	   $product_in_cart = $cart_item['product_id'];
	   if ( in_array( $product_in_cart, $product_ids ) ) {
		   $in_cart = true;
	if ( ! $in_cart ) {
		echo '<h4>Make a Donation?</h4>';
		echo '<p><a class="button" style="margin-right: 1em; width: auto" href="?add-to-cart=14877"> €5 </a><a class="button" style="margin-right: 1em; width: auto" href="?add-to-cart=14879"> €20 </a><a class="button" style="width: auto" href="?add-to-cart=15493"> €50 </a></p>';

Where to add this snippet?

You can place PHP snippets at the bottom of your child theme functions.php file (before "?>" if you have it). CSS, on the other hand, goes in your child theme style.css file. Make sure you know what you are doing when editing such files - if you need more guidance, please take a look at my free video tutorial "Where to Place WooCommerce Customization?"

Does this snippet (still) work?

Please let me know in the comments if everything worked as expected. I would be happy to revise the snippet if you report otherwise (please provide screenshots). I have tested this code with Storefront theme, the WooCommerce version listed above and a WordPress-friendly hosting on PHP 7+.

If you think this code saved you time & money, please join other Business Bloomer supporters and avail of 365 days of WooCommerce benefits. Thank you in advance :)

Need Help with WooCommerce Customization?

Check out these free video tutorials. You can start learning how to customize WooCommerce without unnecessary plugins. Watch me code and learn by example!

  • how-to-edit-woocommerce-with-php-snippets
  • woocommerce-hooks-add_action-list-visual
  • woocommerce-customize-single-product-page-PHP

Rodolfo Melogli

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as a WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza.

4 thoughts on “WooCommerce: Add Upsell Area @ Checkout Page

  1. Suppose I add a jQuery datepicker field here ( at “woocommerce_review_order_before_submit” hook ), it automatically reloads and jQuery datepicker stops working. Look as normal textbox field. Can you help me on this. This works on other hook position available at checkout page.

    1. Hey Sanesh, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  2. Neat tip Rodolfo 🙂

    Just want to add for variable products, you must add the variation’s ID or the user will get error notifications. Thankfully, you already told us how to do that in you article about custom add to cart URLs: https://businessbloomer.com/woocommerce-custom-add-cart-urls-ultimate-guide/

    1. Great, thanks Lionel!

Questions? Feedback? Support? Leave your Comment Now!

If you are writing code, please wrap it between: [php]code_here[/php]. Failure to complying with this (as well as going off topic) will result in comment deletion. You should expect a reply in about a week - this is a popular blog but I need to get paid work done first. Please consider joining #BloomerArmada to ask me 1-to-1 WooCommerce questions. Thank you :)

Your email address will not be published. Required fields are marked *