• Hi. How can I add my own column?

    Column with Numbers in order
    eg.

    1. Product One
    2. Product Two
    3. ………..

    Please help with code.
    Thanks.

    • This topic was modified 7 years, 8 months ago by ADvi.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter ADvi

    (@advi)

    Also. About attributes in Order table.
    I’ve inserted this in invoice.php
    <td class="ed"><?php if(!empty($item['product'])) $this->product_attribute('My Attribute Name', $item['product']); ?></td>
    But in PDF-file I got this https://prntscr.com/fy03fn (all of variation attributes are shown). I only need those one that my customer bought.
    How can I change this?

    Plugin Contributor Ewout

    (@pomegranate)

    Hello,
    I see you managed to get the custom columns in the template. Note that this is also a feature of the Premium Templates extension, which lets you add custom columns without editing the template files (including a ‘counter’ like you mentioned).

    If you are using those attributes for variations, you should get the data from the item meta instead, using wc_get_order_item_meta().
    example:

    
    echo wc_get_order_item_meta( $item_id, 'My Attribute Name', true );
    
    Thread Starter ADvi

    (@advi)

    Hm. This code does not show selected attribute.
    I’m trying this (Attr.Name in сyrillic)

    <td class="ed"><?php echo wc_get_order_item_meta( $item_id, 'Цена за', true ); ?></td>

    and this (Attr.Slug in English)

    <td class="ed"><?php echo wc_get_order_item_meta( $item_id, 'tsena-za', true ); ?></td>

    My column stays empty.

    P.S. Can I add ‘counter’ manualy? ?? without Premium extension?

    • This reply was modified 7 years, 8 months ago by ADvi.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom columns in Invoice table’ is closed to new replies.