-
Acatenan
Hi Team,
This may be OOS..
On the product archive, I try to add an attribute above the title (‘Marque’), I managed to have it with the code below but it appears below the price
add_action( ‘woocommerce_after_shop_loop_item’, ‘acf_template_loop_product_meta’, 20 );
function acf_template_loop_product_meta() {
global $product;// Check that we got the instance of the WC_Product object, to be sure (can be removed)
if( ! is_object( $product ) ) {
$product = wc_get_product( get_the_id() );
}echo ‘<h4>’ . $product->get_attribute(‘pa_marque’) .'</h4>’;
}https://i.postimg.cc/PrJVchTm/Capture.jpg
Many thanks for your help
David -
Hi there,
Try replacing the
woocommerce_after_shop_loop_item
towoocommerce_shop_loop_item_title
. -
Acatenan
Hi Alvind,
I’ve tried your solution and the attribute is now displayed below the title, and actually it works great 🙂
Thanks! -
Glad to hear that! 🙂
- You must be logged in to reply to this topic.