Home Forums WoodMart support forum Attributes!

Attributes!

Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #53160

    nackgr
    Participant

    Hello

    i want automatic the product to show attributes at short decription like here
    https://woodmart.xtemos.com/shop/other/electronics/asus-zenbook-ux510uw/
    (Display 15.6″ Full HD
    Processor Intel Core i7
    RAM 16GB)

    I create a product and left empty the shirt description but dont show anything
    http://test.e-byte.gr/shop/hp-elitebook-8470p/

    tnx

    #53188

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file to do this

    function woodmart_custom_attributes() {
        global $product;
        wc_display_product_attributes( $product );
    }
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
    add_action( 'woocommerce_single_product_summary', 'woodmart_custom_attributes', 20 );
    
    function woodmart_remove_product_tabs( $tabs ) {
        unset( $tabs['additional_information'] );  	// Remove the additional information tab
        return $tabs;
    }
    add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
    #53192

    nackgr
    Participant

    hello

    i edit that

    wp-content/themes/woodmart-child/functions.php

    but no changes

    i have active woodmart no woodmart-child

    #53210

    Artem Temos
    Keymaster

    You need to activate the child theme in Appearance -> Themes to apply that code.

    #53229

    nackgr
    Participant

    added it but has some error

    look that error
    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘woo_remove_product_tabs’ not found or invalid function name in /home/nackgr2/webapps/ebytenew/wp-includes/class-wp-hook.php on line 286

    http://test.e-byte.gr/shop/hp-elitebook-8470p/

    #53252

    Artem Temos
    Keymaster

    Seems that you have some extra code added to the functions.php file in the child theme that is not related to our theme and cause this problem.

    #53287

    nackgr
    Participant

    <?php

    add_action( ‘wp_enqueue_scripts’, ‘woodmart_child_enqueue_styles’, 1000 );

    function woodmart_child_enqueue_styles() {
    $version = woodmart_get_theme_info( ‘Version’ );

    if( woodmart_get_opt( ‘minified_css’ ) ) {
    wp_enqueue_style( ‘woodmart-style’, get_template_directory_uri() . ‘/style.min.css’, array(‘bootstrap’), $version );
    } else {
    wp_enqueue_style( ‘woodmart-style’, get_template_directory_uri() . ‘/style.css’, array(‘bootstrap’), $version );
    }

    wp_enqueue_style( ‘child-style’, get_stylesheet_directory_uri() . ‘/style.css’, array(‘bootstrap’), $version );

    function woodmart_custom_attributes() {
    global $product;
    wc_display_product_attributes( $product );
    }
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_excerpt’, 20 );
    add_action( ‘woocommerce_single_product_summary’, ‘woodmart_custom_attributes’, 20 );

    function woodmart_remove_product_tabs( $tabs ) {
    unset( $tabs[‘additional_information’] ); // Remove the additional information tab
    return $tabs;
    }
    add_filter( ‘woocommerce_product_tabs’, ‘woo_remove_product_tabs’, 98 );

    }

    #53294

    Artem Temos
    Keymaster

    Just remove all the code that are not related to our theme. Or you can get original child theme’s functions.php file from the package downloaded on ThemeForest.

    #53327

    nackgr
    Participant

    thats the default function php of child template

    <?php

    add_action( ‘wp_enqueue_scripts’, ‘woodmart_child_enqueue_styles’, 1000 );

    function woodmart_child_enqueue_styles() {
    $version = woodmart_get_theme_info( ‘Version’ );

    if( woodmart_get_opt( ‘minified_css’ ) ) {
    wp_enqueue_style( ‘woodmart-style’, get_template_directory_uri() . ‘/style.min.css’, array(‘bootstrap’), $version );
    } else {
    wp_enqueue_style( ‘woodmart-style’, get_template_directory_uri() . ‘/style.css’, array(‘bootstrap’), $version );
    }

    wp_enqueue_style( ‘child-style’, get_stylesheet_directory_uri() . ‘/style.css’, array(‘bootstrap’), $version );

    }

    #53343

    Artem Temos
    Keymaster

    Yes, it is a default code from the child theme.

    #53345

    nackgr
    Participant

    so what is the problem 😀

    #53346

    Artem Temos
    Keymaster

    You sent two pieces of codes. The first one is from your child theme and the second one from ours. As you can see, they are different. Your code has some PHP errors. Just replace it with our theme’s code.

    #53348

    nackgr
    Participant

    i try to explain the same thing i havent change nothing i use the default child theme function file and i just add ur shortcode and says error

    #53356

    Artem Temos
    Keymaster

    OK, put the following PHP code to the child theme functions.php file

    <?php
    
    add_action( 'wp_enqueue_scripts', 'woodmart_child_enqueue_styles', 1000 );
    
    function woodmart_child_enqueue_styles() {
    	$version = woodmart_get_theme_info( 'Version' );
    	
    	if( woodmart_get_opt( 'minified_css' ) ) {
    		wp_enqueue_style( 'woodmart-style', get_template_directory_uri() . '/style.min.css', array('bootstrap'), $version );
    	} else {
    		wp_enqueue_style( 'woodmart-style', get_template_directory_uri() . '/style.css', array('bootstrap'), $version );
    	}
    
        wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array('bootstrap'), $version );
        
    }
    
    function woodmart_custom_attributes() {
        global $product;
        wc_display_product_attributes( $product );
    }
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
    add_action( 'woocommerce_single_product_summary', 'woodmart_custom_attributes', 20 );
    
    function woodmart_remove_product_tabs( $tabs ) {
        unset( $tabs['additional_information'] );
        return $tabs;
    }
    add_filter( 'woocommerce_product_tabs', 'woodmart_remove_product_tabs', 98 );
    #53367

    nackgr
    Participant

    working !

    need few modifications because it looks different i think i can make it

    http://test.e-byte.gr/shop/hp-elitebook-8470p/

    #53396

    Artem Temos
    Keymaster

    Try to add the following code snippet to the Custom CSS area in Theme Settings

    .shop_attributes p {
    	margin-bottom: 0;
    }
    #53434

    nackgr
    Participant

    great tnx!
    nice support

    #53449

    You are always welcome! If you have any questions feel free to contact us.

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

The topic ‘Attributes!’ is closed to new replies.