dhendric25
Forum Replies Created
-
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 ??
Forum: Plugins
In reply to: [WooCommerce] SKU not showing for variable productsHello — 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!
Forum: Plugins
In reply to: [Plugin: WooCommerce] Show highest price within grouped productTHANK 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!
DanielleForum: Fixing WordPress
In reply to: Minimum order quantities and product detailsI 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.