These snippets change how products are listed in CheckoutWC’s cart summary, the side cart, and the thank you and order pay pages. For links back to the cart, see Customize the checkout layout with code.
Where to add these snippets
- PHP snippets go under CheckoutWC » Advanced » Scripts, in the PHP Snippets box of the Global section, without the opening
<?phptag. You can also use a child theme’sfunctions.phpor a code snippets plugin. The PHP Snippets box runs on storefront requests but not in the WordPress admin, so a snippet that must also run there (the thumbnail size filters below) goes in a code snippets plugin orfunctions.php. - CSS goes in Custom CSS under CheckoutWC » Appearance » Design, in the CSS section. It applies to the side cart as well as the checkout.
- Test on staging first. These snippets were checked against CheckoutWC 11.5.0.
Some item display options are settings, under CheckoutWC » Pages, on the Global Options tab, in the Cart Summary section:
- Cart Item Links: links product names and images to their product pages. Disabled (Recommended) by default.
- Cart Item Data Display: Short (Recommended) puts variation details on one line; WooCommerce Default shows each on its own line.
Show the product SKU
In the cart summary and side cart
This adds the SKU to each item’s details, alongside variation details like size or color. It works in the checkout’s cart summary, the side cart, and WooCommerce’s own cart:
add_filter( 'woocommerce_get_item_data', function ( $data, $cart_item ) {
if ( ! empty( $cart_item['data'] ) && $cart_item['data'] instanceof WC_Product ) {
$sku = $cart_item['data']->get_sku();
if ( '' !== $sku ) {
$data[] = array( 'key' => 'SKU', 'value' => $sku );
}
}
return $data;
}, 10, 2 );
Products without a SKU show nothing. With Cart Item Data Display set to Short, the SKU is joined to the other details on one line.
On its own line, including the thank you page
To show the SKU on its own line under each item, and also in the order summary on the thank you and order pay pages, use CheckoutWC’s item hooks:
function my_cfw_print_sku( $sku ) {
if ( '' !== (string) $sku ) {
echo '<div class="cfw-small">SKU: ' . esc_html( $sku ) . '</div>';
}
}
// Checkout cart summary
add_action( 'cfw_cart_item_after_data', function ( $raw_item, $item_key, $item ) {
my_cfw_print_sku( $item->get_product()->get_sku() );
}, 10, 3 );
// Side cart
add_action( 'cfw_side_cart_item_after_data', function ( $raw_item, $item_key, $item ) {
my_cfw_print_sku( $item->get_product()->get_sku() );
}, 10, 3 );
// Thank you and order pay pages (the product may have been deleted since the order)
add_action( 'cfw_order_item_after_data', function ( $raw_item ) {
$product = is_callable( array( $raw_item, 'get_product' ) ) ? $raw_item->get_product() : false;
my_cfw_print_sku( $product ? $product->get_sku() : '' );
}, 10, 3 );

Show or hide sale prices
For products on sale, CheckoutWC can show the regular price struck through next to the sale price, for example ~~$10.00~~ $5.00. It’s on by default.
Enable Sale Prices under CheckoutWC » Side Cart, in the Options section, controls this for both the side cart and the checkout’s cart summary. That setting only shows when the side cart is on.
Note: The Enable Sale Prices setting under Pages » Global Options, and Sale Prices in the Checkout Editor, currently have no effect.
You can also turn sale prices on or off with code:
add_filter( 'cfw_show_cart_item_discount', '__return_false' ); // or __return_true
This doesn’t change the thank you and order pay pages.
Change the size of item thumbnails
CheckoutWC uses its own image size, cfw_cart_thumb, for item thumbnails in the cart summary, side cart, order summaries and abandoned cart emails. It’s 60 pixels wide by default, with automatic height. Three filters change it:
add_filter( 'cfw_cart_thumb_width', function () {
return 100;
} );
add_filter( 'cfw_cart_thumb_height', function () {
return 100; // 0 keeps the original proportions
} );
add_filter( 'cfw_crop_cart_thumbs', '__return_true' ); // crop to exactly this size
Put these in your child theme’s functions.php or a snippets plugin rather than PHP Snippets. WordPress creates thumbnail files when you upload an image in the admin, where PHP Snippets don’t run. Then regenerate thumbnails for existing images, for example with a thumbnail regeneration plugin.
The size on screen is set by CSS. To show the larger image, add this to Custom CSS:
.cfw-cart-table .cart-item-row .cfw-cart-item-image { width: 100px; }
.cfw-cart-table .cart-item-row .cfw-cart-item-image img { width: 100px !important; height: auto; }