• Resolved ckuhn84

    (@ckuhn84)


    How would I go about adding a custom attribute of SKU2 to the product description that is sent to the admin alerting of the new RFQ.

    I have tried several different methods that I found via a Google search and most of them break the e-mail even being sent.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Neah Plugins

    (@gplsaver)

    you can try this:
    Add below to the your functions.php in your theme directory

    add_action('woocommerce_order_item_meta_start','gpls_1234_order_item_meta_start',-1,3);
    
    function gpls_1234_order_item_meta_start( $item_id, $item, $order )
    {
        $_product = apply_filters('woocommerce_order_item_product', $order->get_product_from_item($item), $item);
    
        $sku2 = get_post_meta($_product->id, 'name_of_sku2', true);
    
        if ($sku2 == true){
            echo '<br/> (SKU2: #' . $sku2 . ')';
        }
    }
    • This reply was modified 7 years, 10 months ago by Neah Plugins.
    Thread Starter ckuhn84

    (@ckuhn84)

    Tried that and no dice. Maybe I am missing something else.

    Appreciate the quick response!

    Thread Starter ckuhn84

    (@ckuhn84)

    Here is how I have the attribute set on the items:

    Attribute Setup

    Here is the code at the end in functions.php:

    Code in Functions.Php

    Plugin Author Neah Plugins

    (@gplsaver)

    sorry, i read custom field rather than attribute

    add_action('woocommerce_order_item_meta_start','gpls_1234_order_item_meta_start',-1,3);
    
    function gpls_1234_order_item_meta_start( $item_id, $item, $order )
    {
        $_product = apply_filters('woocommerce_order_item_product', $order->get_product_from_item($item), $item);
    
        $sku2 = $_product->get_attribute( 'SKU2' );
    
        if ($sku2 != ''){
            echo '<br/> (SKU2: #' . $sku2 . ')';
        }
    }
    Thread Starter ckuhn84

    (@ckuhn84)

    That added it to the e-mail to the customer – email to the admin didn’t go out (Not sure why).

    Need to have it on the e-mail to the admin specifically.

    Thank you very much for your help – if you have a PayPal – would love to send you a token of my appreciation!

    Plugin Author Neah Plugins

    (@gplsaver)

    Let me know if the admin fixes or not in later tries.
    Thank you. A review would be nice.
    If you are interested in testing a different version with much more features, please email me at [email protected]. we are looking for a limited number of beta testers.we should be done with out own testing and be ready to release beta in a couple of weeks or sooner.

    Thread Starter ckuhn84

    (@ckuhn84)

    Done & Done – will let you know if it comes through in admin emails in later testing.

    Thread Starter ckuhn84

    (@ckuhn84)

    Got a bounce back on your e-mail address.

    Plugin Author Neah Plugins

    (@gplsaver)

    Thanks. We have had a firewall issue with our email servers past couple of days , if you get an error with the other email please send to [email protected]. Sorry for any inconvenience.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Add Custom Attribute to RFQ Email to Admin’ is closed to new replies.