Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter bhefley

    (@bhefley)

    Thank you @pomegranate I appreciate and respect your free support!

    Thread Starter bhefley

    (@bhefley)

    Hi @dpeyou,

    Thank you very much for your help with this!!

    I put your code in (using Code Snippets) and it didn’t solve the problem. I’m sure that’s due to how much I changed the code in the packing-slip.php file.

    I don’t want to suck you into a coding nightmare here, but if there is anything you see in my hacked together php code below that I can change to make this work I would be truly grateful.

    Thank you,

    Brent

    <?php if ( ! defined( ‘ABSPATH’ ) ) exit; // Exit if accessed directly ?>
    <?php do_action( ‘wpo_wcpdf_before_document’, $this->type, $this->order ); ?>

    <div class=”height2″>
    <div class=”header2″>
    <span class=”big”><?php $this->custom_field(‘billing_last_name’); ?></span>  <span class=”medium fontgreen”><?php $this->custom_field(‘billing_first_name’); ?></span><p> </p>
    </div>
    <div class=”info”><p class=”medium fontgreen”><?php _e( ‘Order:’, ‘woocommerce-pdf-invoices-packing-slips’ ); ?> <?php $this->order_number(); ?></p>
    <p class=”medium fontgreen”><?php echo substr($order->get_payment_method_title(), 0, 12);?></p></div>
    <div class=”medium”><?php do_action( ‘wpo_wcpdf_after_order_details’, $this->type, $this->order ); ?></div>
    </div>

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

    <table class=”order-details”>
    <thead>
    <tr>
    <th class=”product”><?php _e(‘Category’, ‘woocommerce-pdf-invoices-packing-slips’ ); ?></th>
    <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=”quantity”><?php _e(‘Size’, ‘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=””>
    <td class=”product”>
    <?php if ( strpos($item[‘product’]->get_categories(), “Donate” )) {echo “Donation”;} elseif ( strpos($item[‘product’]->get_categories(), “Berry” )) { echo “Berry Starts”; } elseif ( strpos($item[‘product’]->get_categories(), “Herb” )) { echo “Herb Starts”; } elseif ( strpos($item[‘product’]->get_categories(), “Flower” )) { echo “Flower Starts”; } else { echo “Veggie Starts”;} ?></td>
    <td>
    <span class=”item-name”><?php echo $item[‘name’]; ?></span>
    </td>
    <td class=”quantity”><?php echo $item[‘quantity’]; ?></td>
    <td class=”quantity”><?php if ( !empty($item[‘product’]) ) { $_product = $item[‘product’]->is_type( ‘variation’ ) ? wc_get_product( $item[‘product’]->get_variation_id() ) : $item[‘product’];if ( method_exists( $_product, ‘get_short_description’ ) ) { echo $_product->get_short_description();}}?></td>
    </tr>
    <?php endforeach; endif; ?>

    Thread Starter bhefley

    (@bhefley)

    Thanks Gabe!

    I just sent you a private message to you through your website with this information.

    I appreciate your help.

    Brent

Viewing 3 replies - 1 through 3 (of 3 total)