Skip to content

Instantly share code, notes, and snippets.

View gagnonconsulting's full-sized avatar

Richard Gagnon gagnonconsulting

View GitHub Profile
### Begin System Info ###
## Please include this information when posting support requests ##
Multisite: No
SITE_URL: http://psuidev.com/wp
HOME_URL: http://psuidev.com/wp
<?php
/* Display the current SKU of the variable product */
add_filter( 'woocommerce_cart_item_name', 'add_sku_in_cart', 20, 3);
function add_sku_in_cart( $title, $values, $cart_item_key ) {
$sku = $values['data']->get_sku();
return $sku ? $title . sprintf(" (SKU: %s)", $sku) : $title;
}
<?php get_template_part( 'index','search'); ?>