• Resolved mohdaljaraba

    (@mohdaljaraba)


    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

    (@eastofwest)

    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/

    WooCommerce Advanced FB Group:
    https://www.facebook.com/groups/advanced.woocommerce/

    WooCommerce Developer Resources
    https://developer.woocommerce.com/

    Thread Starter mohdaljaraba

    (@mohdaljaraba)

    @eastofwest Thank you but even there i dont get an answer ??

    Hi @mohdaljaraba ,

    This is a fairly complex development topic, so it’s best answered by the developer community.

    The spots that @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.

    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.