Adding a new column
-
Hi there,
I wanted to add some columns, so that the weight and the packaging (variable product) becomes an own column. Everything worked, but now the cart totals below the product table is centered and I don’t know why. When I am deleting the new colums, everything is fine.
I changed the table head like this:table class="order-details"> <thead> <tr> <th class="product"><?php _e('Product', 'wpo_wcpdf'); ?></th> <th class="quantity"><?php _e('Quantity', 'wpo_wcpdf'); ?></th> <th class="quantity"><?php _e('Inhalt', 'wpo_wcpdf'); ?></th> <th class="quantity"><?php _e('Verpackung', 'wpo_wcpdf'); ?></th> <th class="price"><?php _e('Price', 'wpo_wcpdf'); ?></th> </tr> </thead>
and the table content like this:
<tbody> <?php $items = $wpo_wcpdf->get_order_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item_id => $item ) : ?> <tr> <td class="product"> <?php $description_label = __( 'Description', 'wpo_wcpdf' ); // registering alternate label translation ?> <span class="item-name"><?php echo $item['name']; ?></span> </td> <td class="quantity"><?php echo $item['quantity']; ?></td> <td class="quantity"> <dl class="meta"> <?php if( !empty( $item['weight'] ) ) : ?><dt class="weight"><?php _e( 'Weight:', 'wpo_wcpdf' ); ?></dt><dd class="weight"><?php echo $item['weight']; ?><?php echo get_option('woocommerce_weight_unit'); ?></dd><?php endif; ?> </dl></td> <td class="quantity"> <?php do_action( 'wpo_wcpdf_before_item_meta', $wpo_wcpdf->export->template_type, $item, $wpo_wcpdf->export->order ); ?> <span class="item-meta"><?php echo $item['meta']; ?></span> <?php do_action( 'wpo_wcpdf_after_item_meta', $wpo_wcpdf->export->template_type, $item, $wpo_wcpdf->export->order ); ?></td> <td class="price"><?php echo $item['single_price']; ?></td> </tr> <?php endforeach; endif; ?> </tbody>
The tfoot is still the same. Is there a dependence between the columns and the cart total?
And I want to have the price and below the price should be the unit-price in a smaller font. But I can only decrease the size of the whole price, not only for the unit 10,89/100g.
May you can help?
https://www.ads-software.com/plugins/woocommerce-pdf-invoices-packing-slips/
- The topic ‘Adding a new column’ is closed to new replies.