parent
1905c5ea0a
commit
a9b8101e48
|
@ -224,8 +224,11 @@ class WC_Settings_Shipping extends WC_Settings_Page {
|
||||||
* Show zones
|
* Show zones
|
||||||
*/
|
*/
|
||||||
protected function zones_screen() {
|
protected function zones_screen() {
|
||||||
|
global $wpdb;
|
||||||
|
|
||||||
$allowed_countries = WC()->countries->get_allowed_countries();
|
$allowed_countries = WC()->countries->get_allowed_countries();
|
||||||
$continents = WC()->countries->get_continents();
|
$continents = WC()->countries->get_continents();
|
||||||
|
$method_count = absint( $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}woocommerce_shipping_zone_methods" ) );
|
||||||
|
|
||||||
wp_localize_script( 'wc-shipping-zones', 'shippingZonesLocalizeScript', array(
|
wp_localize_script( 'wc-shipping-zones', 'shippingZonesLocalizeScript', array(
|
||||||
'zones' => WC_Shipping_Zones::get_zones(),
|
'zones' => WC_Shipping_Zones::get_zones(),
|
||||||
|
|
|
@ -57,6 +57,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<script type="text/html" id="tmpl-wc-shipping-zone-row-blank">
|
<script type="text/html" id="tmpl-wc-shipping-zone-row-blank">
|
||||||
|
<?php if ( 0 === $method_count ) : ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="wc-shipping-zones-blank-state" colspan="4">
|
<td class="wc-shipping-zones-blank-state" colspan="4">
|
||||||
<p class="main"><?php _e( 'A shipping zone is a geographic region where a certain set of shipping methods and rates apply.', 'woocommerce' ); ?></p>
|
<p class="main"><?php _e( 'A shipping zone is a geographic region where a certain set of shipping methods and rates apply.', 'woocommerce' ); ?></p>
|
||||||
|
@ -70,6 +71,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||||
<a class="button button-primary wc-shipping-zone-add"><?php _e( 'Add shipping zone', 'woocommerce' ); ?></a>
|
<a class="button button-primary wc-shipping-zone-add"><?php _e( 'Add shipping zone', 'woocommerce' ); ?></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/html" id="tmpl-wc-shipping-zone-row">
|
<script type="text/html" id="tmpl-wc-shipping-zone-row">
|
||||||
|
|
Loading…
Reference in New Issue