Home › Forums › WoodMart support forum › Attributes!
Attributes!
- This topic has 17 replies, 3 voices, and was last updated 6 years, 7 months ago by Elise Noromit.
-
AuthorPosts
-
April 18, 2018 at 2:52 pm #53160
nackgrParticipantHello
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
April 18, 2018 at 4:29 pm #53188
Artem TemosKeymasterTry 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 );
April 18, 2018 at 4:38 pm #53192
nackgrParticipanthello
i edit that
wp-content/themes/woodmart-child/functions.php
but no changes
i have active woodmart no woodmart-child
April 18, 2018 at 5:37 pm #53210
Artem TemosKeymasterYou need to activate the child theme in Appearance -> Themes to apply that code.
April 18, 2018 at 9:59 pm #53229
nackgrParticipantadded 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 286April 19, 2018 at 6:12 am #53252
Artem TemosKeymasterSeems 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.
April 19, 2018 at 7:29 am #53287
nackgrParticipant<?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 );}
April 19, 2018 at 7:54 am #53294
Artem TemosKeymasterJust 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.
April 19, 2018 at 9:46 am #53327
nackgrParticipantthats 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 );
}
April 19, 2018 at 11:13 am #53343
Artem TemosKeymasterYes, it is a default code from the child theme.
April 19, 2018 at 11:14 am #53345
nackgrParticipantso what is the problem 😀
April 19, 2018 at 11:15 am #53346
Artem TemosKeymasterYou 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.
April 19, 2018 at 11:16 am #53348
nackgrParticipanti 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
April 19, 2018 at 11:35 am #53356
Artem TemosKeymasterOK, 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 );
April 19, 2018 at 12:01 pm #53367
nackgrParticipantworking !
need few modifications because it looks different i think i can make it
April 19, 2018 at 1:08 pm #53396
Artem TemosKeymasterTry to add the following code snippet to the Custom CSS area in Theme Settings
.shop_attributes p { margin-bottom: 0; }
April 19, 2018 at 3:03 pm #53434
nackgrParticipantgreat tnx!
nice supportApril 19, 2018 at 5:33 pm #53449
Elise NoromitMemberYou are always welcome! If you have any questions feel free to contact us.
-
AuthorPosts
The topic ‘Attributes!’ is closed to new replies.
- You must be logged in to create new topics. Login / Register