• Resolved fepabe

    (@fepabe)


    Good morning. I tried to add an extra column with the attributes of a product. My intention was to add the attributes below the product description but I failed and I had to add an extra column.

    I’ve added …

    <th class=”attribute”><?php _e(‘Note’, ‘woocommerce-pdf-invoices-packing-slips’ ); ?></th>

    and ….

    <td><?php if(!empty($item[‘product’])) $this->product_attribute(‘Gratuito’, $item[‘product’]); ?></td>

    In doing so, the total is no longer aligned on the left but remains centered on the second and third columns.

    1) Can you check if my code is correct?
    2) How can I move the totals of a column?
    3) And if instead I wanted to put the attributes under the description of each product?

    Thank you

    Federico

Viewing 1 replies (of 1 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi Federico!
    Here are the answers to your questions:

    1. The code looks fine to me
    2. You will need to modify the table column properties of the totals, so that the total number of columns is the same. You can do this by adding a colspan to the first cell in the table footer, changing <td class="no-borders"> (only of that first cell) to <td class="no-borders" colspan="2">.
    3. Simply put the code in the <td class="product">...</td> cell.

    Hope that helps – good luck!

    [ Signature deleted ]

    p.s. if coding/html is not your strongsuit, I can really recommend the Premium templates extension, which will let you do stuff like this without any coding.

Viewing 1 replies (of 1 total)

The topic ‘extra column with attributes’ is closed to new replies.