WooCommerce Advanced Free Shipping - Version 1.1.2

Version Description

  • 29-06-2017 =

  • [Improvement] - Update WP Conditions to 1.0.3 - [Fix] - 'User role' condition 'Guest' wasn't working - [Improvement] - Allow conditions outside postbox / multiple times inside. Not limited to .postbox class. - [Add] - Zipcode range support. E.g. 'Zipcode'

Download this release

Release Info

Developer sormano
Plugin Icon 128x128 WooCommerce Advanced Free Shipping
Version 1.1.2
Comparing to
See all releases

Code changes from version 1.1.1 to 1.1.2

assets/css/woocommerce-advanced-free-shipping.min.css CHANGED
@@ -1 +1 @@
1
- .wpc-conditions .wpc-condition-group{background-color:#f5f5f5;padding:15px;border:1px solid #e5e5e5;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.04);box-shadow:0 1px 1px rgba(0,0,0,0.04);min-height:30px;margin:0 -13px 1.5em}.wpc-conditions .wpc-condition-group:hover .wpc-condition-group-actions{opacity:1}.wpc-conditions .wpc-condition-group .wpc-condition-group-actions{opacity:0;margin:-10px -10px 0 0;font-size:80%}.wpc-conditions .wpc-condition-group .wpc-condition-group-actions a{text-decoration:none}.wpc-conditions .wpc-condition-group .wpc-condition-group-actions a.delete{color:#a00}.wpc-conditions .wpc-condition-group .wpc-condition-group-actions a.delete:hover{color:#f00}.wpc-conditions .wpc-condition-group .wpc-condition-wrap{margin:10px 0 5px}.wpc-conditions .wpc-condition-group .wpc-condition-wrap .wpc-condition{width:35%}.wpc-conditions .wpc-condition-group .wpc-condition-wrap .wpc-operator{width:22.5%}.wpc-conditions .wpc-condition-group .wpc-condition-wrap .wpc-value{width:calc( 42.5% - 75px );height:28px}.wpc-conditions .wpc-condition-group .wpc-condition-wrap .wpc-description{float:right}.wpc-conditions .wpc-condition-group .wpc-condition-wrap .wpc-description .woocommerce-help-tip{height:28px;line-height:28px}.wpc-conditions .wpc-condition-group .wpc-condition-wrap .wpc-description .woocommerce-help-tip:after{line-height:28px}.wpc-conditions .wpc-condition-group .wpc-condition-wrap input{vertical-align:top}.wpc-conditions .clearfix:after{content:" ";display:block;height:0;clear:both}.wpc-conditions .wpc-add.button:before{font-family:'dashicons';content:"\f502";vertical-align:middle;height:1.2em;line-height:1;display:inline-block;margin-right:5px;color:#667}.wpc-conditions .wpc-condition-delete.button{font-weight:600;width:30px;text-align:center;padding:0}.wpc-conditions .wpc-condition-delete.button:before{font-family:'dashicons';content:"\f460";vertical-align:middle;height:1.2em;line-height:1;display:inline-block;color:#667}.wpc-conditions>p+.wpc-condition-group-wrap p.or-text{display:none}.wpc-conditions .or-text{margin:1.5em 0}.wpc-conditions .match-text{margin:0 0 1em}.wpc-conditions .wpc-condition-delete{display:none;opacity:0;transition:opacity .3s ease-in-out}.wpc-conditions .wpc-condition-wrap:hover .wpc-condition-delete{display:inline-block;opacity:1}.wpc-conditions .wpc-condition-wrap.loading{height:30px}.wpc-conditions .wpc-condition-wrap.loading .loading-icon{width:100%;clear:both;display:block;text-align:center;line-height:110%;margin:0 1px}.wpc-condition-wrap .wpc-value.select2-container{display:inline-block !important;margin:1px}.wpc-condition-wrap .wpc-value.select2-container.select2-container-active .select2-choice{border:1px solid #666}.wpc-condition-wrap .wpc-value.select2-container.select2-drop-above .select2-choice{border-radius:0 0 4px 4px;border:1px solid #666;border-top-color:transparent}.wpc-condition-wrap .wpc-value.select2-container .select2-choice{border-color:#ddd;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;height:26px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.07);box-shadow:inset 0 1px 2px rgba(0,0,0,0.07)}.wpc-condition-wrap .wpc-value.select2-dropdown-open .select2-choice{border-bottom-color:transparent;-webkit-box-shadow:0 1px 0 #fff inset;box-shadow:0 1px 0 #fff inset;border-bottom-left-radius:0;border-bottom-right-radius:0;border:1px solid #666;outline:0}.wpc-condition-wrap .select2-container .select2-selection--single{height:28px !important}.wpc-condition-wrap .select2-container .select2-selection--single #select2--container,.wpc-condition-wrap .select2-container .select2-selection--single .select2-selection__arrow{line-height:26px}.wpc-condition-wrap .select2-container .select2-selection--single .select2-selection__arrow{height:28px}.wpc-conditions-post-table .sort{padding:0 4px;cursor:move;text-align:center;vertical-align:middle}.wpc-conditions-post-table .sort:before{content:"\e032";font-family:WooCommerce;text-align:center;line-height:1;color:#999;display:block;width:100%;float:left;height:100%}.wpc-conditions-post-table .sort:before,.wpc-conditions-post-table .row-actions{visibility:hidden !important}.wpc-conditions-post-table tr:hover .sort:before,.wpc-conditions-post-table tr:hover>td>.row-actions{visibility:visible !important}.wpc-conditions-post-table .add.button:before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-right:7px;content:"\e007"}@media screen and (max-width: 782px){.wpc-conditions-post-table th{padding:8px}.wpc-conditions-post-table td{padding:8px 10px}.wpc-conditions-post-table tfoot .button{margin-bottom:0}}.wpc-currency{padding:3px 10px;font-size:14px;font-weight:400;line-height:19px;height:27px;box-sizing:border-box;color:#555;text-align:center;background-color:#EEE;border:1px solid #DDD;border-right:none;border-radius:4px 0px 0px 4px;margin:1px 0px 1px 1px;display:inline-block}.wpc-currency+input{margin-left:-4px;line-height:19px;width:161px !important}@media screen and (max-width: 782px){.wpc-currency{font-size:16px;padding:6px 10px;height:33px}}.post-type-wafs .misc-pub-visibility#visibility{display:none}.wafs-option label{display:inline-block;width:150px}.wafs_conditions_meta_box>p:first-child+div>.or_match{display:none}.wafs_desc{display:none;position:absolute;background:rgba(0,0,0,0.8);min-width:25px;max-width:200px;border-radius:6px;padding:5px 10px;color:white;margin-top:10px;right:40px;text-align:center}.wafs_desc:after{border-top:0px solid transparent;border-right:10px solid transparent;border-left:10px solid transparent;border-bottom:10px solid rgba(0,0,0,0.8);content:' ';position:absolute;top:-10px;right:10px;z-index:999}.wafs_tip:hover ~ .wafs_desc{display:block !important}.wafs-description{width:40px;float:right;line-height:20px}.condition-delete{display:none;opacity:0;transition:opacity .3s ease-in-out}.wafs-condition-wrap:hover .condition-delete{display:inline-block;opacity:1}#advanced_free_shipping_shipping_methods tr .row-actions{visibility:hidden}#advanced_free_shipping_shipping_methods tr:hover>td>.row-actions{visibility:visible !important}
1
+ .wpc-condition-groups .wpc-condition-group{background-color:#f5f5f5;padding:15px;border:1px solid #e5e5e5;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.04);box-shadow:0 1px 1px rgba(0,0,0,0.04);min-height:30px;margin:0 -13px 1.5em}.wpc-condition-groups .wpc-condition-group:hover .wpc-condition-group-actions{opacity:1}.wpc-condition-groups .wpc-condition-group .wpc-condition-group-actions{opacity:0;margin:-10px -10px 0 0;font-size:80%}.wpc-condition-groups .wpc-condition-group .wpc-condition-group-actions a{text-decoration:none}.wpc-condition-groups .wpc-condition-group .wpc-condition-group-actions a.delete{color:#a00}.wpc-condition-groups .wpc-condition-group .wpc-condition-group-actions a.delete:hover{color:#f00}.wpc-condition-groups .wpc-condition-group .wpc-condition-wrap{margin:10px 0 5px}.wpc-condition-groups .wpc-condition-group .wpc-condition-wrap .wpc-condition{width:35%}.wpc-condition-groups .wpc-condition-group .wpc-condition-wrap .wpc-operator{width:22.5%}.wpc-condition-groups .wpc-condition-group .wpc-condition-wrap .wpc-value{width:calc( 42.5% - 75px );height:28px}.wpc-condition-groups .wpc-condition-group .wpc-condition-wrap .wpc-description{float:right}.wpc-condition-groups .wpc-condition-group .wpc-condition-wrap .wpc-description .woocommerce-help-tip{height:28px;line-height:28px}.wpc-condition-groups .wpc-condition-group .wpc-condition-wrap .wpc-description .woocommerce-help-tip:after{line-height:28px}.wpc-condition-groups .wpc-condition-group .wpc-condition-wrap input{vertical-align:top}.wpc-condition-groups .clearfix:after{content:" ";display:block;height:0;clear:both}.wpc-condition-groups .wpc-add.button:before{font-family:'dashicons';content:"\f502";vertical-align:middle;height:1.2em;line-height:1;display:inline-block;margin-right:5px;color:#667}.wpc-condition-groups .wpc-condition-delete.button{font-weight:600;width:30px;text-align:center;padding:0}.wpc-condition-groups .wpc-condition-delete.button:before{font-family:'dashicons';content:"\f460";vertical-align:middle;height:1.2em;line-height:1;display:inline-block;color:#667}.wpc-condition-groups>p+.wpc-condition-group-wrap p.or-text{display:none}.wpc-condition-groups .or-text{margin:1.5em 0}.wpc-condition-groups .match-text{margin:0 0 1em}.wpc-condition-groups .wpc-condition-delete{display:none;opacity:0;transition:opacity .3s ease-in-out}.wpc-condition-groups .wpc-condition-wrap:hover .wpc-condition-delete{display:inline-block;opacity:1}.wpc-condition-groups .wpc-condition-wrap.loading{height:30px}.wpc-condition-groups .wpc-condition-wrap.loading .loading-icon{width:100%;clear:both;display:block;text-align:center;line-height:110%;margin:0 1px}.wpc-condition-wrap .wpc-value.select2-container{display:inline-block !important;margin:1px}.wpc-condition-wrap .wpc-value.select2-container.select2-container-active .select2-choice{border:1px solid #666}.wpc-condition-wrap .wpc-value.select2-container.select2-drop-above .select2-choice{border-radius:0 0 4px 4px;border:1px solid #666;border-top-color:transparent}.wpc-condition-wrap .wpc-value.select2-container .select2-choice{border-color:#ddd;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;height:26px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.07);box-shadow:inset 0 1px 2px rgba(0,0,0,0.07)}.wpc-condition-wrap .wpc-value.select2-dropdown-open .select2-choice{border-bottom-color:transparent;-webkit-box-shadow:0 1px 0 #fff inset;box-shadow:0 1px 0 #fff inset;border-bottom-left-radius:0;border-bottom-right-radius:0;border:1px solid #666;outline:0}.wpc-condition-wrap .select2-container .select2-selection--single{height:28px !important}.wpc-condition-wrap .select2-container .select2-selection--single #select2--container,.wpc-condition-wrap .select2-container .select2-selection--single .select2-selection__arrow{line-height:26px}.wpc-condition-wrap .select2-container .select2-selection--single .select2-selection__arrow{height:28px}.wpc-conditions-post-table .sort{padding:0 4px;cursor:move;text-align:center;vertical-align:middle}.wpc-conditions-post-table .sort:before{content:"\e032";font-family:WooCommerce;text-align:center;line-height:1;color:#999;display:block;width:100%;float:left;height:100%}.wpc-conditions-post-table .sort:before,.wpc-conditions-post-table .row-actions{visibility:hidden !important}.wpc-conditions-post-table tr:hover .sort:before,.wpc-conditions-post-table tr:hover>td>.row-actions{visibility:visible !important}.wpc-conditions-post-table .add.button:before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-right:7px;content:"\e007"}@media screen and (max-width: 782px){.wpc-conditions-post-table th{padding:8px}.wpc-conditions-post-table td{padding:8px 10px}.wpc-conditions-post-table tfoot .button{margin-bottom:0}}.wpc-currency{padding:3px 10px;font-size:14px;font-weight:400;line-height:19px;height:27px;box-sizing:border-box;color:#555;text-align:center;background-color:#EEE;border:1px solid #DDD;border-right:none;border-radius:4px 0px 0px 4px;margin:1px 0px 1px 1px;display:inline-block}.wpc-currency+input{margin-left:-4px;line-height:19px;width:161px !important}@media screen and (max-width: 782px){.wpc-currency{font-size:16px;padding:6px 10px;height:33px}}.post-type-wafs .misc-pub-visibility#visibility{display:none}.wafs-option label{display:inline-block;width:150px}.wafs_conditions_meta_box>p:first-child+div>.or_match{display:none}.wafs_desc{display:none;position:absolute;background:rgba(0,0,0,0.8);min-width:25px;max-width:200px;border-radius:6px;padding:5px 10px;color:white;margin-top:10px;right:40px;text-align:center}.wafs_desc:after{border-top:0px solid transparent;border-right:10px solid transparent;border-left:10px solid transparent;border-bottom:10px solid rgba(0,0,0,0.8);content:' ';position:absolute;top:-10px;right:10px;z-index:999}.wafs_tip:hover ~ .wafs_desc{display:block !important}.wafs-description{width:40px;float:right;line-height:20px}.condition-delete{display:none;opacity:0;transition:opacity .3s ease-in-out}.wafs-condition-wrap:hover .condition-delete{display:inline-block;opacity:1}#advanced_free_shipping_shipping_methods tr .row-actions{visibility:hidden}#advanced_free_shipping_shipping_methods tr:hover>td>.row-actions{visibility:visible !important}
includes/admin/views/meta-box-conditions.php CHANGED
@@ -5,29 +5,31 @@ global $post;
5
  $condition_groups = get_post_meta( $post->ID, '_wafs_shipping_method_conditions', true );
6
 
7
  ?><div class='wpc-conditions wpc-conditions-meta-box'>
 
8
 
9
- <p>
10
- <strong><?php _e( 'Match one of the condition groups to allow free shipping:', 'woocommerce-advanced-free-shipping' ); ?></strong>
11
- </p><?php
12
 
13
- if ( ! empty( $condition_groups ) ) :
14
 
15
- foreach ( $condition_groups as $condition_group => $conditions ) :
16
- include plugin_dir_path( __FILE__ ) . 'html-condition-group.php';
17
- endforeach;
18
 
19
- else :
20
 
21
- $condition_group = '0';
22
- include plugin_dir_path( __FILE__ ) . 'html-condition-group.php';
23
 
24
- endif;
25
 
26
- ?></div>
27
 
28
- <div class='wpc-condition-group-template hidden' style='display: none'><?php
29
- $condition_group = '9999';
30
- $conditions = array();
31
- include plugin_dir_path( __FILE__ ) . 'html-condition-group.php';
32
- ?></div>
33
- <a class='button wpc-condition-group-add' href='javascript:void(0);'><?php _e( 'Add \'Or\' group', 'woocommerce-advanced-free-shipping' ); ?></a>
 
5
  $condition_groups = get_post_meta( $post->ID, '_wafs_shipping_method_conditions', true );
6
 
7
  ?><div class='wpc-conditions wpc-conditions-meta-box'>
8
+ <div class='wpc-condition-groups'>
9
 
10
+ <p>
11
+ <strong><?php _e( 'Match one of the condition groups to allow free shipping:', 'woocommerce-advanced-free-shipping' ); ?></strong>
12
+ </p><?php
13
 
14
+ if ( ! empty( $condition_groups ) ) :
15
 
16
+ foreach ( $condition_groups as $condition_group => $conditions ) :
17
+ include plugin_dir_path( __FILE__ ) . 'html-condition-group.php';
18
+ endforeach;
19
 
20
+ else :
21
 
22
+ $condition_group = '0';
23
+ include plugin_dir_path( __FILE__ ) . 'html-condition-group.php';
24
 
25
+ endif;
26
 
27
+ ?></div>
28
 
29
+ <div class='wpc-condition-group-template hidden' style='display: none'><?php
30
+ $condition_group = '9999';
31
+ $conditions = array();
32
+ include plugin_dir_path( __FILE__ ) . 'html-condition-group.php';
33
+ ?></div>
34
+ <a class='button wpc-condition-group-add' href='javascript:void(0);'><?php _e( 'Add \'Or\' group', 'woocommerce-advanced-free-shipping' ); ?></a>
35
+ </div>
libraries/wp-conditions/assets/css/wp-conditions.min.css CHANGED
@@ -1 +1 @@
1
- .wpc-conditions .wpc-condition-group{background-color:#f5f5f5;padding:15px;border:1px solid #e5e5e5;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.04);box-shadow:0 1px 1px rgba(0,0,0,0.04);min-height:30px;margin:0 -13px 1.5em}.wpc-conditions .wpc-condition-group:hover .wpc-condition-group-actions{opacity:1}.wpc-conditions .wpc-condition-group .wpc-condition-group-actions{opacity:0;margin:-10px -10px 0 0;font-size:80%}.wpc-conditions .wpc-condition-group .wpc-condition-group-actions a{text-decoration:none}.wpc-conditions .wpc-condition-group .wpc-condition-group-actions a.delete{color:#a00}.wpc-conditions .wpc-condition-group .wpc-condition-group-actions a.delete:hover{color:#f00}.wpc-conditions .wpc-condition-group .wpc-condition-wrap{margin:10px 0 5px}.wpc-conditions .wpc-condition-group .wpc-condition-wrap .wpc-condition{width:35%}.wpc-conditions .wpc-condition-group .wpc-condition-wrap .wpc-operator{width:22.5%}.wpc-conditions .wpc-condition-group .wpc-condition-wrap .wpc-value{width:calc( 42.5% - 75px );height:28px}.wpc-conditions .wpc-condition-group .wpc-condition-wrap .wpc-description{float:right}.wpc-conditions .wpc-condition-group .wpc-condition-wrap .wpc-description .woocommerce-help-tip{height:28px;line-height:28px}.wpc-conditions .wpc-condition-group .wpc-condition-wrap .wpc-description .woocommerce-help-tip:after{line-height:28px}.wpc-conditions .wpc-condition-group .wpc-condition-wrap input{vertical-align:top}.wpc-conditions .clearfix:after{content:" ";display:block;height:0;clear:both}.wpc-conditions .wpc-add.button:before{font-family:'dashicons';content:"\f502";vertical-align:middle;height:1.2em;line-height:1;display:inline-block;margin-right:5px;color:#667}.wpc-conditions .wpc-condition-delete.button{font-weight:600;width:30px;text-align:center;padding:0}.wpc-conditions .wpc-condition-delete.button:before{font-family:'dashicons';content:"\f460";vertical-align:middle;height:1.2em;line-height:1;display:inline-block;color:#667}.wpc-conditions>p+.wpc-condition-group-wrap p.or-text{display:none}.wpc-conditions .or-text{margin:1.5em 0}.wpc-conditions .match-text{margin:0 0 1em}.wpc-conditions .wpc-condition-delete{display:none;opacity:0;transition:opacity .3s ease-in-out}.wpc-conditions .wpc-condition-wrap:hover .wpc-condition-delete{display:inline-block;opacity:1}.wpc-conditions .wpc-condition-wrap.loading{height:30px}.wpc-conditions .wpc-condition-wrap.loading .loading-icon{width:100%;clear:both;display:block;text-align:center;line-height:110%;margin:0 1px}.wpc-condition-wrap .wpc-value.select2-container{display:inline-block !important;margin:1px}.wpc-condition-wrap .wpc-value.select2-container.select2-container-active .select2-choice{border:1px solid #666}.wpc-condition-wrap .wpc-value.select2-container.select2-drop-above .select2-choice{border-radius:0 0 4px 4px;border:1px solid #666;border-top-color:transparent}.wpc-condition-wrap .wpc-value.select2-container .select2-choice{border-color:#ddd;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;height:26px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.07);box-shadow:inset 0 1px 2px rgba(0,0,0,0.07)}.wpc-condition-wrap .wpc-value.select2-dropdown-open .select2-choice{border-bottom-color:transparent;-webkit-box-shadow:0 1px 0 #fff inset;box-shadow:0 1px 0 #fff inset;border-bottom-left-radius:0;border-bottom-right-radius:0;border:1px solid #666;outline:0}.wpc-conditions-post-table .sort{padding:0 4px;cursor:move;text-align:center;vertical-align:middle}.wpc-conditions-post-table .sort:before{content:"\e032";font-family:WooCommerce;text-align:center;line-height:1;color:#999;display:block;width:100%;float:left;height:100%}.wpc-conditions-post-table .sort:before,.wpc-conditions-post-table .row-actions{visibility:hidden !important}.wpc-conditions-post-table tr:hover .sort:before,.wpc-conditions-post-table tr:hover>td>.row-actions{visibility:visible !important}.wpc-conditions-post-table .add.button:before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-right:7px;content:"\e007"}.wpc-currency{padding:3px 10px;font-size:14px;font-weight:400;line-height:19px;height:27px;box-sizing:border-box;color:#555;text-align:center;background-color:#EEE;border:1px solid #DDD;border-right:none;border-radius:4px 0px 0px 4px;margin:1px 0px 1px 1px;display:inline-block}.wpc-currency+input{margin-left:-4px;line-height:19px;width:161px !important}@media screen and (max-width: 782px){.wpc-currency{font-size:16px;padding:6px 10px;height:33px}}
1
+ .wpc-condition-groups .wpc-condition-group{background-color:#f5f5f5;padding:15px;border:1px solid #e5e5e5;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.04);box-shadow:0 1px 1px rgba(0,0,0,0.04);min-height:30px;margin:0 -13px 1.5em}.wpc-condition-groups .wpc-condition-group:hover .wpc-condition-group-actions{opacity:1}.wpc-condition-groups .wpc-condition-group .wpc-condition-group-actions{opacity:0;margin:-10px -10px 0 0;font-size:80%}.wpc-condition-groups .wpc-condition-group .wpc-condition-group-actions a{text-decoration:none}.wpc-condition-groups .wpc-condition-group .wpc-condition-group-actions a.delete{color:#a00}.wpc-condition-groups .wpc-condition-group .wpc-condition-group-actions a.delete:hover{color:#f00}.wpc-condition-groups .wpc-condition-group .wpc-condition-wrap{margin:10px 0 5px}.wpc-condition-groups .wpc-condition-group .wpc-condition-wrap .wpc-condition{width:35%}.wpc-condition-groups .wpc-condition-group .wpc-condition-wrap .wpc-operator{width:22.5%}.wpc-condition-groups .wpc-condition-group .wpc-condition-wrap .wpc-value{width:calc( 42.5% - 75px );height:28px}.wpc-condition-groups .wpc-condition-group .wpc-condition-wrap .wpc-description{float:right}.wpc-condition-groups .wpc-condition-group .wpc-condition-wrap .wpc-description .woocommerce-help-tip{height:28px;line-height:28px}.wpc-condition-groups .wpc-condition-group .wpc-condition-wrap .wpc-description .woocommerce-help-tip:after{line-height:28px}.wpc-condition-groups .wpc-condition-group .wpc-condition-wrap input{vertical-align:top}.wpc-condition-groups .clearfix:after{content:" ";display:block;height:0;clear:both}.wpc-condition-groups .wpc-add.button:before{font-family:'dashicons';content:"\f502";vertical-align:middle;height:1.2em;line-height:1;display:inline-block;margin-right:5px;color:#667}.wpc-condition-groups .wpc-condition-delete.button{font-weight:600;width:30px;text-align:center;padding:0}.wpc-condition-groups .wpc-condition-delete.button:before{font-family:'dashicons';content:"\f460";vertical-align:middle;height:1.2em;line-height:1;display:inline-block;color:#667}.wpc-condition-groups>p+.wpc-condition-group-wrap p.or-text{display:none}.wpc-condition-groups .or-text{margin:1.5em 0}.wpc-condition-groups .match-text{margin:0 0 1em}.wpc-condition-groups .wpc-condition-delete{display:none;opacity:0;transition:opacity .3s ease-in-out}.wpc-condition-groups .wpc-condition-wrap:hover .wpc-condition-delete{display:inline-block;opacity:1}.wpc-condition-groups .wpc-condition-wrap.loading{height:30px}.wpc-condition-groups .wpc-condition-wrap.loading .loading-icon{width:100%;clear:both;display:block;text-align:center;line-height:110%;margin:0 1px}.wpc-condition-wrap .wpc-value.select2-container{display:inline-block !important;margin:1px}.wpc-condition-wrap .wpc-value.select2-container.select2-container-active .select2-choice{border:1px solid #666}.wpc-condition-wrap .wpc-value.select2-container.select2-drop-above .select2-choice{border-radius:0 0 4px 4px;border:1px solid #666;border-top-color:transparent}.wpc-condition-wrap .wpc-value.select2-container .select2-choice{border-color:#ddd;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;height:26px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.07);box-shadow:inset 0 1px 2px rgba(0,0,0,0.07)}.wpc-condition-wrap .wpc-value.select2-dropdown-open .select2-choice{border-bottom-color:transparent;-webkit-box-shadow:0 1px 0 #fff inset;box-shadow:0 1px 0 #fff inset;border-bottom-left-radius:0;border-bottom-right-radius:0;border:1px solid #666;outline:0}.wpc-condition-wrap .select2-container .select2-selection--single{height:28px !important}.wpc-condition-wrap .select2-container .select2-selection--single #select2--container,.wpc-condition-wrap .select2-container .select2-selection--single .select2-selection__arrow{line-height:26px}.wpc-condition-wrap .select2-container .select2-selection--single .select2-selection__arrow{height:28px}.wpc-conditions-post-table .sort{padding:0 4px;cursor:move;text-align:center;vertical-align:middle}.wpc-conditions-post-table .sort:before{content:"\e032";font-family:WooCommerce;text-align:center;line-height:1;color:#999;display:block;width:100%;float:left;height:100%}.wpc-conditions-post-table .sort:before,.wpc-conditions-post-table .row-actions{visibility:hidden !important}.wpc-conditions-post-table tr:hover .sort:before,.wpc-conditions-post-table tr:hover>td>.row-actions{visibility:visible !important}.wpc-conditions-post-table .add.button:before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-right:7px;content:"\e007"}@media screen and (max-width: 782px){.wpc-conditions-post-table th{padding:8px}.wpc-conditions-post-table td{padding:8px 10px}.wpc-conditions-post-table tfoot .button{margin-bottom:0}}.wpc-currency{padding:3px 10px;font-size:14px;font-weight:400;line-height:19px;height:27px;box-sizing:border-box;color:#555;text-align:center;background-color:#EEE;border:1px solid #DDD;border-right:none;border-radius:4px 0px 0px 4px;margin:1px 0px 1px 1px;display:inline-block}.wpc-currency+input{margin-left:-4px;line-height:19px;width:161px !important}@media screen and (max-width: 782px){.wpc-currency{font-size:16px;padding:6px 10px;height:33px}}
libraries/wp-conditions/assets/css/wp-conditions.scss CHANGED
@@ -5,7 +5,7 @@
5
  /**************************************************************
6
  * Conditions
7
  *************************************************************/
8
- .wpc-conditions {
9
 
10
  // Condition group
11
  .wpc-condition-group {
5
  /**************************************************************
6
  * Conditions
7
  *************************************************************/
8
+ .wpc-condition-groups {
9
 
10
  // Condition group
11
  .wpc-condition-group {
libraries/wp-conditions/assets/js/wp-conditions.js CHANGED
@@ -2,12 +2,12 @@ jQuery( function( $ ) {
2
 
3
  function wpc_condition_group_repeater() {
4
  // Condition group repeater
5
- $( '.wpc-conditions' ).parents( '.postbox' ).repeater({
6
  addTrigger: '.wpc-condition-group-add',
7
  removeTrigger: '.wpc-condition-group .delete',
8
  template: '.wpc-condition-group-template .wpc-condition-group-wrap',
9
  elementWrap: '.wpc-condition-group-wrap',
10
- elementsContainer: '.wpc-conditions',
11
  removeElement: function( el ) {
12
  el.remove();
13
  }
@@ -53,7 +53,7 @@ jQuery( function( $ ) {
53
  $( document.body ).on ( 'click', '.wpc-conditions .duplicate', function() {
54
  var condition_group_wrap = $( this ).parents( '.wpc-condition-group-wrap' ),
55
  condition_group_id = condition_group_wrap.find( '.wpc-condition-group' ).attr( 'data-group' ),
56
- condition_group_list = $( this ).parents( '.wpc-conditions' ),
57
  new_group = condition_group_wrap.clone(),
58
  new_group_id = Math.floor(Math.random()*899999999+100000000); // Random number sequence of 9 length
59
 
2
 
3
  function wpc_condition_group_repeater() {
4
  // Condition group repeater
5
+ $( '.wpc-conditions' ).repeater({
6
  addTrigger: '.wpc-condition-group-add',
7
  removeTrigger: '.wpc-condition-group .delete',
8
  template: '.wpc-condition-group-template .wpc-condition-group-wrap',
9
  elementWrap: '.wpc-condition-group-wrap',
10
+ elementsContainer: '.wpc-condition-groups',
11
  removeElement: function( el ) {
12
  el.remove();
13
  }
53
  $( document.body ).on ( 'click', '.wpc-conditions .duplicate', function() {
54
  var condition_group_wrap = $( this ).parents( '.wpc-condition-group-wrap' ),
55
  condition_group_id = condition_group_wrap.find( '.wpc-condition-group' ).attr( 'data-group' ),
56
+ condition_group_list = $( this ).parents( '.wpc-condition-groups' ),
57
  new_group = condition_group_wrap.clone(),
58
  new_group_id = Math.floor(Math.random()*899999999+100000000); // Random number sequence of 9 length
59
 
libraries/wp-conditions/assets/js/wp-conditions.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function($){function t(){$(".wpc-conditions").parents(".postbox").repeater({addTrigger:".wpc-condition-group-add",removeTrigger:".wpc-condition-group .delete",template:".wpc-condition-group-template .wpc-condition-group-wrap",elementWrap:".wpc-condition-group-wrap",elementsContainer:".wpc-conditions",removeElement:function(t){t.remove()}})}function o(){$(".wpc-condition-group").repeater({addTrigger:".wpc-condition-add",removeTrigger:".wpc-condition-delete",template:".wpc-condition-template .wpc-condition-wrap",elementWrap:".wpc-condition-wrap",elementsContainer:".wpc-conditions-list"})}t(),o(),jQuery(document.body).on("repeater-added-row",function(t,e,n,i){var a=Math.floor(899999999*Math.random()+1e8);e.find("input[name], select[name]").attr("name",function(t,o){return o.replace("9999",a)||o}),e.find(".wpc-condition[data-id]").attr("data-id",function(t,o){return o.replace("9999",a)||o}),e.find("[data-group]").attr("data-group",function(t,o){return o.replace("9999",a)||o}),e.find(".repeater-active").removeClass("repeater-active"),o()}),$(document.body).on("click",".wpc-conditions .duplicate",function(){var t=$(this).parents(".wpc-condition-group-wrap"),e=t.find(".wpc-condition-group").attr("data-group"),n=$(this).parents(".wpc-conditions"),i=t.clone(),a=Math.floor(899999999*Math.random()+1e8);$(t).find("select").each(function(t){$(i).find("select").eq(t).val($(this).val())}),i.find(".wpc-condition-group").attr("data-group",a),i.find("input[name], select[name]").attr("name",function(t,o){return o.replace("conditions["+e+"]","conditions["+a+"]")}),i.find(".repeater-active").removeClass("repeater-active"),n.append(i),o(),$("html, body").on("scroll mousedown DOMMouseScroll mousewheel keydown touchmove",function(t){$("html, body").stop().off("scroll mousedown DOMMouseScroll mousewheel keydown touchmove")}),$("body, html").animate({scrollTop:$(i).offset().top-50},750,function(){$("html, body").off("scroll mousedown DOMMouseScroll mousewheel keydown touchmove")})}),$(document.body).on("change",".wpc-condition",function(){var t='<span style="width: calc( 42.5% - 75px ); border: 1px solid transparent; display: inline-block;">&nbsp;</span>',o={action:wpc2.action_prefix+"update_condition_value",id:$(this).attr("data-id"),group:$(this).parents(".wpc-condition-group").attr("data-group"),condition:$(this).val(),nonce:wpc.nonce},e=$(this).parents(".wpc-condition-wrap").first(),n=".wpc-value-field-wrap";e.find(n).html(t).block({message:null,overlayCSS:{background:"",opacity:.6}}),$.post(ajaxurl,o,function(t){e.find(n).replaceWith(t),$(document.body).trigger("wc-enhanced-select-init")});var i=e.find(".wpc-operator").val();e.find(".wpc-operator").empty().html(function(){var t=$(this),e=wpc.condition_operators[o.condition]||wpc.condition_operators["default"];$.each(e,function(o,e){t.append($("<option/>").attr("value",o).text(e)),t.val(i).val()||t.val(t.find("option:first").val())})}),e.find(".wpc-description").html(function(){return $('<span class="woocommerce-help-tip" />').attr("data-tip",wpc.condition_descriptions[o.condition]||"")}),$(".tips, .help_tip, .woocommerce-help-tip").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200}),$("#tiptip_holder").removeAttr("style"),$("#tiptip_arrow").removeAttr("style")}),$(".wpc-conditions-post-table.wpc-sortable-post-table tbody").sortable({items:"tr",handle:".sort",cursor:"move",axis:"y",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65,placeholder:"wc-metabox-sortable-placeholder",start:function(t,o){o.item.css("background-color","#f6f6f6")},stop:function(t,o){o.item.removeAttr("style")},update:function(t,o){$table=$(this).closest("table"),$table.block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var e={action:"wpc_save_post_order",form:$(this).closest("form").serialize(),nonce:wpc.nonce};$.post(ajaxurl,e,function(t){$(".wpc-conditions-post-table tbody tr:even").addClass("alternate"),$(".wpc-conditions-post-table tbody tr:odd").removeClass("alternate"),$table.unblock()})}})});
1
+ jQuery(function($){function t(){$(".wpc-conditions").repeater({addTrigger:".wpc-condition-group-add",removeTrigger:".wpc-condition-group .delete",template:".wpc-condition-group-template .wpc-condition-group-wrap",elementWrap:".wpc-condition-group-wrap",elementsContainer:".wpc-condition-groups",removeElement:function(t){t.remove()}})}function o(){$(".wpc-condition-group").repeater({addTrigger:".wpc-condition-add",removeTrigger:".wpc-condition-delete",template:".wpc-condition-template .wpc-condition-wrap",elementWrap:".wpc-condition-wrap",elementsContainer:".wpc-conditions-list"})}t(),o(),jQuery(document.body).on("repeater-added-row",function(t,e,n,i){var a=Math.floor(899999999*Math.random()+1e8);e.find("input[name], select[name]").attr("name",function(t,o){return o.replace("9999",a)||o}),e.find(".wpc-condition[data-id]").attr("data-id",function(t,o){return o.replace("9999",a)||o}),e.find("[data-group]").attr("data-group",function(t,o){return o.replace("9999",a)||o}),e.find(".repeater-active").removeClass("repeater-active"),o()}),$(document.body).on("click",".wpc-conditions .duplicate",function(){var t=$(this).parents(".wpc-condition-group-wrap"),e=t.find(".wpc-condition-group").attr("data-group"),n=$(this).parents(".wpc-condition-groups"),i=t.clone(),a=Math.floor(899999999*Math.random()+1e8);$(t).find("select").each(function(t){$(i).find("select").eq(t).val($(this).val())}),i.find(".wpc-condition-group").attr("data-group",a),i.find("input[name], select[name]").attr("name",function(t,o){return o.replace("conditions["+e+"]","conditions["+a+"]")}),i.find(".repeater-active").removeClass("repeater-active"),n.append(i),o(),$("html, body").on("scroll mousedown DOMMouseScroll mousewheel keydown touchmove",function(t){$("html, body").stop().off("scroll mousedown DOMMouseScroll mousewheel keydown touchmove")}),$("body, html").animate({scrollTop:$(i).offset().top-50},750,function(){$("html, body").off("scroll mousedown DOMMouseScroll mousewheel keydown touchmove")})}),$(document.body).on("change",".wpc-condition",function(){var t='<span style="width: calc( 42.5% - 75px ); border: 1px solid transparent; display: inline-block;">&nbsp;</span>',o={action:wpc2.action_prefix+"update_condition_value",id:$(this).attr("data-id"),group:$(this).parents(".wpc-condition-group").attr("data-group"),condition:$(this).val(),nonce:wpc.nonce},e=$(this).parents(".wpc-condition-wrap").first(),n=".wpc-value-field-wrap";e.find(n).html(t).block({message:null,overlayCSS:{background:"",opacity:.6}}),$.post(ajaxurl,o,function(t){e.find(n).replaceWith(t),$(document.body).trigger("wc-enhanced-select-init")});var i=e.find(".wpc-operator").val();e.find(".wpc-operator").empty().html(function(){var t=$(this),e=wpc.condition_operators[o.condition]||wpc.condition_operators["default"];$.each(e,function(o,e){t.append($("<option/>").attr("value",o).text(e)),t.val(i).val()||t.val(t.find("option:first").val())})}),e.find(".wpc-description").html(function(){return $('<span class="woocommerce-help-tip" />').attr("data-tip",wpc.condition_descriptions[o.condition]||"")}),$(".tips, .help_tip, .woocommerce-help-tip").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200}),$("#tiptip_holder").removeAttr("style"),$("#tiptip_arrow").removeAttr("style")}),$(".wpc-conditions-post-table.wpc-sortable-post-table tbody").sortable({items:"tr",handle:".sort",cursor:"move",axis:"y",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65,placeholder:"wc-metabox-sortable-placeholder",start:function(t,o){o.item.css("background-color","#f6f6f6")},stop:function(t,o){o.item.removeAttr("style")},update:function(t,o){$table=$(this).closest("table"),$table.block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var e={action:"wpc_save_post_order",form:$(this).closest("form").serialize(),nonce:wpc.nonce};$.post(ajaxurl,e,function(t){$(".wpc-conditions-post-table tbody tr:even").addClass("alternate"),$(".wpc-conditions-post-table tbody tr:odd").removeClass("alternate"),$table.unblock()})}})});
libraries/wp-conditions/conditions/wpc-role-condition.php CHANGED
@@ -34,7 +34,7 @@ if ( ! class_exists( 'WPC_Role_Condition' ) ) {
34
  global $current_user;
35
  return $current_user->caps;
36
  } else {
37
- return array( 'not_logged_in' );
38
  }
39
 
40
  }
34
  global $current_user;
35
  return $current_user->caps;
36
  } else {
37
+ return array( 'not_logged_in' => 'not_logged_in' );
38
  }
39
 
40
  }
libraries/wp-conditions/conditions/wpc-zipcode-condition.php CHANGED
@@ -9,7 +9,7 @@ if ( ! class_exists( 'WPC_Zipcode_Condition' ) ) {
9
  $this->name = __( 'Zipcode', 'wpc-conditions' );
10
  $this->slug = __( 'zipcode', 'wpc-conditions' );
11
  $this->group = __( 'User', 'wpc-conditions' );
12
- $this->description = __( 'Compare against customer zipcode. Comma separated list allowed. Use \'*\' for wildcard', 'wpc-conditions' );
13
 
14
  parent::__construct();
15
  }
@@ -23,7 +23,10 @@ if ( ! class_exists( 'WPC_Zipcode_Condition' ) ) {
23
  if ( '==' == $operator ) :
24
 
25
  foreach ( $value_zipcodes as $zip ) :
26
- if ( $match = preg_match( '/^' . preg_quote( $zip, '/' ) . '/i', $zipcode ) ) :
 
 
 
27
  break;
28
  endif;
29
  endforeach;
@@ -32,9 +35,11 @@ if ( ! class_exists( 'WPC_Zipcode_Condition' ) ) {
32
 
33
  $match = true;
34
  foreach ( $value_zipcodes as $zip ) :
35
- if ( preg_match( '/^' . preg_quote( $zip, '/' ) . '/i', $zipcode ) ) :
 
 
 
36
  return $match = false;
37
- break;
38
  endif;
39
  endforeach;
40
 
9
  $this->name = __( 'Zipcode', 'wpc-conditions' );
10
  $this->slug = __( 'zipcode', 'wpc-conditions' );
11
  $this->group = __( 'User', 'wpc-conditions' );
12
+ $this->description = __( 'Compare against customer zipcode. All zipcodes are matched with a \'starts with\' matching method.', 'wpc-conditions' );
13
 
14
  parent::__construct();
15
  }
23
  if ( '==' == $operator ) :
24
 
25
  foreach ( $value_zipcodes as $zip ) :
26
+ $parts = explode( '-', $zip );
27
+ if ( count( $parts ) > 1 && $match = ( $zipcode >= min( $parts ) && $zipcode <= max( $parts ) ) ) :
28
+ break;
29
+ elseif ( $match = preg_match( '/^' . preg_quote( $zip, '/' ) . '/i', $zipcode ) ) :
30
  break;
31
  endif;
32
  endforeach;
35
 
36
  $match = true;
37
  foreach ( $value_zipcodes as $zip ) :
38
+ $parts = explode( '-', $zip );
39
+ if ( count( $parts ) > 1 && ( $zipcode >= min( $parts ) && $zipcode <= max( $parts ) ) ) :
40
+ return $match = false;
41
+ elseif ( preg_match( '/^' . preg_quote( $zip, '/' ) . '/i', $zipcode ) ) :
42
  return $match = false;
 
43
  endif;
44
  endforeach;
45
 
libraries/wp-conditions/readme.txt CHANGED
@@ -4,12 +4,19 @@ It is intended to be used on plugins like build by Jeroen such as Advanced Shipp
4
  Copyright © 2017 Jeroen Sormani
5
 
6
 
7
- # Current version: 1.0.2
8
 
9
  # Changelog
10
 
 
 
 
 
 
 
11
  = 1.0.2 - 28/04/2017 =
12
 
 
13
  - [Add] - Volume condition
14
  - [Add] - Support for 'Guest' users in the 'User role' condition
15
  - [Fix] - Use 9 length IDs for new fields - prevents too big numbers for 32-bits systems.
4
  Copyright © 2017 Jeroen Sormani
5
 
6
 
7
+ # Current version: 1.0.3
8
 
9
  # Changelog
10
 
11
+ = 1.0.3 - 28/06/2017 =
12
+
13
+ - [Fix] - 'User role' condition 'Guest' wasn't working
14
+ - [Improvement] - Allow conditions outside postbox / multiple times inside. Not limited to .postbox class.
15
+ - [Add] - Zipcode range support. E.g. 'Zipcode' = 'equal to' = '10000-20000,30000-40000'
16
+
17
  = 1.0.2 - 28/04/2017 =
18
 
19
+
20
  - [Add] - Volume condition
21
  - [Add] - Support for 'Guest' users in the 'User role' condition
22
  - [Fix] - Use 9 length IDs for new fields - prevents too big numbers for 32-bits systems.
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: sormano
3
  Tags: woocommerce shipping, woocommerce, shipping, woocommerce free shipping, woocommerce free, woocommerce advanced free shipping, wc free shipping, wc shipping, advanced shipping, pro shipping, table rate shipping, country shipping, free shipping
4
  Requires at least: 4.0
5
- Tested up to: 4.7.3
6
- Stable tag: 1.1.1
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -27,6 +27,7 @@ There are many default shipping conditions available.
27
  - Shipping class
28
  - Category
29
  - Weight
 
30
  - many, many more...
31
 
32
  Not there what you're looking for? The plugin has been made to be easily extensible, meaning you can also add your own custom conditions through code snippets!
@@ -99,6 +100,13 @@ In the future this will likely be changed, for now I recommend taking a look at
99
 
100
  == Changelog ==
101
 
 
 
 
 
 
 
 
102
  = 1.1.1 - 28-04-2017 =
103
 
104
  * [Fix] - Use 9 digit random IDs to prevent too big numbers for 32-bit systems
2
  Contributors: sormano
3
  Tags: woocommerce shipping, woocommerce, shipping, woocommerce free shipping, woocommerce free, woocommerce advanced free shipping, wc free shipping, wc shipping, advanced shipping, pro shipping, table rate shipping, country shipping, free shipping
4
  Requires at least: 4.0
5
+ Tested up to: 4.8
6
+ Stable tag: 1.1.2
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
27
  - Shipping class
28
  - Category
29
  - Weight
30
+ - Volume (Width / Length / Height)
31
  - many, many more...
32
 
33
  Not there what you're looking for? The plugin has been made to be easily extensible, meaning you can also add your own custom conditions through code snippets!
100
 
101
  == Changelog ==
102
 
103
+ = 1.1.2 - 29-06-2017 =
104
+
105
+ * [Improvement] - Update WP Conditions to 1.0.3
106
+ - [Fix] - 'User role' condition 'Guest' wasn't working
107
+ - [Improvement] - Allow conditions outside postbox / multiple times inside. Not limited to .postbox class.
108
+ - [Add] - Zipcode range support. E.g. 'Zipcode' = 'equal to' = '10000-20000,30000-40000'
109
+
110
  = 1.1.1 - 28-04-2017 =
111
 
112
  * [Fix] - Use 9 digit random IDs to prevent too big numbers for 32-bit systems
woocommerce-advanced-free-shipping.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce Advanced Free Shipping
4
  * Plugin URI: https://wordpress.org/plugins/woocommerce-advanced-free-shipping/
5
  * Description: WooCommerce Advanced Free Shipping is an plugin which allows you to set up advanced free shipping conditions.
6
- * Version: 1.1.1
7
  * Author: Jeroen Sormani
8
  * Author URI: http://jeroensormani.com/
9
  * Text Domain: woocommerce-advanced-free-shipping
@@ -48,7 +48,7 @@ class WooCommerce_Advanced_Free_Shipping {
48
  * @since 1.0.4
49
  * @var string $version Plugin version number.
50
  */
51
- public $version = '1.1.1';
52
 
53
 
54
  /**
3
  * Plugin Name: WooCommerce Advanced Free Shipping
4
  * Plugin URI: https://wordpress.org/plugins/woocommerce-advanced-free-shipping/
5
  * Description: WooCommerce Advanced Free Shipping is an plugin which allows you to set up advanced free shipping conditions.
6
+ * Version: 1.1.2
7
  * Author: Jeroen Sormani
8
  * Author URI: http://jeroensormani.com/
9
  * Text Domain: woocommerce-advanced-free-shipping
48
  * @since 1.0.4
49
  * @var string $version Plugin version number.
50
  */
51
+ public $version = '1.1.2';
52
 
53
 
54
  /**