From 1c58f0e79f2129b9e84f06958b4694db292f3d06 Mon Sep 17 00:00:00 2001
From: dixitadusara
'+wc_add_to_cart_variation_params.i18n_no_matching_variations_text+"
"),i.$form.find(".wc-no-matching-variations").slideDown(200)))}else i.$form.trigger("update_variation_values"),i.$form.trigger("reset_data");i.toggleResetLink(r.chosenCount>0)},e.prototype.onFoundVariation=function(a,i){var r=a.data.variationForm,e=r.$product.find(".product_meta").find(".sku"),n=r.$product.find(".product_weight"),s=r.$product.find(".product_dimensions"),_=r.$singleVariationWrap.find(".quantity"),c=!0,d=!1,m="";i.sku?e.wc_set_content(i.sku):e.wc_reset_content(),i.weight?n.wc_set_content(i.weight_html):n.wc_reset_content(),i.dimensions?s.wc_set_content(i.dimensions_html):s.wc_reset_content(),r.$form.wc_variations_image_update(i),i.variation_is_visible?(d=o("variation-template"),i.variation_id):d=o("unavailable-variation-template"),m=(m=(m=d({variation:i})).replace("/**/",""),r.$singleVariation.html(m),r.$form.find('input[name="variation_id"], input.variation_id').val(i.variation_id).change(),"yes"===i.is_sold_individually?(_.find("input.qty").val("1").attr("min","1").attr("max",""),_.hide()):(_.find("input.qty").attr("min",i.min_qty).attr("max",i.max_qty),_.show()),i.is_purchasable&&i.is_in_stock&&i.variation_is_visible||(c=!1),t.trim(r.$singleVariation.text())?r.$singleVariation.slideDown(200).trigger("show_variation",[i,c]):r.$singleVariation.show().trigger("show_variation",[i,c])},e.prototype.onChange=function(a){var i=a.data.variationForm;i.$form.find('input[name="variation_id"], input.variation_id').val("").change(),i.$form.find(".wc-no-matching-variations").remove(),i.useAjax?i.$form.trigger("check_variations"):(i.$form.trigger("woocommerce_variation_select_change"),i.$form.trigger("check_variations"),t(this).blur()),i.$form.trigger("woocommerce_variation_has_changed")},e.prototype.addSlashes=function(t){return t=t.replace(/'/g,"\\'"),t=t.replace(/"/g,'\\"')},e.prototype.onUpdateAttributes=function(a){var i=a.data.variationForm,r=i.getChosenAttributes().data;i.useAjax||(i.$attributeFields.each(function(a,e){var o=t(e),n=o.data("attribute_name")||o.attr("name"),s=t(e).data("show_option_none"),_=":gt(0)",c=0,d=t(""),m=o.val()||"",v=!0;if(!o.data("attribute_html")){var l=o.clone();l.find("option").removeAttr("disabled attached").removeAttr("selected"),o.data("attribute_options",l.find("option"+_).get()),o.data("attribute_html",l.html())}d.html(o.data("attribute_html"));var g=t.extend(!0,{},r);g[n]="";var f=i.findMatchingVariations(i.variationData,g);for(var u in f)if("undefined"!=typeof f[u]){var h=f[u].attributes;for(var p in h)if(h.hasOwnProperty(p)){var w=h[p],b="";p===n&&(f[u].variation_is_active&&(b="enabled"),w?(w=t("").html(w).text(),d.find('option[value="'+i.addSlashes(w)+'"]').addClass("attached "+b)):d.find("option:gt(0)").addClass("attached "+b))}}c=d.find("option.attached").length,!m||0!==c&&0!==d.find('option.attached.enabled[value="'+i.addSlashes(m)+'"]').length||(v=!1),c>0&&m&&v&&"no"===s&&(d.find("option:first").remove(),_=""),d.find("option"+_+":not(.attached)").remove(),o.html(d.html()),o.find("option"+_+":not(.enabled)").prop("disabled",!0),m?v?o.val(m):o.val("").change():o.val("")}),i.$form.trigger("woocommerce_update_variation_values"))},e.prototype.getChosenAttributes=function(){var a={},i=0,r=0;return this.$attributeFields.each(function(){var e=t(this).data("attribute_name")||t(this).attr("name"),o=t(this).val()||"";o.length>0&&r++,i++,a[e]=o}),{count:i,chosenCount:r,data:a}},e.prototype.findMatchingVariations=function(t,a){for(var i=[],r=0;r"+n+"
"}),t+="'+wc_add_to_cart_variation_params.i18n_no_matching_variations_text+"
"),i.$form.find(".wc-no-matching-variations").slideDown(200)))}else i.$form.trigger("update_variation_values"),i.$form.trigger("reset_data");i.toggleResetLink(r.chosenCount>0)},e.prototype.onFoundVariation=function(a,i){var r=a.data.variationForm,e=r.$product.find(".product_meta").find(".sku"),n=r.$product.find(".product_weight"),s=r.$product.find(".product_dimensions"),_=r.$singleVariationWrap.find(".quantity"),c=!0,d=!1,m="";i.sku?e.wc_set_content(i.sku):e.wc_reset_content(),i.weight?n.wc_set_content(i.weight_html):n.wc_reset_content(),i.dimensions?s.wc_set_content(i.dimensions_html):s.wc_reset_content(),r.$form.wc_variations_image_update(i),i.variation_is_visible?(d=o("variation-template"),i.variation_id):d=o("unavailable-variation-template"),m=(m=(m=d({variation:i})).replace("/**/",""),r.$singleVariation.html(m),r.$form.find('input[name="variation_id"], input.variation_id').val(i.variation_id).change(),"yes"===i.is_sold_individually?(_.find("input.qty").val("1").attr("min","1").attr("max",""),_.hide()):(_.find("input.qty").attr("min",i.min_qty).attr("max",i.max_qty),_.show()),i.is_purchasable&&i.is_in_stock&&i.variation_is_visible||(c=!1),t.trim(r.$singleVariation.text())?r.$singleVariation.slideDown(200).trigger("show_variation",[i,c]):r.$singleVariation.show().trigger("show_variation",[i,c])},e.prototype.onChange=function(a){var i=a.data.variationForm;i.$form.find('input[name="variation_id"], input.variation_id').val("").change(),i.$form.find(".wc-no-matching-variations").remove(),i.useAjax?i.$form.trigger("check_variations"):(i.$form.trigger("woocommerce_variation_select_change"),i.$form.trigger("check_variations"),t(this).blur()),i.$form.trigger("woocommerce_variation_has_changed")},e.prototype.addSlashes=function(t){return t=t.replace(/'/g,"\\'"),t=t.replace(/"/g,'\\"')},e.prototype.onUpdateAttributes=function(a){var i=a.data.variationForm,r=i.getChosenAttributes().data;i.useAjax||(i.$attributeFields.each(function(a,e){var o=t(e),n=o.data("attribute_name")||o.attr("name"),s=t(e).data("show_option_none"),_=":gt(0)",c=0,d=t(""),m=o.val()||"",v=!0;if(!o.data("attribute_html")){var l=o.clone();l.find("option").removeAttr("disabled attached").removeAttr("selected"),o.data("attribute_options",l.find("option"+_).get()),o.data("attribute_html",l.html())}d.html(o.data("attribute_html"));var g=t.extend(!0,{},r);g[n]="";var f=i.findMatchingVariations(i.variationData,g);for(var u in f)if("undefined"!=typeof f[u]){var h=f[u].attributes;for(var p in h)if(h.hasOwnProperty(p)){var w=h[p],b="";p===n&&(f[u].variation_is_active&&(b="enabled"),w?(w=t("").html(w).text(),d.find('option[value="'+i.addSlashes(w)+'"]').addClass("attached "+b)):d.find("option:gt(0)").addClass("attached "+b))}}c=d.find("option.attached").length,!m||0!==c&&0!==d.find('option.attached.enabled[value="'+i.addSlashes(m)+'"]').length||(v=!1),c>0&&m&&v&&"no"===s&&(d.find("option:first").remove(),_=""),d.find("option"+_+":not(.attached)").remove(),o.html(d.html()),o.find("option"+_+":not(.enabled)").prop("disabled",!0),m?v?o.val(m):o.val("").change():o.val("")}),i.$form.trigger("woocommerce_update_variation_values"))},e.prototype.getChosenAttributes=function(){var a={},i=0,r=0;return this.$attributeFields.each(function(){var e=t(this).data("attribute_name")||t(this).attr("name"),o=t(this).val()||"";o.length>0&&r++,i++,a[e]=o}),{count:i,chosenCount:r,data:a}},e.prototype.findMatchingVariations=function(t,a){for(var i=[],r=0;r'+wc_add_to_cart_variation_params.i18n_no_matching_variations_text+"
"),a.$form.find(".wc-no-matching-variations").slideDown(200)))},complete:function(){a.$form.unblock()}});else{a.$form.trigger("update_variation_values");var e=a.findMatchingVariations(a.variationData,r).shift();e?a.$form.trigger("found_variation",[e]):(a.$form.trigger("reset_data"),i.chosenCount=0,a.loading||(a.$form.find(".single_variation").after(''+wc_add_to_cart_variation_params.i18n_no_matching_variations_text+"
"),a.$form.find(".wc-no-matching-variations").slideDown(200)))}else a.$form.trigger("update_variation_values"),a.$form.trigger("reset_data");a.toggleResetLink(0+
From 4738162c25bb244631574d4230533b470f0ee8df Mon Sep 17 00:00:00 2001
From: Claudio Sanches
+ live rates from a specific carrier (e.g. UPS) you can find a variety of extensions available for WooCommerce here.', 'woocommerce' ),
+ esc_attr__( 'A live rate is the exact cost to ship an order, quoted directly from the shipping carrier.', 'woocommerce' ),
+ 'https://woocommerce.com/product-category/woocommerce-extensions/shipping-methods/shipping-carriers/'
+ ),
+ array(
+ 'span' => array(
+ 'class' => array(),
+ 'data-tip' => array(),
+ ),
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ ),
+ )
+ );
+ ?>
+
@@ -1219,6 +1248,32 @@ class WC_Admin_Setup_Wizard {
return in_array( $country_code, $supported_countries, true );
}
+ /**
+ * Is ShipStation country supported
+ *
+ * @param string $country_code Country code.
+ */
+ protected function is_shipstation_supported_country( $country_code ) {
+ $supported_countries = array(
+ 'AU', // Australia.
+ 'CA', // Canada.
+ 'GB', // United Kingdom.
+ );
+ return in_array( $country_code, $supported_countries, true );
+ }
+
+ /**
+ * Is WooCommerce Services shipping label country supported
+ *
+ * @param string $country_code Country code.
+ */
+ protected function is_wcs_shipping_labels_supported_country( $country_code ) {
+ $supported_countries = array(
+ 'US', // United States.
+ );
+ return in_array( $country_code, $supported_countries, true );
+ }
+
/**
* Helper method to retrieve the current user's email address.
*
From c179f7c5c66730b09329f4daf096ec5ec2ae4380 Mon Sep 17 00:00:00 2001
From: Jeff Stieler
-
-
-
-
+ get_product_weight_selection(),
+ $this->get_product_dimension_selection()
+ );
+ ?>
+
From e737d879e1fcada2862c6ea2f1a74735f364f760 Mon Sep 17 00:00:00 2001
From: Coen Jacobs
+ is_wcs_shipping_labels_supported_country( $country_code ) ) :
+ $this->display_recommended_item( array(
+ 'type' => 'woocommerce_services',
+ 'title' => __( 'Print shipping labels at home', 'woocommerce' ),
+ 'description' => __( 'We recommend WooCommerce Services & Jetpack. These plugins will save you time at the Post Office by enabling you to print your shipping labels at home.', 'woocommerce' ),
+ 'img_url' => WC()->plugin_url() . '/assets/images/obw-woocommerce-services-icon.png',
+ 'img_alt' => __( 'WooCommerce Services icon', 'woocommerce' ),
+ 'plugins' => $this->get_wcs_requisite_plugins(),
+ ) );
+ elseif ( $this->is_shipstation_supported_country( $country_code ) ) :
+ $this->display_recommended_item( array(
+ 'type' => 'shipstation',
+ 'title' => __( 'Print shipping labels at home', 'woocommerce' ),
+ 'description' => __( 'We recommend using ShipStation to save time at the Post Office by printing your shipping labels at home. Try ShipStation free for 30 days.', 'woocommerce' ),
+ 'img_url' => WC()->plugin_url() . '/assets/images/obw-shipstation-icon.png',
+ 'img_alt' => __( 'ShipStation icon', 'woocommerce' ),
+ 'plugins' => array(
+ array(
+ 'name' => __( 'ShipStation', 'woocommerce' ),
+ 'slug' => 'woocommerce-shipstation',
+ ),
+ ),
+ ) );
+ endif;
+ ?>
+
+
+
+
is_wcs_shipping_labels_supported_country( $country_code ) ) :
+ if ( $is_wcs_labels_supported ) :
$this->display_recommended_item( array(
'type' => 'woocommerce_services',
'title' => __( 'Print shipping labels at home', 'woocommerce' ),
@@ -940,7 +987,7 @@ class WC_Admin_Setup_Wizard {
'img_alt' => __( 'WooCommerce Services icon', 'woocommerce' ),
'plugins' => $this->get_wcs_requisite_plugins(),
) );
- elseif ( $this->is_shipstation_supported_country( $country_code ) ) :
+ elseif ( $is_shipstation_supported ) :
$this->display_recommended_item( array(
'type' => 'shipstation',
'title' => __( 'Print shipping labels at home', 'woocommerce' ),
@@ -955,51 +1002,20 @@ class WC_Admin_Setup_Wizard {
),
) );
endif;
- ?>
+ endif;
+ ?>