• Resolved khoavo

    (@khoavo)


    Hi there, need your help:

    On my Cart page view: https://prnt.sc/oyxn01 and the Checkout page view: https://prnt.sc/oyxmwy – I used the Product Short Description field from each Child Product Page to display the SKU & product code #, etc. As you see where I’ve highlighted it.

    However on the E-mail Confirmation Message, that line from my Product Short Description doesn’t show at: https://prnt.sc/oyxmsc – I need this info line to show, it’s important so I know which items to fulfill on the sales order.

    FYI – in order to display the Product Short Description on the Cart & Checkout page, I had to use a Filter hook in my Child / function.php, for example:

    /*** START – Show short description text in Cart and Checkout Pages ***/
    add_filter( ‘woocommerce_get_item_data’, ‘wc_checkout_description_so_15127954’, 10, 2 );
    function wc_checkout_description_so_15127954( $other_data, $cart_item )
    {
    $post_data = get_post( $cart_item[‘product_id’] );
    $other_data[] = array( ‘name’ => $post_data->post_excerpt );
    return $other_data;
    }
    /*** END – Show short description text in Cart and Checkout Pages ***/

    I thought if it shows on my Cart & Checkout Page, it would also appear on the E-mail Confirmation message. Let me know if you can help me with this.

    I’m using the WooCommerce Composite Product plugin for my Shop Page.

    Also, not sure why the SHIPPING ADDRESS title is displaying like this: https://prnt.sc/oyxycj

    I’m only doing Test submission via STRIPE, so this is not a Live transaction yet.

    Thanks in advance.

    Khoa

    • This topic was modified 5 years, 6 months ago by khoavo.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter khoavo

    (@khoavo)

    Yay! After some persistent Google-ing, I found this Add Action code, inserted into my Child / function.php and it displayed my product description on the Email notifications! In case someone else will find this useful, the code:

    add_action( ‘woocommerce_order_item_meta_end’, ‘product_description_in_new_email_notification’, 10, 4 );
    function product_description_in_new_email_notification( $item_id, $item, $order = null, $plain_text = false ){
    $product = $item->get_product();

    // Handling product variations
    if( $product->is_type(‘variation’) )
    $product = wc_get_product( $item->get_product_id() );

    // Display the product short description
    echo ‘<div class=”product-description” style=”margin:10px 0 0;”><p>’ . $product->get_short_description() . ‘</p></div>’;
    }

    SO NOW THE ONLY HELP I NEED FROM YOU IS TO SHOW ME HOW TO STRAIGHTEN OUT THIS ALIGNMENT OF THE SHIPPING ADDRESS TITLE: https://prnt.sc/oyxycj

    If it’s too large & lengthy to appear on the same line, perhaps reduce the font size? I see the Customer CSS field in your options box, but not sure what to insert. Thanks so much!

    Thread Starter khoavo

    (@khoavo)

    PROBLEM SOLVED!I reduced the H2 Font Size, it’s on the same line now. Thank you for sharing your plugin with us. Great work!

    Hey,
    Glad to hear you got things working ??

    Ben

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Description Texts not Appearing in E-mail Confirmations’ is closed to new replies.