• Resolved iamjwal

    (@iamjwal)


    A few years ago I was able to get the weight sent in new order email notifications using the code in this thread.

    With my recent upgrade to PHP 8.3, that code seems to be outdated. Is there a new way I can include the order weight in my order notifications?

    I appreciate any help you can provide. My current child theme functions.php needs to have this code:

    <?php 

    add_action( 'wp_enqueue_scripts', 'salient_child_enqueue_styles', 100);

    function salient_child_enqueue_styles() {

    $nectar_theme_version = nectar_get_theme_version();
    wp_enqueue_style( 'salient-child-style', get_stylesheet_directory_uri() . '/style.css', '', $nectar_theme_version );

    if ( is_rtl() ) {
    wp_enqueue_style( 'salient-rtl', get_template_directory_uri(). '/rtl.css', array(), '1', 'screen' );
    }
    }


    ?>
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Grzegorz Rola

    (@grola)

    Hi @iamjwal,

    That code should still work. Add it to functions.php.

    Best regards
    Grzegorz

    Thread Starter iamjwal

    (@iamjwal)

    Hi @grola – thanks for your reply. Unfortunately, when I add that code to functions.php, I get the following error message at checkout: “There was an error processing your order. Please check for any charges in your payment method and review your order history before placing the order again. “

    When I remove the old order weight email code, I no longer get this error message.

    Plugin Author Grzegorz Rola

    (@grola)

    If you see such a message, there should be detailed information about the cause in the logs. Check under WooCommerce → Status → Logs.

    Thread Starter iamjwal

    (@iamjwal)

    It seems to be working now…I wonder if my test product not having a weight caused the error message?

    Anyhow, thanks Grzegorz for your help. If I have further issues, I’ll recheck the log and reach out.

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

The topic ‘Weight in Order Emails’ is closed to new replies.