×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Rasmus Pedersen
Added: Jan 15, 2021 9:49 AM
Views: 4721
  1. add_filter('woocommerce_display_product_attributes', function ($attributes, $product){
  2.         $attributes['weight'] = [
  3.                 'label' => __('Weight', 'woocommerce'),
  4.                 'value' => ( $product->get_weight() - 0.5 )
  5.         ];
  6.  
  7.         return $attributes;
  8. }, 10, 2);