skip to Main Content

I’m using WooCommerce and Elementor Pro. Is there any way to add specific product attributes (e.g. gross and net weight) below the Add to cart button?

It seems like an obvious thing but I haven’t found options or snippets for it.

example

2

Answers


  1. First you add attributes to product. Then you use this snippet in functions.php:

    // maybe remove tab with attributes
    add_filter( 'woocommerce_product_tabs', 'remove_info', 100, 1 );
    function remove_info( $tabs ) {
        unset($tabs['additional_information']);
        return $tabs;
    }
    
    // show attributes
    add_action( 'woocommerce_single_product_summary', 'summary_attributes', 35 );
    function summary_attributes() {
        global $product;
        if ( $product->has_attributes() ) {
            wc_display_product_attributes( $product );
        }
    }
    
    Login or Signup to reply.
  2. Setting Up WooCommerce Attributes

    • go to Products > Attributes
    • Add the attribute name
    • Slug will automatically be created, and we can leave the rest of these options untouched.
    • Click “Add attribute” button and your attribute will be added.

    Configure The Attributes

    After creating attribute, now we can add different variation on your product. Click on the Configure Terms option.

    • Enter the variation
    • Add some short description
    • Click on the add new tab

    To understand it in a better way you can follow this tutorial

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search