• Resolved clickmac

    (@clickmac)


    Looks like version 2.1.3
    does not allow

    wc_add_order_item_meta

    name to show up on e-mail. Shows great in back-end, but the name entered does not show at all on e-mail. The value entered using item meta, shows on email.

    so an example of what is shown under the product name:

    : <my_values>

    ….

    where as the name does not show before the semi-colon.

    https://wordpress.org/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Hy,
    This is the moment I don’t like often updates. You had to check every page every time completely.

    I had the same effect. The WooCommerce Developer had change the behavior in this version. (I’m not sure if this is a mistake)

    You couldn’t enter directly a full Name for a custom attribute. You had to write the slug of a global or product defined attribute, which will be replaced by the attribute name.

    But to fix this problem probably until the next update you could modify a file: (Firstly only on the Order Summary Page, I have to search the eMail generation place)

    wp-content/plugins/woocommerce/includes/class-wc-order-item-meta.php
    Line:

    $meta_key           = wc_attribute_label( $product_attributes[ str_replace( 'attribute_', '', urldecode( $meta_key ) ) ]['name'] );

    Surround with an if, which checks if the new meta_key is empty.

    Result:

    if('' != wc_attribute_label( $product_attributes[ str_replace( 'attribute_', '', urldecode( $meta_key ) ) ]['name'] )) {
    							$meta_key           = wc_attribute_label( $product_attributes[ str_replace( 'attribute_', '', urldecode( $meta_key ) ) ]['name'] );
    }

    Probably not the best solution, but I have to test all of my woocommerce systems at the moment. 😉

    Stefan

Viewing 1 replies (of 1 total)
  • The topic ‘New Update broke e-mail, order item meta’ is closed to new replies.