yanknudtskov
11/16/2016 - 4:09 PM

Display Estimates for Shipping Methods

Display Estimates for Shipping Methods

<?php

/**
	 * Displays shipping estimates for WC Shipping rates
	 */
	function yanco_shipping_method_estimate_label( $label, $method ) {

		if( WC()->customer->get_shipping_country() == 'DK' ) {
			// $label .= '<br /><pre>'.print_r($label, true).'</pre>';
			// $label .= '<br /><pre>'.print_r($method, true).'</pre>';
			$label .= '<br /><small>';

			switch ( $method->method_id ) {
				case 'gls_private_shipping_method':
					$label .= 'Est delivery: 24 hours';
					break;
				case 'boostr_shipping_gls_pickup':
					$label .= 'Est delivery: 24 hours';
					break;
				case 'gls_business_method':
					$label .= 'Est delivery: 24 hours';
					break;
				default:
					$label .= 'Est delivery: 24 hours';
					break;
			}

			$label .= '</small>';
		}

		return $label;
	}