• Resolved bjornroiverhogen

    (@bjornroiverhogen)


    After updating we ran into an issue where product attributes are no longer showing in the email product table nor in the item table in PDF.

    For Email setting we used this:

    [wcj_product_categories strip_tags="yes" before="<hr><em>" after="</em>"]
    [wcj_product_list_attributes before="<hr><em>" after="</em>"]

    Neither of them work anymore.

    For PDF template we use the following table:

    [wcj_order_items_table table_class="pdf_invoice_items_table"
    columns="item_number|item_name|product_attribute|product_categories|item_quantity|line_total_tax_excl"
    	columns_titles="|Product|Eigenschappen|Kast|Aantal|Totaal"
    	columns_styles="width:5%;|width:40%;|width:20%;|width:20%;|width:5%;|width:10%;text-align:right;"]

    The ‘product_attribute’ does not work. So now we have no attribute information on mail whatsoever which is critical information to us.

    • WooCommerce: 7.2.3
    • Booster: 6.0.1
    • PHP: 8.1
    • WordPress: 6.1.1
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support David G

    (@gravid7)

    Hi @bjornroiverhogen ,

    You can use item_variation instead of product_attribute. it will display the variation name and value.

    [wcj_order_items_table table_class=”pdf_invoice_items_table” columns=”item_number|item_name|product_sku|item_variation|item_quantity|item_tax_class|item_tax|line_total_tax_incl”
    columns_titles=”|Product|SKU|HSN|Qty|Tax Rate|Tax|Total”
    columns_styles=”width:5%;|width:40%;|width:10%;|width:10%;|width:5%;|width:10%;|width:10%;|width:10%;text-align:center;”]

    Thread Starter bjornroiverhogen

    (@bjornroiverhogen)

    The item_variation did not work for us. The product is not a variable product but the attributes are important to the supplier.

    If the email settings can work we do not need the PDF though. I just activated the PDF to test if I could get it to work through there.

    Unfortunately I don’t get attributes shown in neither the email settings nor the PDF. It has always worked up until Woo 7.0 and Booster 5.6. Not sure what changed.

    Hopefully it is fixable.

    Thread Starter bjornroiverhogen

    (@bjornroiverhogen)

    We made a custom function to get it to work.

    function add_product_info_to_email_order_item_name( $item_name, $item ) {
        if ( $item['product_id'] ) {
            $product = wc_get_product( $item['product_id'] );
            $category = wp_get_post_terms( $product->get_id(), 'product_cat' )[0]->name;
            $attributes = $product->get_attributes();
            $attribute_string = "";
            foreach ( $attributes as $attribute ) {
                $attribute_string .=  wc_attribute_label( $attribute->get_name() ) . ': ' . $attribute->get_options()[0].' <br/> ';
            }
            $item_name .= '<br/>' . $category . '<br/>' . rtrim($attribute_string, " , ");
        }
        return $item_name;
    }
    add_filter( 'woocommerce_order_item_name', 'add_product_info_to_email_order_item_name', 10, 2 );
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Product attributes no longer show in mail or PDF’ is closed to new replies.