Adding Free Delivery Minimum Order Amount

[ad_1]

Hi, @soapking:

Are you sure the meta key is woocommerce_free_shipping_1_settings? Please note that it could be something else, e.g. woocommerce_free_shipping_2_settings, woocommerce_free_shipping_3_settings, etc.

Also, the value coming from 'min_amount' is a raw value, so you should format the output, this way:

/**
 * Add free delivery MOV 
 */
add_action( 'wpo_wcpdf_before_document_notes', 'wpo_wcpdf_free_shipping', 10, 2 );
function wpo_wcpdf_free_shipping ( $document_type, $order ) {
	if ( $document_type == 'invoice' ) {
		$free_shipping_settings = get_option('woocommerce_free_shipping_2_settings');
		$mov = wc_price( $free_shipping_settings['min_amount'] );
		echo "<p>Free shipping minimum order amount: $mov</p>";
  }
}

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer