attributes of simple products to be below the product title

  • Author
    Posts
  • #14973

    BUATON michel
    Participant

    hello
    I want the attributes of simple products to be below the product title and not in the “additional information” table.
    thank you

    #14976

    Andrew Misplon
    Keymaster

    Hi Michel

    Thanks for reaching out.

    If you’d prefer to use email support, you’re welcome to do so. [email protected].

    * Go to Plugins, search for and install a plugin called Code Snippets.
    * Go to Snippets > Add New, name your snippet as you’d like, and insert into the snippet body:

    /**
     * Remove product data tabs as required.
     */
    function polestar_child_remove_product_tabs( $tabs ) {
    	global $product;
    	if ( $product->is_type( 'simple' ) ) {
    		unset( $tabs['additional_information'] ); // Remove the additional information tab.
    	}
    	
    	return $tabs;
    }
    add_filter( 'woocommerce_product_tabs', 'polestar_child_remove_product_tabs', 98 );
    
    /**
     * Displays product attributes before the Add to Cart form.
     */
    function polestar_child_display_attributes() {
    	global $product;
    	if ( ! $product->is_type( 'simple' ) ) return;
    	wc_display_product_attributes( $product );
    }
    add_action ( 'woocommerce_single_product_summary', 'polestar_child_display_attributes', 5 );

    Set the snippet to run on the site front-end. Click the Save and Activate button.

    Once the snippet is working, please, let me know if you need small styling/spacing adjustments, I’ll assist further from there.

    Thanks

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Scroll to top