zones empty state

This commit is contained in:
Mike Jolley 2015-12-15 19:10:41 +00:00
parent 7f61beee41
commit d8f96f4dc9
5 changed files with 62 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@ -2119,6 +2119,53 @@ table.wc-shipping-zones, table.wc-shipping-zone-methods {
font-size: 14px;
background: #fff;
}
td.wc-shipping-zones-blank-state {
background: #F7F1F6 !important;
overflow: hidden;
position: relative;
padding: 7.5em 10% 15em;
border-bottom: 2px solid #EEE2EC;
p {
color: #a46497;
font-size: 1.5em;
line-height: 1.5em;
margin: 0 0 1em;
position: relative;
z-index: 1;
text-shadow: 1px 1px 1px white;
&.main {
font-size: 2em;
}
}
&:before {
content: "\f319";
font-family: 'dashicons';
text-align: center;
line-height: 1;
color: #EEE2EC;
display: block;
width: 17px;
font-size: 50em;
top: 10%;
left: 0;
position: absolute;
}
.button-primary {
background-color: #a16696;
border-color: #a16696;
-webkit-box-shadow: inset 0 1px 0 rgba( 255, 255, 255, 0.2 ), 0 1px 0 rgba( 0, 0, 0, 0.15 );
box-shadow: inset 0 1px 0 rgba( 255, 255, 255, 0.2 ), 0 1px 0 rgba( 0, 0, 0, 0.15 );
margin: 0;
opacity: 1;
text-shadow: 0px -1px 1px #8a4f7f, 1px 0px 1px #8a4f7f, 0px 1px 1px #8a4f7f, -1px 0px 1px #8a4f7f;
font-size: 1.5em;
padding: .75em 1em;
height: auto;
position: relative;
z-index: 1;
}
}
tbody.wc-shipping-zone-rows {
tr:nth-child(odd) {
td {

View File

@ -68,10 +68,9 @@
var zones = _.indexBy( this.model.get( 'zones' ), 'zone_id' ),
view = this;
// Blank out the contents.
this.$el.empty();
if ( _.size( zones ) ) {
this.$el.empty();
// Sort zones
zones = _.sortBy( zones, function( zone ) {
return parseInt( zone.zone_order, 10 );

View File

@ -20,7 +20,16 @@
</td>
</tr>
</tfoot>
<tbody class="wc-shipping-zone-rows"></tbody>
<tbody class="wc-shipping-zone-rows">
<tr>
<td class="wc-shipping-zones-blank-state" colspan="5">
<p class="main"><?php _e( 'Shipping Zones are regions you ship products to.', 'woocommerce' ); ?></p>
<p><?php _e( 'You can add as many zones as you want, for example you could have "Local", "Domestic", and "Europe" zones depending on your needs.', 'woocommerce' ); ?></p>
<p><?php _e( 'Once a zone has been added, you can add multiple shipping rates within each. Customers will only see rates that apply to them.', 'woocommerce' ); ?></p>
<a class="button button-primary wc-shipping-zone-add"><?php _e( 'Add a shipping zone', 'woocommerce' ); ?></a>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td width="1%" class="wc-shipping-zone-worldwide"></td>

View File

@ -34,7 +34,7 @@ class WC_Shipping_Zones {
$zones[ $zone->get_zone_id() ]['shipping_methods'] = $zone->get_shipping_methods();
}
return $zones;
return array();
}
/**