<purchase_note>

The WooCommerce purchase note shortcode.


Usage

  1. // assign value 
  2. $purchase_note = 'dynamic_tag'; 
  3.  
  4. // basic usage 
  5. echo do_shortcode("[$purchase_note]"); 
  1. // assign value 
  2. $purchase_note = 'dynamic_tag'; 
  3.  
  4. // variable usage 
  5. $result = do_shortcode("[$purchase_note]"); 
  6. echo $result;  

Defined (3)

The shortcode is defined in the following location(s).

/templates/emails/email-order-items.php  
  1. <?php 
  2.  
  3. if ( $show_purchase_note && is_object( $product ) && ( $purchase_note = $product->get_purchase_note() ) ) : ?> 
  4. <tr> 
  5. <td colspan="3" style="text-align:<?php echo $text_align; ?>; vertical-align:middle; border: 1px solid #eee; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;"><?php echo wpautop( do_shortcode( wp_kses_post( $purchase_note ) ) ); ?></td> 
  6. </tr> 
  7. <?php endif; ?> 
  8.  
  9. <?php endforeach; ?> 
/templates/emails/plain/email-order-items.php  
  1. // allow other plugins to add additional product information here 
  2. do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text ); 
  3. // Note 
  4. if ( $show_purchase_note && is_object( $product ) && ( $purchase_note = $product->get_purchase_note() ) ) { 
  5. echo "\n" . do_shortcode( wp_kses_post( $purchase_note ) ); 
  6. echo "\n\n"; 
  7. endforeach; 
/templates/order/order-details-item.php  
  1.  
  2. <?php if ( $show_purchase_note && $purchase_note ) : ?> 
  3.  
  4. <tr class="woocommerce-table__product-purchase-note product-purchase-note"> 
  5.  
  6. <td colspan="3"><?php echo wpautop( do_shortcode( wp_kses_post( $purchase_note ) ) ); ?></td> 
  7.  
  8. </tr> 
  9.  
  10. <?php endif; ?>