Search code examples
phpwoocommerceattributesdropdown

Remove attribute label for variable products in Woocommerce Single product page


I can "Hide" the attribute label using this code:

add_filter( 'woocommerce_attribute_label', 'remove_attribute_label');
function remove_attribute_label() {
    return "";
}

It works fine, however, formatting keeps my variations choices slightly to the right instead of aligning left. (see Image: Standard and Extended License radio buttons not aligned left

The Standard and Extended License radio buttons are not aligned left, and my goal is to have them aligned left.

Thanks for any help.


Solution

  • I added some CSS, based on Richard comment, to change the right padding from 1em to 0em, and it worked:

    .woocommerce div.product form.cart .variations .label {
        padding-right: 0em;
        text-align: left; 
    }
    

    The radio buttons are now aligned left.