Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • It’s working!! Thank you so much for all your help ??

    Ah… I thought I had it… The “Warehouse Location” field is showing up now, however, it is not pulling the information – I copied above the exact code for the function PHP – here is the code I have in the template per your help:

    <table class="order-details">
    	<thead>
    		<tr>
    			<th class="product-label"><?php _e('Product', 'wpo_wcpdf'); ?></th>
    			<th class="quantity-label"><?php _e('Quantity', 'wpo_wcpdf'); ?></th>
    			<th class="quantity-label"><?php _e('Warehouse location', 'wpo_wcpdf'); ?></th>
    		</tr>
    	</thead>
    	<tbody>
    		<?php $items = $wpo_wcpdf->get_order_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item ) : ?><tr>
    			<td class="description">
    				<span class="item-name"><?php echo $item['name']; ?></span><span class="item-meta"><?php echo $item['meta']; ?></span>
    				<dl class="meta">
    					<?php if( !empty( $item['sku'] ) ) : ?><dt><?php _e( 'SKU:', 'wpo_wcpdf' ); ?></dt><dd><?php echo $item['sku']; ?></dd><?php endif; ?>
    					<?php if( !empty( $item['weight'] ) ) : ?><dt><?php _e( 'Weight:', 'wpo_wcpdf' ); ?></dt><dd><?php echo $item['weight']; ?><?php echo get_option('woocommerce_weight_unit'); ?></dd><?php endif; ?>
    				</dl>
    			</td>
    			<td class="quantity"><?php echo $item['quantity']; ?></td>
    			<td> <?php echo get_post_meta( $product_id, '_warehouse_location', true );
    ?></td>
    		</tr><?php endforeach; endif; ?>
    	</tbody>
    </table><!-- order-details -->

    I also just tried duplicating the “weight” code and then editing it with the “_warehouse_location”. Could you help me determine what would need to be edited/change in the last lines of code below. I am obviously new to PHP so am trying to learn where I am supposed to pull everything from ?? Thanks again!!!

    <?php if( !empty( $item[‘sku’] ) ) : ?><dt><?php _e( ‘SKU:’, ‘wpo_wcpdf’ ); ?></dt><dd><?php echo $item[‘sku’]; ?></dd><?php endif; ?>

    <?php if( !empty( $item[‘weight’] ) ) : ?><dt><?php _e( ‘Weight:’, ‘wpo_wcpdf’ ); ?></dt><dd><?php echo $item[‘weight’]; ?><?php echo get_option(‘woocommerce_weight_unit’); ?></dd><?php endif; ?>

    <?php if( !empty( $item[‘weight’] ) ) : ?><dt><?php _e( ‘Warehouse Location:’, ‘wpo_wcpdf’ ); ?></dt><dd><?php echo $item[‘weight’]; ?><?php echo get_option(‘woocommerce_weight_unit’); ?></dd><?php endif; ?>

    Thank you!
    I am trying to display it right under the SKU and Weight. Nothing is showing up:

    <?php if( !empty( $item[‘sku’] ) ) : ?><dt><?php _e( ‘SKU:’, ‘wpo_wcpdf’ ); ?></dt><dd><?php echo $item[‘sku’]; ?></dd><?php endif; ?>
    <?php if( !empty( $item[‘weight’] ) ) : ?><dt><?php _e( ‘Weight:’, ‘wpo_wcpdf’ ); ?></dt><dd><?php echo $item[‘weight’]; ?><?php echo get_option(‘woocommerce_weight_unit’); ?></dd><?php endif; ?>
    <?php $product_id = $item[‘product_id’];
    $variation_id = $item[‘variation_id’];

    if (!empty($variation_id)) {
    // switch product_id for variation_id if set
    $product_id = $variation_id;
    }

    // output _warehouse_location
    echo get_post_meta( $product_id, ‘_warehouse_location’, true );
    ?>

    Hmm… still not showing up for me. I added this code to plugins > editor > Woocommerce PDF invoices & packing slips > and pasted it within woocommerce-pdf-invoices-packing-slips/woocommerce-pdf-invoices-packingslips.php

    Thank you!

    Can you tell me what the solution was for this? I am experiencing the same issue. Thank you ??

    Hello — This is the closest blog I could find that relates to products and Sku’s. I am running into this same issue with grouped products. Is there a way to have the Sku’s displayed for grouped products? Thank you!

    THANK YOU!

    I do have one other question if someone would be able to help me. The minimum price has now been reduced, however, I would like to change the word “From” to “Price”. Could someone please let me know how I would do so?

    Thank you!
    Danielle

    Thread Starter dhendric25

    (@dhendric25)

    I haven’t picked one yet — I was leaning towards woocommerce, but am just seeing what capabilities all have and what would be my best option.

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