Hi all at GP, I’ve inserted a Woo attribute to display after the product title using the action below – but now I can’t figure out how to assign a class to the attribute. Can it be done inside the snippet below? p.s. I know just enough to be dangerous, but I find answers to many of my questions here (so thank you!).
/*add location after project title*/
add_action(‘woocommerce_shop_loop_item_title’, ‘wh_insertAfterShopProductTitle’, 15);
function wh_insertAfterShopProductTitle() {
global $product;
$location = $product->get_attribute(‘pa_location’);
if (empty($location))
return;
echo __($location, ‘woocommerce’);
}
Any helpful info or resource would be much appreciated. ๐
Thanks
GP Premium 1.7.5