Title: weight unit
Last modified: September 21, 2020

---

# weight unit

 *  Resolved [mohdaljaraba](https://wordpress.org/support/users/mohdaljaraba/)
 * (@mohdaljaraba)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/weight-unit-2/)
 * Hello,
 * i used this code to show the weight for my product normally i just need to show
   how mant ML or G my product has the problem of this code itll show the specific
   weight option which i chose it KG or ML so only 1 option is there another way
   to set the weight ml and g to show on upper add to cart ?
 *     ```
       add_action ('woocommerce_single_product_summary', 'show_weight', 20);
       function show_weight() {
       global $product;
       $weight_unit = get_option('woocommerce_weight_unit');
       $attributes = $product->get_attributes();
       if ( $product->has_weight() ) {
       print '<p>Weight: '.$product->get_weight(). $weight_unit . '</p>'.PHP_EOL;
       }
       }
       ```
   

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

 *  Plugin Support [EastOfWest a11n](https://wordpress.org/support/users/eastofwest/)
 * (@eastofwest)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/weight-unit-2/#post-13442469)
 * Hi there,
 * In case you don’t get a reply to your answer in this forum, you can also try 
   these developer-specific resources for more help:
 * The resources below are helpful to any developer taking on the task of customizing
   WooCommerce:
 * WooCommerce Slack Channel
    [https://woocommerce.com/community-slack/](https://woocommerce.com/community-slack/)
 * WooCommerce Advanced FB Group:
    [https://www.facebook.com/groups/advanced.woocommerce/](https://www.facebook.com/groups/advanced.woocommerce/)
 * WooCommerce Developer Resources
    [https://developer.woocommerce.com/](https://developer.woocommerce.com/)
 *  Thread Starter [mohdaljaraba](https://wordpress.org/support/users/mohdaljaraba/)
 * (@mohdaljaraba)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/weight-unit-2/#post-13443562)
 * [@eastofwest](https://wordpress.org/support/users/eastofwest/) Thank you but 
   even there i dont get an answer 🙂
 *  [Mike Straw](https://wordpress.org/support/users/mikestraw/)
 * (@mikestraw)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/weight-unit-2/#post-13601815)
 * Hi [@mohdaljaraba](https://wordpress.org/support/users/mohdaljaraba/) ,
 * This is a fairly complex development topic, so it’s best answered by the developer
   community.
 * The spots that [@eastofwest](https://wordpress.org/support/users/eastofwest/)
   mentioned are the best places to get help with this. The WooCommerce Slack Channel
   does depend on who’s around to ask, but I’ve found folks in the `#developers`
   channel there to be pretty helpful.
 * Since this isn’t really a question that can be answered here and nobody has provided
   any more tips, I’m going to go ahead and mark this as resolved. If you have any
   questions about anything else, feel free to open a new thread.
 *  [Mike Straw](https://wordpress.org/support/users/mikestraw/)
 * (@mikestraw)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/weight-unit-2/#post-13601830)
 * One more thing that might help: There are weekly developer office hours in the
   WooCommerce Community Slack every Wednesday at 14:00 UTC.
 * If you pop in at that time you might be able to get some good info 🙂

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

The topic ‘weight unit’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)

 * 4 replies
 * 3 participants
 * Last reply from: [Mike Straw](https://wordpress.org/support/users/mikestraw/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/weight-unit-2/#post-13601830)
 * Status: resolved