Skip to content

Instantly share code, notes, and snippets.

@ibndawood
Last active February 2, 2022 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ibndawood/d3533bd209c5dd3a3c3e50af79126c02 to your computer and use it in GitHub Desktop.
Save ibndawood/d3533bd209c5dd3a3c3e50af79126c02 to your computer and use it in GitHub Desktop.
Electro - Always display attributes in Specifications tab
add_action( 'woocommerce_before_single_product', 'ec_child_modify_display_specs_attr' );
function ec_child_modify_display_specs_attr() {
global $post;
update_post_meta( $post->ID, '_specifications_display_attributes', 'yes' );
}
@Kocarik
Copy link

Kocarik commented Nov 20, 2016

Hello,

I found one small bugs , if I import my product with attributes to shop with wp all import plugin then on single product page not show Specification tab or Aditional information tab.

I try add this code to my child theme, but still also Specification tab or Aditional information tab not show.

@ibndawood
Copy link
Author

@Kocarik, please use this updated code

@Sh0wYouMeaT
Copy link

Sh0wYouMeaT commented Feb 22, 2018

@ibndawood, Thank you very much! for this code!

@drfranky1
Copy link

@ibndawood
Hi,

when I use this code everything working fine till I try to upload products on bulk with the native woocommerce importer.
When I put the CSV file with the products and click on import button the upload job stuck and when I remove the code everything start working normal.

Can you please tell me from where this issue come?

@ibndawood
Copy link
Author

Hello @drfranky1

I am sorry I do not what is the reason for the issue you've described. The code hook into woocommerce_before_single_product action which is executed in frontend only and not during import.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment