• Resolved ariban99

    (@ariban99)


    hi
    we sell items by the weight for meat and chicken and based on the final weight, we update the order total. in woocommerce we add a SKU named price adjustment that comes in over an API from our inventory software that generates the weight.
    in the PDF however this item line price adjustment comes up as $0 and instead shows as a discount.
    we want to remove from the PDF the line that is SKU price_adjustment so it should not show on the PDF, can this be done?
    we also want to remove SUBTOTAL and DISCOUNT and only show the shipping fee and total of the other that the client was charged.

    what do i need to do in my custom file. right now it is like this

    <table class=”order-details”>
    <thead>
    <tr>
    <th class=”product”><?php _e(‘Product’, ‘woocommerce-pdf-invoices-packing-slips’ ); ?></th>
    <th class=”quantity”><?php _e(‘Quantity’, ‘woocommerce-pdf-invoices-packing-slips’ ); ?></th>
    <th class=”price”><?php _e(‘Price’, ‘woocommerce-pdf-invoices-packing-slips’ ); ?></th>
    </tr>
    </thead>
    <tbody>
    <?php $items = $this->get_order_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item_id => $item ) : ?>
    <tr class=”<?php echo apply_filters( ‘wpo_wcpdf_item_row_class’, $item_id, $this->type, $this->order, $item_id ); ?>”>
    <td class=”product”>
    <?php $description_label = __( ‘Description’, ‘woocommerce-pdf-invoices-packing-slips’ ); // registering alternate label translation ?>
    <span class=”item-name”><?php echo $item[‘name’]; ?></span>
    <?php do_action( ‘wpo_wcpdf_before_item_meta’, $this->type, $item, $this->order ); ?>
    <span class=”item-meta”><?php echo $item[‘meta’]; ?></span>
    <dl class=”meta”>
    <?php $description_label = __( ‘SKU’, ‘woocommerce-pdf-invoices-packing-slips’ ); // registering alternate label translation ?>
    <?php if( !empty( $item[‘sku’] ) ) : ?><dt class=”sku”><?php _e( ‘SKU:’, ‘woocommerce-pdf-invoices-packing-slips’ ); ?></dt><dd class=”sku”><?php echo $item[‘sku’]; ?></dd><?php endif; ?>
    <?php if( !empty( $item[‘weight’] ) ) : ?><dt class=”weight”><?php _e( ‘Weight:’, ‘woocommerce-pdf-invoices-packing-slips’ ); ?></dt><dd class=”weight”><?php echo $item[‘weight’]; ?><?php echo get_option(‘woocommerce_weight_unit’); ?></dd><?php endif; ?>
    </dl>
    <?php do_action( ‘wpo_wcpdf_after_item_meta’, $this->type, $item, $this->order ); ?>
    </td>
    <td class=”quantity”><?php echo $item[‘quantity’]; ?></td>
    <td class=”price”><?php echo $item[‘order_price’]; ?></td>
    </tr>
    <?php endforeach; endif; ?>
    </tbody>
    <tfoot>
    <tr class=”no-borders”>
    <td class=”no-borders”>
    <div class=”customer-notes”>
    <?php do_action( ‘wpo_wcpdf_before_customer_notes’, $this->type, $this->order ); ?>
    <?php if ( $this->get_shipping_notes() ) : ?>
    <h3><?php _e( ‘Customer Notes’, ‘woocommerce-pdf-invoices-packing-slips’ ); ?></h3>
    <?php $this->shipping_notes(); ?>
    <?php endif; ?>
    <?php do_action( ‘wpo_wcpdf_after_customer_notes’, $this->type, $this->order ); ?>
    </div>
    </td>
    <td class=”no-borders” colspan=”2″>
    <table class=”totals”>
    <tfoot>
    <?php foreach( $this->get_woocommerce_totals() as $key => $total ) : ?>
    <tr class=”<?php echo $key; ?>”>
    <td class=”no-borders”></td>
    <th class=”description”><?php echo $total[‘label’]; ?></th>
    <td class=”price”><span class=”totals-price”><?php echo $total[‘value’]; ?></span></td>
    </tr>
    <?php endforeach; ?>
    </tfoot>
    </table>
    </td>
    </tr>
    </tfoot>
    </table>

    <?php do_action( ‘wpo_wcpdf_after_order_details’, $this->type, $this->order ); ?>

    <?php if ( $this->get_footer() ): ?>
    <div id=”footer”>
    <?php $this->footer(); ?>
    </div><!– #letter-footer –>
    <?php endif; ?>
    <?php do_action( ‘wpo_wcpdf_after_document’, $this->type, $this->order ); ?>

    thank you in advance

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘pdf remove discount and subtotal’ is closed to new replies.