Title: Woocommerce attribute problem
Last modified: September 26, 2020

---

# Woocommerce attribute problem

 *  Resolved [jakariaahmed118477](https://wordpress.org/support/users/jakariaahmed118477/)
 * (@jakariaahmed118477)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/woocommerce-attribute-problem/)
 * Hi,
    Recently i read your this post below. Post- [https://www.skyverge.com/blog/change-woocommerce-additional-information-tab/](https://www.skyverge.com/blog/change-woocommerce-additional-information-tab/)
 * Now I need a help. When I add this code on my function.php file, it replace comma(,)
   between two term of attribute. And it applied to my all attributes. But I want
   to apply it to some specific attributes. How can I do it? Help me…..
 * Applied codes:
 * function skyverge_change_attribute_list_display( $output, $attributes, $values){
 *  return wpautop( wptexturize( implode( ‘<br />’, $values ) ) );
    } add_filter(‘
   woocommerce_attribute’, ‘skyverge_change_attribute_list_display’, 10, 3 );

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Contributor [tamarazuk](https://wordpress.org/support/users/tamarazuk/)
 * (@tamarazuk)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/woocommerce-attribute-problem/#post-13486554)
 * Hi @jakariaahmed118477,
 * Thanks for writing to us! I apologize for the delay in getting back to you. I
   am happy to help out here. 🙂
 * You can check for specific a specific attribute by checking the `$attribute->
   get_name()` ( the `$attributes` from the code in the post should really read `
   $attribute`).
 * I hope that’s helpful!
 * Tamara 🙂
 *  Thread Starter [jakariaahmed118477](https://wordpress.org/support/users/jakariaahmed118477/)
 * (@jakariaahmed118477)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/woocommerce-attribute-problem/#post-13486677)
 * where i need to add this “$attribute->get_name()” code? Should i add this code
   after my applied code?
 *  Plugin Contributor [tamarazuk](https://wordpress.org/support/users/tamarazuk/)
 * (@tamarazuk)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/woocommerce-attribute-problem/#post-13506479)
 * Hi [@jakariaahmed118477](https://wordpress.org/support/users/jakariaahmed118477/),
 * Sure, I’m happy to provide some tips here. You can update the code like so:
 *     ```
       function skyverge_change_attribute_list_display( $output, $attributes, $values ) {
   
       	if ( 'Specific Attribute Name' === $attribute->get_name() ) {
       		$output = wpautop( wptexturize( implode( ‘<br />’, $values ) ) );
       	}
   
       	return $output;
       }
       add_filter( 'woocommerce_attribute', 'skyverge_change_attribute_list_display', 10, 3 );
       ```
   
 * Here you would replace `Specific Attribute Name` with the name of your attribute
   such as `Color` or `Size`.
 * I hope that’s helpful 🙂
 * Stay safe,
    Tamara
 *  Thread Starter [jakariaahmed118477](https://wordpress.org/support/users/jakariaahmed118477/)
 * (@jakariaahmed118477)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/woocommerce-attribute-problem/#post-13506745)
 * When i add this code on my functions.php, then shows “There has been a critical
   error on your website.”.
    How i can do it? Do you have any other code?
 *  Plugin Contributor [tamarazuk](https://wordpress.org/support/users/tamarazuk/)
 * (@tamarazuk)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/woocommerce-attribute-problem/#post-13507086)
 * Hi [@jakariaahmed118477](https://wordpress.org/support/users/jakariaahmed118477/),
 * Sorry about that, seems like two characters got mangled as I copy/pasted the 
   code from your original sample. Please try the following:
 *     ```
       function skyverge_change_attribute_list_display( $output, $attributes, $values ) {
   
       	if ( 'Specific Attribute Name' === $attribute->get_name() ) {
       		$output = wpautop( wptexturize( implode( '<br />', $values ) ) );
       	}
   
       	return $output;
       }
       add_filter( 'woocommerce_attribute', 'skyverge_change_attribute_list_display', 10, 3 );
       ```
   
 * Thanks
 *  Thread Starter [jakariaahmed118477](https://wordpress.org/support/users/jakariaahmed118477/)
 * (@jakariaahmed118477)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/woocommerce-attribute-problem/#post-13507109)
 * I tried this code also, again it shows the same message.
 *  Plugin Contributor [tamarazuk](https://wordpress.org/support/users/tamarazuk/)
 * (@tamarazuk)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/woocommerce-attribute-problem/#post-13507113)
 * [@jakariaahmed118477](https://wordpress.org/support/users/jakariaahmed118477/)
   Do you still have the original code in place or did you replace it with the above?
 *  Thread Starter [jakariaahmed118477](https://wordpress.org/support/users/jakariaahmed118477/)
 * (@jakariaahmed118477)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/woocommerce-attribute-problem/#post-13507150)
 * I was only replace with attribute name.
 *  Plugin Contributor [tamarazuk](https://wordpress.org/support/users/tamarazuk/)
 * (@tamarazuk)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/woocommerce-attribute-problem/#post-13511460)
 * Hi [@jakariaahmed118477](https://wordpress.org/support/users/jakariaahmed118477/),
 * Would you please check the email that was sent to your WordPress admin email 
   for the full error message? Alternatively, you can also [enable WP Debug Mode](https://wordpress.org/support/article/debugging-in-wordpress/)
   to see the errors directly or in a log file.
 * Please be sure to remove any identifying information from the error logs if you
   want to paste them here 🙂
 * Thanks,
    Tamara

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Woocommerce attribute problem’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-customizer/assets/icon-256x256.png?rev=2436795)
 * [Customizer for WooCommerce](https://wordpress.org/plugins/woocommerce-customizer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-customizer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-customizer/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-customizer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-customizer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-customizer/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [tamarazuk](https://wordpress.org/support/users/tamarazuk/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/woocommerce-attribute-problem/#post-13511460)
 * Status: resolved