Skip to content
Advertisement

How to get rid of internal

tags of wc_display_item_meta() in woocommerce

Is there a way, that we can get rid of the internal <p> tags of wc_display_item_meta() in the email-order-items.php. Currently, it returns the values like this.

Color:

  • Blue

Size:

  • XL

In which the Blue and XL are inside the <p> tags. I want it to display it like

Color: Blue

Size: XL

The wc_display_item_meta() has parameters of $item and array of arguments. These arguments include

'before'    => '<ul class="wc-item-meta"><li>',  
'after'     => '</li></ul>',  
'separator' => '</li><li>',`

But no matter what I put in the arguments, it has the internal <p> tag for the values of the metadata.

Any help will be appreciated in this regard. Thanks

Advertisement

Answer

Can u try this

<div class="my-class">
 <?php echo wc_display_item_meta(); ?>
</div>

CSS

.my-class p {
  width: 200px;
  display: inline-block;
}

http://jsfiddle.net/epm1t2fv/

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement