ptencate
Forum Replies Created
-
Hiya. super tnx. Variation description working.
if ( $term = get_term_by( 'id', $product->get_shipping_class_id(), 'product_shipping_class' ) ) { printf("<p class='shipping-class'>%s</p>", $term->name); }
however i dont understand. Im just trying to echo it on the invoice. not a printer function. just like :
<?php if( $product = $item['product'] ) : ?><dt class="dimensions">DIMENSIONS: </dt><dd class="dimensions"><?php echo wc_format_dimensions( $product->get_dimensions( false ) ); ?></dd><?php endif; ?>
How would you do that?
Tnx for the edit!
Additionally could you hint me into the direction of the code that will display:
– Shipping Class
– Variation DescriptionTy in advance!
Perfect! Exactly how i wanted it, and even working if one or more are missing.
Thanks a million!
Great support.
- This reply was modified 6 years, 5 months ago by ptencate.
Hi
tnx for your quick response. When i replace the following section on line 111 in the custom template it doesn’t really work out:
<?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; ?>
to
<?php if( !empty( $item['product'] ) ) : ?><dt class="dimensions">DIMENSIONS: </dt><dd class="dimensions"><?php echo $product->get_dimensions(); ?></dd><?php endif; ?>
Any tips on the exact code I can use for this?
(sorry not code wizz)