Merge branch 'master' into pr/17183
This commit is contained in:
commit
ba3d959e66
Binary file not shown.
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 106 KiB |
|
@ -13,7 +13,7 @@
|
|||
*/
|
||||
|
||||
;(function($) {
|
||||
|
||||
'use strict';
|
||||
$.fn.extend({
|
||||
autocomplete: function(urlOrData, options) {
|
||||
var isUrl = typeof urlOrData == "string";
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -155,6 +155,11 @@ span.mce_woocommerce_shortcodes_button {
|
|||
padding: 0 2em;
|
||||
}
|
||||
|
||||
.plugin-details-table-container {
|
||||
max-height: 40vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
table.plugin-details-table {
|
||||
margin: 20px 0;
|
||||
th, td {
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -38,6 +38,15 @@ p.demo_store,
|
|||
}
|
||||
}
|
||||
|
||||
.screen-reader-text {
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
position: absolute !important;
|
||||
width: 1px;
|
||||
word-wrap: normal !important;
|
||||
}
|
||||
|
||||
.admin-bar p.demo_store {
|
||||
top: 32px;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
*/
|
||||
$.fn.WCBackboneModal = function( options ) {
|
||||
return this.each( function() {
|
||||
( new $.WCBackboneModal( $( this ), options ) );
|
||||
var WCeachBackboneModal = new $.WCBackboneModal( $( this ), options )
|
||||
( WCeachBackboneModal() );
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -24,10 +25,12 @@
|
|||
var settings = $.extend( {}, $.WCBackboneModal.defaultOptions, options );
|
||||
|
||||
if ( settings.template ) {
|
||||
new $.WCBackboneModal.View({
|
||||
target: settings.template,
|
||||
string: settings.variable
|
||||
});
|
||||
|
||||
var BackboneModal = new $.WCBackboneModal.View({
|
||||
target: settings.template,
|
||||
string: settings.variable
|
||||
});
|
||||
BackboneModal();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
!function(e,t,n){"use strict";e.fn.WCBackboneModal=function(t){return this.each(function(){new e.WCBackboneModal(e(this),t)})},e.WCBackboneModal=function(t,n){var o=e.extend({},e.WCBackboneModal.defaultOptions,n);o.template&&new e.WCBackboneModal.View({target:o.template,string:o.variable})},e.WCBackboneModal.defaultOptions={template:"",variable:{}},e.WCBackboneModal.View=t.View.extend({tagName:"div",id:"wc-backbone-modal-dialog",_target:undefined,_string:undefined,events:{"click .modal-close":"closeButton","click #btn-ok":"addButton","touchstart #btn-ok":"addButton",keydown:"keyboardActions"},resizeContent:function(){var t=e(".wc-backbone-modal-content").find("article"),n=.75*e(window).height();t.css({"max-height":n+"px"})},initialize:function(t){var o=this;this._target=t.target,this._string=t.string,n.bindAll(this,"render"),this.render(),e(window).resize(function(){o.resizeContent()})},render:function(){var t=wp.template(this._target);this.$el.append(t(this._string)),e(document.body).css({overflow:"hidden"}).append(this.$el),this.resizeContent(),this.$(".wc-backbone-modal-content").attr("tabindex","0").focus(),e(document.body).trigger("init_tooltips"),e(document.body).trigger("wc_backbone_modal_loaded",this._target)},closeButton:function(t){t.preventDefault(),e(document.body).trigger("wc_backbone_modal_before_remove",this._target),this.undelegateEvents(),e(document).off("focusin"),e(document.body).css({overflow:"auto"}),this.remove(),e(document.body).trigger("wc_backbone_modal_removed",this._target)},addButton:function(t){e(document.body).trigger("wc_backbone_modal_response",[this._target,this.getFormData()]),this.closeButton(t)},getFormData:function(){var t={};return e(document.body).trigger("wc_backbone_modal_before_update",this._target),e.each(e("form",this.$el).serializeArray(),function(n,o){-1!==o.name.indexOf("[]")?(o.name=o.name.replace("[]",""),t[o.name]=e.makeArray(t[o.name]),t[o.name].push(o.value)):t[o.name]=o.value}),t},keyboardActions:function(e){var t=e.keyCode||e.which;13!==t||e.target.tagName&&("input"===e.target.tagName.toLowerCase()||"textarea"===e.target.tagName.toLowerCase())||this.addButton(e),27===t&&this.closeButton(e)}})}(jQuery,Backbone,_);
|
||||
!function(e,t,n){"use strict";e.fn.WCBackboneModal=function(t){return this.each(function(){var n=new e.WCBackboneModal(e(this),t)(n())})},e.WCBackboneModal=function(t,n){var o=e.extend({},e.WCBackboneModal.defaultOptions,n);o.template&&new e.WCBackboneModal.View({target:o.template,string:o.variable})()},e.WCBackboneModal.defaultOptions={template:"",variable:{}},e.WCBackboneModal.View=t.View.extend({tagName:"div",id:"wc-backbone-modal-dialog",_target:undefined,_string:undefined,events:{"click .modal-close":"closeButton","click #btn-ok":"addButton","touchstart #btn-ok":"addButton",keydown:"keyboardActions"},resizeContent:function(){var t=e(".wc-backbone-modal-content").find("article"),n=.75*e(window).height();t.css({"max-height":n+"px"})},initialize:function(t){var o=this;this._target=t.target,this._string=t.string,n.bindAll(this,"render"),this.render(),e(window).resize(function(){o.resizeContent()})},render:function(){var t=wp.template(this._target);this.$el.append(t(this._string)),e(document.body).css({overflow:"hidden"}).append(this.$el),this.resizeContent(),this.$(".wc-backbone-modal-content").attr("tabindex","0").focus(),e(document.body).trigger("init_tooltips"),e(document.body).trigger("wc_backbone_modal_loaded",this._target)},closeButton:function(t){t.preventDefault(),e(document.body).trigger("wc_backbone_modal_before_remove",this._target),this.undelegateEvents(),e(document).off("focusin"),e(document.body).css({overflow:"auto"}),this.remove(),e(document.body).trigger("wc_backbone_modal_removed",this._target)},addButton:function(t){e(document.body).trigger("wc_backbone_modal_response",[this._target,this.getFormData()]),this.closeButton(t)},getFormData:function(){var t={};return e(document.body).trigger("wc_backbone_modal_before_update",this._target),e.each(e("form",this.$el).serializeArray(),function(n,o){-1!==o.name.indexOf("[]")?(o.name=o.name.replace("[]",""),t[o.name]=e.makeArray(t[o.name]),t[o.name].push(o.value)):t[o.name]=o.value}),t},keyboardActions:function(e){var t=e.keyCode||e.which;13!==t||e.target.tagName&&("input"===e.target.tagName.toLowerCase()||"textarea"===e.target.tagName.toLowerCase())||this.addButton(e),27===t&&this.closeButton(e)}})}(jQuery,Backbone,_);
|
|
@ -549,6 +549,10 @@ jQuery( function ( $ ) {
|
|||
action : 'woocommerce_remove_order_item',
|
||||
security : woocommerce_admin_meta_boxes.order_item_nonce
|
||||
};
|
||||
// Check if items have changed, if so pass them through so we can save them before deleting.
|
||||
if ( 'true' === $( 'button.cancel-action' ).attr( 'data-reload' ) ) {
|
||||
data.items = $( 'table.woocommerce_order_items :input[name], .wc-order-totals-items :input[name]' ).serialize();
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: woocommerce_admin_meta_boxes.ajax_url,
|
||||
|
@ -556,7 +560,7 @@ jQuery( function ( $ ) {
|
|||
type: 'POST',
|
||||
success: function( response ) {
|
||||
if ( response.success ) {
|
||||
$( '#woocommerce-order-items' ).find( '.inside' ).empty();
|
||||
$( '#woocommerce-order-items' ).find( '.inside' ).empty();
|
||||
$( '#woocommerce-order-items' ).find( '.inside' ).append( response.data.html );
|
||||
wc_meta_boxes_order.init_tiptip();
|
||||
wc_meta_boxes_order_items.unblock();
|
||||
|
@ -1078,6 +1082,7 @@ jQuery( function ( $ ) {
|
|||
init: function( e, target ) {
|
||||
if ( 'wc-modal-add-products' === target ) {
|
||||
$( document.body ).trigger( 'wc-enhanced-select-init' );
|
||||
$( '#add_item_id' ).selectWoo( 'open' ).selectWoo( 'focus' );
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1110,6 +1115,11 @@ jQuery( function ( $ ) {
|
|||
data : $( '#wc-backbone-modal-dialog form' ).serialize()
|
||||
};
|
||||
|
||||
// Check if items have changed, if so pass them through so we can save them before adding a new item.
|
||||
if ( 'true' === $( 'button.cancel-action' ).attr( 'data-reload' ) ) {
|
||||
data.items = $( 'table.woocommerce_order_items :input[name], .wc-order-totals-items :input[name]' ).serialize();
|
||||
}
|
||||
|
||||
$.post( woocommerce_admin_meta_boxes.ajax_url, data, function( response ) {
|
||||
if ( response.success ) {
|
||||
$( '#woocommerce-order-items' ).find( '.inside' ).empty();
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
/* global wp, woocommerce_admin_meta_boxes_variations, woocommerce_admin, accounting */
|
||||
jQuery( function( $ ) {
|
||||
|
||||
( function( $ ) {
|
||||
'use strict';
|
||||
/**
|
||||
* Variations actions
|
||||
*/
|
||||
|
@ -1043,4 +1043,4 @@ jQuery( function( $ ) {
|
|||
wc_meta_boxes_product_variations_ajax.init();
|
||||
wc_meta_boxes_product_variations_pagenav.init();
|
||||
|
||||
});
|
||||
})( jQuery );
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,5 @@
|
|||
/*global wc_setup_params */
|
||||
/*global wc_setup_currencies */
|
||||
jQuery( function( $ ) {
|
||||
function blockWizardUI() {
|
||||
$('.wc-setup-content').block({
|
||||
|
@ -136,4 +137,9 @@ jQuery( function( $ ) {
|
|||
} );
|
||||
|
||||
$( '.wc-wizard-services input#stripe_create_account' ).change();
|
||||
|
||||
$( 'select#store_country_state' ).on( 'change', function() {
|
||||
var countryCode = this.value.split( ':' )[ 0 ];
|
||||
$( 'select#currency_code' ).val( wc_setup_currencies[ countryCode ] ).change();
|
||||
} );
|
||||
} );
|
||||
|
|
|
@ -1 +1 @@
|
|||
jQuery(function(e){function i(){e(".wc-setup-content").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}function s(){e("form.activate-jetpack").submit()}function t(){wp.ajax.post("setup_wizard_check_jetpack").then(function(e){if(!e||!e.is_active||"yes"===e.is_active)return s();setTimeout(t,3e3)}).fail(function(){s()})}e(".button-next").on("click",function(){var s=e(this).parents("form").get(0);return("function"!=typeof s.checkValidity||s.checkValidity())&&i(),!0}),e(".wc-wizard-services").on("change",".wc-wizard-service-enable input",function(){e(this).is(":checked")?(e(this).closest(".wc-wizard-service-toggle").removeClass("disabled"),e(this).closest(".wc-wizard-service-item").addClass("checked"),e(this).closest(".wc-wizard-service-item").find(".wc-wizard-service-settings").removeClass("hide")):(e(this).closest(".wc-wizard-service-toggle").addClass("disabled"),e(this).closest(".wc-wizard-service-item").removeClass("checked"),e(this).closest(".wc-wizard-service-item").find(".wc-wizard-service-settings").addClass("hide"))}),e(".wc-wizard-services").on("click",".wc-wizard-service-enable",function(i){i.stopPropagation();var s=e(this).find(".wc-wizard-service-toggle input");s.prop("checked",!s.prop("checked")).change()}),e(".wc-wizard-services-list-toggle").on("change",".wc-wizard-service-enable input",function(){e(this).closest(".wc-wizard-services-list-toggle").toggleClass("closed"),e(this).closest(".wc-wizard-services").find(".wc-wizard-service-item").slideToggle().css("display","flex")}),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-select .method",function(i){var s=e(this).closest(".wc-wizard-service-description"),t=i.target.value,c=s.find(".shipping-method-descriptions");c.find(".shipping-method-description").addClass("hide"),c.find("."+t).removeClass("hide");var r=s.find(".shipping-method-settings");r.find(".shipping-method-setting").addClass("hide").find(".shipping-method-required-field").prop("required",!1),r.find("."+t).removeClass("hide").find(".shipping-method-required-field").prop("required",!0)}),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-enable",function(){var i=e(this).is(":checked");e(this).closest(".wc-wizard-service-item").find(".shipping-method-required-field").prop("required",i)}),e(".activate-jetpack").on("click",".button-primary",function(e){if(i(),"no"===wc_setup_params.pending_jetpack_install)return!0;e.preventDefault(),t()}),e(".wc-wizard-services").on("change","input#stripe_create_account",function(){e(this).is(":checked")?(e(this).closest(".wc-wizard-service-settings").find("input.payment-email-input").prop("required",!0),e(this).closest(".wc-wizard-service-settings").find(".wc-wizard-service-setting-stripe_email").show()):(e(this).closest(".wc-wizard-service-settings").find("input.payment-email-input").prop("required",!1),e(this).closest(".wc-wizard-service-settings").find(".wc-wizard-service-setting-stripe_email").hide())}),e(".wc-wizard-services input#stripe_create_account").change()});
|
||||
jQuery(function(e){function i(){e(".wc-setup-content").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}function s(){e("form.activate-jetpack").submit()}function t(){wp.ajax.post("setup_wizard_check_jetpack").then(function(e){if(!e||!e.is_active||"yes"===e.is_active)return s();setTimeout(t,3e3)}).fail(function(){s()})}e(".button-next").on("click",function(){var s=e(this).parents("form").get(0);return("function"!=typeof s.checkValidity||s.checkValidity())&&i(),!0}),e(".wc-wizard-services").on("change",".wc-wizard-service-enable input",function(){e(this).is(":checked")?(e(this).closest(".wc-wizard-service-toggle").removeClass("disabled"),e(this).closest(".wc-wizard-service-item").addClass("checked"),e(this).closest(".wc-wizard-service-item").find(".wc-wizard-service-settings").removeClass("hide")):(e(this).closest(".wc-wizard-service-toggle").addClass("disabled"),e(this).closest(".wc-wizard-service-item").removeClass("checked"),e(this).closest(".wc-wizard-service-item").find(".wc-wizard-service-settings").addClass("hide"))}),e(".wc-wizard-services").on("click",".wc-wizard-service-enable",function(i){i.stopPropagation();var s=e(this).find(".wc-wizard-service-toggle input");s.prop("checked",!s.prop("checked")).change()}),e(".wc-wizard-services-list-toggle").on("change",".wc-wizard-service-enable input",function(){e(this).closest(".wc-wizard-services-list-toggle").toggleClass("closed"),e(this).closest(".wc-wizard-services").find(".wc-wizard-service-item").slideToggle().css("display","flex")}),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-select .method",function(i){var s=e(this).closest(".wc-wizard-service-description"),t=i.target.value,c=s.find(".shipping-method-descriptions");c.find(".shipping-method-description").addClass("hide"),c.find("."+t).removeClass("hide");var r=s.find(".shipping-method-settings");r.find(".shipping-method-setting").addClass("hide").find(".shipping-method-required-field").prop("required",!1),r.find("."+t).removeClass("hide").find(".shipping-method-required-field").prop("required",!0)}),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-enable",function(){var i=e(this).is(":checked");e(this).closest(".wc-wizard-service-item").find(".shipping-method-required-field").prop("required",i)}),e(".activate-jetpack").on("click",".button-primary",function(e){if(i(),"no"===wc_setup_params.pending_jetpack_install)return!0;e.preventDefault(),t()}),e(".wc-wizard-services").on("change","input#stripe_create_account",function(){e(this).is(":checked")?(e(this).closest(".wc-wizard-service-settings").find("input.payment-email-input").prop("required",!0),e(this).closest(".wc-wizard-service-settings").find(".wc-wizard-service-setting-stripe_email").show()):(e(this).closest(".wc-wizard-service-settings").find("input.payment-email-input").prop("required",!1),e(this).closest(".wc-wizard-service-settings").find(".wc-wizard-service-setting-stripe_email").hide())}),e(".wc-wizard-services input#stripe_create_account").change(),e("select#store_country_state").on("change",function(){var i=this.value.split(":")[0];e("select#currency_code").val(wc_setup_currencies[i]).change()})});
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* jQuery FlexSlider v2.6.3
|
||||
* jQuery FlexSlider v2.6.1
|
||||
* Copyright 2012 WooThemes
|
||||
* Contributing Author: Tyler Smith
|
||||
*/
|
||||
|
@ -13,6 +13,11 @@
|
|||
var slider = $(el);
|
||||
|
||||
// making variables public
|
||||
|
||||
//if rtl value was not passed and html is in rtl..enable it by default.
|
||||
if(typeof options.rtl=='undefined' && $('html').attr('dir')=='rtl'){
|
||||
options.rtl=true;
|
||||
}
|
||||
slider.vars = $.extend({}, $.flexslider.defaults, options);
|
||||
|
||||
var namespace = slider.vars.namespace,
|
||||
|
@ -49,7 +54,7 @@
|
|||
slider.syncExists = $(slider.vars.sync).length > 0;
|
||||
// SLIDE:
|
||||
if (slider.vars.animation === "slide") { slider.vars.animation = "swing"; }
|
||||
slider.prop = (vertical) ? "top" : "marginLeft";
|
||||
slider.prop = (vertical) ? "top" : ( slider.vars.rtl ? "marginRight" : "marginLeft" );
|
||||
slider.args = {};
|
||||
// SLIDESHOW:
|
||||
slider.manualPause = false;
|
||||
|
@ -101,8 +106,14 @@
|
|||
$(document).bind('keyup', function(event) {
|
||||
var keycode = event.keyCode;
|
||||
if (!slider.animating && (keycode === 39 || keycode === 37)) {
|
||||
var target = (keycode === 39) ? slider.getTarget('next') :
|
||||
(keycode === 37) ? slider.getTarget('prev') : false;
|
||||
var target = (slider.vars.rtl?
|
||||
((keycode === 37) ? slider.getTarget('next') :
|
||||
(keycode === 39) ? slider.getTarget('prev') : false)
|
||||
:
|
||||
((keycode === 39) ? slider.getTarget('next') :
|
||||
(keycode === 37) ? slider.getTarget('prev') : false)
|
||||
)
|
||||
;
|
||||
slider.flexAnimate(target, slider.vars.pauseOnAction);
|
||||
}
|
||||
});
|
||||
|
@ -165,8 +176,15 @@
|
|||
e.preventDefault();
|
||||
var $slide = $(this),
|
||||
target = $slide.index();
|
||||
var posFromLeft = $slide.offset().left - $(slider).scrollLeft(); // Find position of slide relative to left of slider container
|
||||
if( posFromLeft <= 0 && $slide.hasClass( namespace + 'active-slide' ) ) {
|
||||
var posFromX;
|
||||
if(slider.vars.rtl){
|
||||
posFromX = -1*($slide.offset().right - $(slider).scrollLeft()); // Find position of slide relative to right of slider container
|
||||
}
|
||||
else
|
||||
{
|
||||
posFromX = $slide.offset().left - $(slider).scrollLeft(); // Find position of slide relative to left of slider container
|
||||
}
|
||||
if( posFromX <= 0 && $slide.hasClass( namespace + 'active-slide' ) ) {
|
||||
slider.flexAnimate(slider.getTarget("prev"), true);
|
||||
} else if (!$(slider.vars.asNavFor).data('flexslider').animating && !$slide.hasClass(namespace + "active-slide")) {
|
||||
slider.direction = (slider.currentItem < target) ? "next" : "prev";
|
||||
|
@ -428,7 +446,6 @@
|
|||
(reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth : (slider.currentSlide + slider.cloneOffset) * cwidth;
|
||||
startX = (vertical) ? localY : localX;
|
||||
startY = (vertical) ? localX : localY;
|
||||
|
||||
el.addEventListener('touchmove', onTouchMove, false);
|
||||
el.addEventListener('touchend', onTouchEnd, false);
|
||||
}
|
||||
|
@ -440,9 +457,8 @@
|
|||
localX = e.touches[0].pageX;
|
||||
localY = e.touches[0].pageY;
|
||||
|
||||
dx = (vertical) ? startX - localY : startX - localX;
|
||||
dx = (vertical) ? startX - localY : (slider.vars.rtl?-1:1)*(startX - localX);
|
||||
scrolling = (vertical) ? (Math.abs(dx) < Math.abs(localX - startY)) : (Math.abs(dx) < Math.abs(localY - startY));
|
||||
|
||||
var fxms = 500;
|
||||
|
||||
if ( ! scrolling || Number( new Date() ) - startT > fxms ) {
|
||||
|
@ -519,7 +535,7 @@
|
|||
|
||||
//Accumulate translations.
|
||||
accDx = accDx + ((vertical) ? transY : transX);
|
||||
dx = accDx;
|
||||
dx = (slider.vars.rtl?-1:1)*accDx;
|
||||
scrolling = (vertical) ? (Math.abs(accDx) < Math.abs(-transX)) : (Math.abs(accDx) < Math.abs(-transY));
|
||||
|
||||
if(e.detail === e.MSGESTURE_FLAG_INERTIA){
|
||||
|
@ -776,8 +792,12 @@
|
|||
}
|
||||
} else { // FADE:
|
||||
if (!touch) {
|
||||
//slider.slides.eq(slider.currentSlide).fadeOut(slider.vars.animationSpeed, slider.vars.easing);
|
||||
//slider.slides.eq(target).fadeIn(slider.vars.animationSpeed, slider.vars.easing, slider.wrapup);
|
||||
|
||||
slider.slides.eq(slider.currentSlide).css({"zIndex": 1}).animate({"opacity": 0}, slider.vars.animationSpeed, slider.vars.easing);
|
||||
slider.slides.eq(target).css({"zIndex": 2}).animate({"opacity": 1}, slider.vars.animationSpeed, slider.vars.easing, slider.wrapup);
|
||||
|
||||
} else {
|
||||
slider.slides.eq(slider.currentSlide).css({ "opacity": 0, "zIndex": 1 });
|
||||
slider.slides.eq(target).css({ "opacity": 1, "zIndex": 2 });
|
||||
|
@ -878,7 +898,7 @@
|
|||
}());
|
||||
|
||||
if (slider.transitions) {
|
||||
target = (vertical) ? "translate3d(0," + target + ",0)" : "translate3d(" + target + ",0,0)";
|
||||
target = (vertical) ? "translate3d(0," + target + ",0)" : "translate3d(" + ((slider.vars.rtl?-1:1)*parseInt(target)+'px') + ",0,0)";
|
||||
dur = (dur !== undefined) ? (dur/1000) + "s" : "0s";
|
||||
slider.container.css("-" + slider.pfx + "-transition-duration", dur);
|
||||
slider.container.css("transition-duration", dur);
|
||||
|
@ -933,13 +953,23 @@
|
|||
slider.setProps(sliderOffset * slider.computedW, "init");
|
||||
setTimeout(function(){
|
||||
slider.doMath();
|
||||
slider.newSlides.css({"width": slider.computedW, "marginRight" : slider.computedM, "float": "left", "display": "block"});
|
||||
if(slider.vars.rtl){
|
||||
slider.newSlides.css({"width": slider.computedW, "marginLeft" : slider.computedM, "float": "right", "display": "block"});
|
||||
}
|
||||
else{
|
||||
slider.newSlides.css({"width": slider.computedW, "marginRight" : slider.computedM, "float": "left", "display": "block"});
|
||||
}
|
||||
// SMOOTH HEIGHT:
|
||||
if (slider.vars.smoothHeight) { methods.smoothHeight(); }
|
||||
}, (type === "init") ? 100 : 0);
|
||||
}
|
||||
} else { // FADE:
|
||||
slider.slides.css({"width": "100%", "float": "left", "marginRight": "-100%", "position": "relative"});
|
||||
if(slider.vars.rtl){
|
||||
slider.slides.css({"width": "100%", "float": 'right', "marginLeft": "-100%", "position": "relative"});
|
||||
}
|
||||
else{
|
||||
slider.slides.css({"width": "100%", "float": 'left', "marginRight": "-100%", "position": "relative"});
|
||||
}
|
||||
if (type === "init") {
|
||||
if (!touch) {
|
||||
//slider.slides.eq(slider.currentSlide).fadeIn(slider.vars.animationSpeed, slider.vars.easing);
|
||||
|
@ -1154,7 +1184,8 @@
|
|||
end: function(){}, //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
|
||||
added: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is added
|
||||
removed: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is removed
|
||||
init: function() {} //{NEW} Callback: function(slider) - Fires after the slider is initially setup
|
||||
init: function() {}, //{NEW} Callback: function(slider) - Fires after the slider is initially setup
|
||||
rtl: false //{NEW} Boolean: Whether or not to enable RTL mode
|
||||
};
|
||||
|
||||
//FlexSlider: Plugin Function
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -9,7 +9,7 @@ jQuery( function( $ ) {
|
|||
* AddToCartHandler class.
|
||||
*/
|
||||
var AddToCartHandler = function() {
|
||||
$( document )
|
||||
$( document.body )
|
||||
.on( 'click', '.add_to_cart_button', this.onAddToCart )
|
||||
.on( 'click', '.remove_from_cart_button', this.onRemoveFromCart )
|
||||
.on( 'added_to_cart', this.updateButton )
|
||||
|
|
|
@ -1 +1 @@
|
|||
jQuery(function(t){if("undefined"==typeof wc_add_to_cart_params)return!1;var a=function(){t(document).on("click",".add_to_cart_button",this.onAddToCart).on("click",".remove_from_cart_button",this.onRemoveFromCart).on("added_to_cart",this.updateButton).on("added_to_cart",this.updateCartPage).on("added_to_cart removed_from_cart",this.updateFragments)};a.prototype.onAddToCart=function(a){var o=t(this);if(o.is(".ajax_add_to_cart")){if(!o.attr("data-product_id"))return!0;a.preventDefault(),o.removeClass("added"),o.addClass("loading");var r={};t.each(o.data(),function(t,a){r[t]=a}),t(document.body).trigger("adding_to_cart",[o,r]),t.post(wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart"),r,function(a){a&&(a.error&&a.product_url?window.location=a.product_url:"yes"!==wc_add_to_cart_params.cart_redirect_after_add?t(document.body).trigger("added_to_cart",[a.fragments,a.cart_hash,o]):window.location=wc_add_to_cart_params.cart_url)})}},a.prototype.onRemoveFromCart=function(a){var o=t(this),r=o.closest(".woocommerce-mini-cart-item");a.preventDefault(),r.block({message:null,overlayCSS:{opacity:.6}}),t.post(wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","remove_from_cart"),{cart_item_key:o.data("cart_item_key")},function(a){a&&a.fragments?t(document.body).trigger("removed_from_cart",[a.fragments,a.cart_hash]):window.location=o.attr("href")}).fail(function(){window.location=o.attr("href")})},a.prototype.updateButton=function(a,o,r,e){(e=void 0!==e&&e)&&(e.removeClass("loading"),e.addClass("added"),wc_add_to_cart_params.is_cart||0!==e.parent().find(".added_to_cart").length||e.after(' <a href="'+wc_add_to_cart_params.cart_url+'" class="added_to_cart wc-forward" title="'+wc_add_to_cart_params.i18n_view_cart+'">'+wc_add_to_cart_params.i18n_view_cart+"</a>"),t(document.body).trigger("wc_cart_button_updated",[e]))},a.prototype.updateCartPage=function(){var a=window.location.toString().replace("add-to-cart","added-to-cart");t(".shop_table.cart").load(a+" .shop_table.cart:eq(0) > *",function(){t(".shop_table.cart").stop(!0).css("opacity","1").unblock(),t(document.body).trigger("cart_page_refreshed")}),t(".cart_totals").load(a+" .cart_totals:eq(0) > *",function(){t(".cart_totals").stop(!0).css("opacity","1").unblock(),t(document.body).trigger("cart_totals_refreshed")})},a.prototype.updateFragments=function(a,o){o&&(t.each(o,function(a){t(a).addClass("updating").fadeTo("400","0.6").block({message:null,overlayCSS:{opacity:.6}})}),t.each(o,function(a,o){t(a).replaceWith(o),t(a).stop(!0).css("opacity","1").unblock()}),t(document.body).trigger("wc_fragments_loaded"))},new a});
|
||||
jQuery(function(t){if("undefined"==typeof wc_add_to_cart_params)return!1;var a=function(){t(document.body).on("click",".add_to_cart_button",this.onAddToCart).on("click",".remove_from_cart_button",this.onRemoveFromCart).on("added_to_cart",this.updateButton).on("added_to_cart",this.updateCartPage).on("added_to_cart removed_from_cart",this.updateFragments)};a.prototype.onAddToCart=function(a){var o=t(this);if(o.is(".ajax_add_to_cart")){if(!o.attr("data-product_id"))return!0;a.preventDefault(),o.removeClass("added"),o.addClass("loading");var r={};t.each(o.data(),function(t,a){r[t]=a}),t(document.body).trigger("adding_to_cart",[o,r]),t.post(wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart"),r,function(a){a&&(a.error&&a.product_url?window.location=a.product_url:"yes"!==wc_add_to_cart_params.cart_redirect_after_add?t(document.body).trigger("added_to_cart",[a.fragments,a.cart_hash,o]):window.location=wc_add_to_cart_params.cart_url)})}},a.prototype.onRemoveFromCart=function(a){var o=t(this),r=o.closest(".woocommerce-mini-cart-item");a.preventDefault(),r.block({message:null,overlayCSS:{opacity:.6}}),t.post(wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","remove_from_cart"),{cart_item_key:o.data("cart_item_key")},function(a){a&&a.fragments?t(document.body).trigger("removed_from_cart",[a.fragments,a.cart_hash]):window.location=o.attr("href")}).fail(function(){window.location=o.attr("href")})},a.prototype.updateButton=function(a,o,r,e){(e=void 0!==e&&e)&&(e.removeClass("loading"),e.addClass("added"),wc_add_to_cart_params.is_cart||0!==e.parent().find(".added_to_cart").length||e.after(' <a href="'+wc_add_to_cart_params.cart_url+'" class="added_to_cart wc-forward" title="'+wc_add_to_cart_params.i18n_view_cart+'">'+wc_add_to_cart_params.i18n_view_cart+"</a>"),t(document.body).trigger("wc_cart_button_updated",[e]))},a.prototype.updateCartPage=function(){var a=window.location.toString().replace("add-to-cart","added-to-cart");t(".shop_table.cart").load(a+" .shop_table.cart:eq(0) > *",function(){t(".shop_table.cart").stop(!0).css("opacity","1").unblock(),t(document.body).trigger("cart_page_refreshed")}),t(".cart_totals").load(a+" .cart_totals:eq(0) > *",function(){t(".cart_totals").stop(!0).css("opacity","1").unblock(),t(document.body).trigger("cart_totals_refreshed")})},a.prototype.updateFragments=function(a,o){o&&(t.each(o,function(a){t(a).addClass("updating").fadeTo("400","0.6").block({message:null,overlayCSS:{opacity:.6}})}),t.each(o,function(a,o){t(a).replaceWith(o),t(a).stop(!0).css("opacity","1").unblock()}),t(document.body).trigger("wc_fragments_loaded"))},new a});
|
|
@ -11,8 +11,10 @@ jQuery( function( $ ) {
|
|||
|
||||
function field_is_required( field, is_required ) {
|
||||
if ( is_required ) {
|
||||
field.find( 'label' ).append( ' <abbr class="required" title="' + wc_address_i18n_params.i18n_required_text + '">*</abbr>' );
|
||||
field.addClass( 'validate-required' );
|
||||
if ( field.find( 'label abbr.required' ).length === 0 ) {
|
||||
field.find( 'label' ).append( ' <abbr class="required" title="' + wc_address_i18n_params.i18n_required_text + '">*</abbr>' );
|
||||
field.addClass( 'validate-required' );
|
||||
}
|
||||
} else {
|
||||
field.find( 'label abbr' ).remove();
|
||||
field.removeClass( 'validate-required' );
|
||||
|
@ -46,86 +48,46 @@ jQuery( function( $ ) {
|
|||
|
||||
$.each( locale_fields, function( key, value ) {
|
||||
|
||||
var field = thisform.find( value );
|
||||
var field = thisform.find( value ),
|
||||
fieldLocale = $.extend( true, {}, locale['default'][ key ], thislocale[ key ] );
|
||||
|
||||
// Set to defaults.
|
||||
if ( locale['default'][ key ] ) {
|
||||
if ( 'state' !== key ) {
|
||||
if ( typeof locale['default'][ key ].hidden === 'undefined' || locale['default'][ key ].hidden === false ) {
|
||||
field.show();
|
||||
} else if ( locale['default'][ key ].hidden === true ) {
|
||||
field.hide().find( 'input' ).val( '' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( 'postcode' === key || 'city' === key || 'state' === key ) {
|
||||
if ( locale['default'][ key ].label ) {
|
||||
field.find( 'label' ).html( locale['default'][ key ].label );
|
||||
}
|
||||
|
||||
if ( locale['default'][ key ].placeholder ) {
|
||||
field.find( 'input' ).attr( 'placeholder', locale['default'][ key ].placeholder );
|
||||
|
||||
// Use the label as a placeholder if there is no label element and no placeholder.
|
||||
} else if ( locale['default'][ key ].label && ! field.find( 'label' ).length ) {
|
||||
field.find( 'input' ).attr( 'placeholder', locale['default'][ key ].label );
|
||||
field.find( '.select2-selection__placeholder' ).text( locale['default'][ key ].label );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( locale['default'][ key ].required === true ) {
|
||||
if ( field.find( 'label abbr' ).length === 0 ) {
|
||||
field_is_required( field, true );
|
||||
}
|
||||
}
|
||||
|
||||
if ( locale['default'][ key ].priority ) {
|
||||
field.data( 'priority', locale['default'][ key ].priority );
|
||||
}
|
||||
// Labels.
|
||||
if ( typeof fieldLocale.label !== 'undefined' ) {
|
||||
field.find( 'label' ).html( fieldLocale.label );
|
||||
}
|
||||
|
||||
// Set to locale.
|
||||
if ( thislocale[ key ] ) {
|
||||
// Placeholders.
|
||||
if ( typeof fieldLocale.placeholder !== 'undefined' ) {
|
||||
field.find( 'input' ).attr( 'placeholder', fieldLocale.placeholder );
|
||||
field.find( '.select2-selection__placeholder' ).text( fieldLocale.placeholder );
|
||||
}
|
||||
|
||||
if ( thislocale[ key ].label ) {
|
||||
field.find( 'label' ).html( thislocale[ key ].label );
|
||||
}
|
||||
|
||||
if ( thislocale[ key ].placeholder ) {
|
||||
field.find( 'input' ).attr( 'placeholder', thislocale[ key ].placeholder );
|
||||
field.find( '.select2-selection__placeholder' ).text( thislocale[ key ].placeholder );
|
||||
|
||||
// Use the i18n label as a placeholder if there is no label element and no i18n placeholder.
|
||||
} else if ( thislocale[ key ].label && ! field.find( 'label' ).length ) {
|
||||
field.find( 'input' ).attr( 'placeholder', thislocale[ key ].label );
|
||||
field.find( '.select2-selection__placeholder' ).text( thislocale[ key ].label );
|
||||
}
|
||||
// Use the i18n label as a placeholder if there is no label element and no i18n placeholder.
|
||||
if ( typeof fieldLocale.placeholder === 'undefined' && typeof fieldLocale.label !== 'undefined' && ! field.find( 'label' ).length ) {
|
||||
field.find( 'input' ).attr( 'placeholder', fieldLocale.label );
|
||||
field.find( '.select2-selection__placeholder' ).text( fieldLocale.label );
|
||||
}
|
||||
|
||||
// Required.
|
||||
if ( typeof fieldLocale.required !== 'undefined' ) {
|
||||
field_is_required( field, fieldLocale.required );
|
||||
} else {
|
||||
field_is_required( field, false );
|
||||
|
||||
if ( typeof thislocale[ key ].required === 'undefined' && locale['default'][ key ].required === true ) {
|
||||
field_is_required( field, true );
|
||||
} else if ( thislocale[ key ].required === true ) {
|
||||
field_is_required( field, true );
|
||||
}
|
||||
|
||||
if ( key !== 'state' ) {
|
||||
if ( thislocale[ key ].hidden === true ) {
|
||||
field.hide().find( 'input' ).val( '' );
|
||||
} else {
|
||||
field.show();
|
||||
}
|
||||
}
|
||||
|
||||
if ( thislocale[ key ].priority ) {
|
||||
field.data( 'priority', thislocale[ key ].priority );
|
||||
} else if ( locale['default'][ key ].priority ) {
|
||||
field.data( 'priority', locale['default'][ key ].priority );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Priority.
|
||||
if ( typeof fieldLocale.priority !== 'undefined' ) {
|
||||
field.data( 'priority', fieldLocale.priority );
|
||||
}
|
||||
|
||||
// Hidden fields.
|
||||
if ( 'state' !== key ) {
|
||||
if ( typeof fieldLocale.hidden !== 'undefined' && true === fieldLocale.hidden ) {
|
||||
field.hide().find( 'input' ).val( '' );
|
||||
} else {
|
||||
field.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var fieldsets = $('.woocommerce-billing-fields__field-wrapper, .woocommerce-shipping-fields__field-wrapper, .woocommerce-address-fields__field-wrapper, .woocommerce-additional-fields__field-wrapper .woocommerce-account-fields');
|
||||
|
|
|
@ -1 +1 @@
|
|||
jQuery(function(e){function a(e,a){a?(e.find("label").append(' <abbr class="required" title="'+wc_address_i18n_params.i18n_required_text+'">*</abbr>'),e.addClass("validate-required")):(e.find("label abbr").remove(),e.removeClass("validate-required"))}if("undefined"==typeof wc_address_i18n_params)return!1;var t=wc_address_i18n_params.locale.replace(/"/g,'"'),i=e.parseJSON(t);e(document.body).bind("country_to_state_changing",function(t,l,d){var r,n=d;r="undefined"!=typeof i[l]?i[l]:i["default"];var o=n.find("#billing_postcode_field, #shipping_postcode_field"),f=n.find("#billing_city_field, #shipping_city_field"),s=n.find("#billing_state_field, #shipping_state_field");o.attr("data-o_class")||(o.attr("data-o_class",o.attr("class")),f.attr("data-o_class",f.attr("class")),s.attr("data-o_class",s.attr("class")));var p=e.parseJSON(wc_address_i18n_params.locale_fields);e.each(p,function(e,t){var l=n.find(t);i["default"][e]&&("state"!==e&&("undefined"==typeof i["default"][e].hidden||!1===i["default"][e].hidden?l.show():!0===i["default"][e].hidden&&l.hide().find("input").val("")),"postcode"!==e&&"city"!==e&&"state"!==e||(i["default"][e].label&&l.find("label").html(i["default"][e].label),i["default"][e].placeholder?l.find("input").attr("placeholder",i["default"][e].placeholder):i["default"][e].label&&!l.find("label").length&&(l.find("input").attr("placeholder",i["default"][e].label),l.find(".select2-selection__placeholder").text(i["default"][e].label))),!0===i["default"][e].required&&0===l.find("label abbr").length&&a(l,!0),i["default"][e].priority&&l.data("priority",i["default"][e].priority)),r[e]&&(r[e].label&&l.find("label").html(r[e].label),r[e].placeholder?(l.find("input").attr("placeholder",r[e].placeholder),l.find(".select2-selection__placeholder").text(r[e].placeholder)):r[e].label&&!l.find("label").length&&(l.find("input").attr("placeholder",r[e].label),l.find(".select2-selection__placeholder").text(r[e].label)),a(l,!1),"undefined"==typeof r[e].required&&!0===i["default"][e].required?a(l,!0):!0===r[e].required&&a(l,!0),"state"!==e&&(!0===r[e].hidden?l.hide().find("input").val(""):l.show()),r[e].priority?l.data("priority",r[e].priority):i["default"][e].priority&&l.data("priority",i["default"][e].priority))}),e(".woocommerce-billing-fields__field-wrapper, .woocommerce-shipping-fields__field-wrapper, .woocommerce-address-fields__field-wrapper, .woocommerce-additional-fields__field-wrapper .woocommerce-account-fields").each(function(a,t){var i=e(t).find(".form-row"),l=i.first().parent(),d=0;i.each(function(){e(this).data("priority")||e(this).data("priority",d+1),d=e(this).data("priority")}),i.sort(function(a,t){var i=e(a).data("priority"),l=e(t).data("priority");return i>l?1:i<l?-1:0}),i.detach().appendTo(l)})})});
|
||||
jQuery(function(e){function a(e,a){a?0===e.find("label abbr.required").length&&(e.find("label").append(' <abbr class="required" title="'+wc_address_i18n_params.i18n_required_text+'">*</abbr>'),e.addClass("validate-required")):(e.find("label abbr").remove(),e.removeClass("validate-required"))}if("undefined"==typeof wc_address_i18n_params)return!1;var i=wc_address_i18n_params.locale.replace(/"/g,'"'),d=e.parseJSON(i);e(document.body).bind("country_to_state_changing",function(i,t,r){var l,n=r;l="undefined"!=typeof d[t]?d[t]:d["default"];var o=n.find("#billing_postcode_field, #shipping_postcode_field"),s=n.find("#billing_city_field, #shipping_city_field"),f=n.find("#billing_state_field, #shipping_state_field");o.attr("data-o_class")||(o.attr("data-o_class",o.attr("class")),s.attr("data-o_class",s.attr("class")),f.attr("data-o_class",f.attr("class")));var p=e.parseJSON(wc_address_i18n_params.locale_fields);e.each(p,function(i,t){var r=n.find(t),o=e.extend(!0,{},d["default"][i],l[i]);"undefined"!=typeof o.label&&r.find("label").html(o.label),"undefined"!=typeof o.placeholder&&(r.find("input").attr("placeholder",o.placeholder),r.find(".select2-selection__placeholder").text(o.placeholder)),"undefined"!=typeof o.placeholder||"undefined"==typeof o.label||r.find("label").length||(r.find("input").attr("placeholder",o.label),r.find(".select2-selection__placeholder").text(o.label)),"undefined"!=typeof o.required?a(r,o.required):a(r,!1),"undefined"!=typeof o.priority&&r.data("priority",o.priority),"state"!==i&&("undefined"!=typeof o.hidden&&!0===o.hidden?r.hide().find("input").val(""):r.show())}),e(".woocommerce-billing-fields__field-wrapper, .woocommerce-shipping-fields__field-wrapper, .woocommerce-address-fields__field-wrapper, .woocommerce-additional-fields__field-wrapper .woocommerce-account-fields").each(function(a,i){var d=e(i).find(".form-row"),t=d.first().parent(),r=0;d.each(function(){e(this).data("priority")||e(this).data("priority",r+1),r=e(this).data("priority")}),d.sort(function(a,i){var d=e(a).data("priority"),t=e(i).data("priority");return d>t?1:d<t?-1:0}),d.detach().appendTo(t)})})});
|
|
@ -1,6 +1,6 @@
|
|||
/* global wp, pwsL10n, wc_password_strength_meter_params */
|
||||
jQuery( function( $ ) {
|
||||
|
||||
( function( $ ) {
|
||||
'use strict';
|
||||
/**
|
||||
* Password Strength Meter class.
|
||||
*/
|
||||
|
@ -106,4 +106,4 @@ jQuery( function( $ ) {
|
|||
};
|
||||
|
||||
wc_password_strength_meter.init();
|
||||
});
|
||||
})( jQuery );
|
||||
|
|
|
@ -1 +1 @@
|
|||
jQuery(function(s){var r={init:function(){s(document.body).on("keyup change","form.register #reg_password, form.checkout #account_password, form.edit-account #password_1, form.lost_reset_password #password_1",this.strengthMeter),s("form.checkout #createaccount").change()},strengthMeter:function(){var e=s("form.register, form.checkout, form.edit-account, form.lost_reset_password"),t=s('input[type="submit"]',e),a=s("#reg_password, #account_password, #password_1",e),o=1,d=a.val();r.includeMeter(e,a),o=r.checkPasswordStrength(e,a),d.length>0&&o<wc_password_strength_meter_params.min_password_strength&&!e.is("form.checkout")?t.attr("disabled","disabled").addClass("disabled"):t.removeAttr("disabled","disabled").removeClass("disabled")},includeMeter:function(r,e){var t=r.find(".woocommerce-password-strength");""===e.val()?(t.remove(),s(document.body).trigger("wc-password-strength-removed")):0===t.length&&(e.after('<div class="woocommerce-password-strength" aria-live="polite"></div>'),s(document.body).trigger("wc-password-strength-added"))},checkPasswordStrength:function(s,r){var e=s.find(".woocommerce-password-strength"),t=s.find(".woocommerce-password-hint"),a='<small class="woocommerce-password-hint">'+wc_password_strength_meter_params.i18n_password_hint+"</small>",o=wp.passwordStrength.meter(r.val(),wp.passwordStrength.userInputBlacklist()),d="";switch(e.removeClass("short bad good strong"),t.remove(),o<wc_password_strength_meter_params.min_password_strength&&(d=" - "+wc_password_strength_meter_params.i18n_password_error),o){case 0:e.addClass("short").html(pwsL10n["short"]+d),e.after(a);break;case 1:case 2:e.addClass("bad").html(pwsL10n.bad+d),e.after(a);break;case 3:e.addClass("good").html(pwsL10n.good+d);break;case 4:e.addClass("strong").html(pwsL10n.strong+d);break;case 5:e.addClass("short").html(pwsL10n.mismatch)}return o}};r.init()});
|
||||
!function(s){"use strict";var r={init:function(){s(document.body).on("keyup change","form.register #reg_password, form.checkout #account_password, form.edit-account #password_1, form.lost_reset_password #password_1",this.strengthMeter),s("form.checkout #createaccount").change()},strengthMeter:function(){var e=s("form.register, form.checkout, form.edit-account, form.lost_reset_password"),t=s('input[type="submit"]',e),a=s("#reg_password, #account_password, #password_1",e),o=1,d=a.val();r.includeMeter(e,a),o=r.checkPasswordStrength(e,a),d.length>0&&o<wc_password_strength_meter_params.min_password_strength&&!e.is("form.checkout")?t.attr("disabled","disabled").addClass("disabled"):t.removeAttr("disabled","disabled").removeClass("disabled")},includeMeter:function(r,e){var t=r.find(".woocommerce-password-strength");""===e.val()?(t.remove(),s(document.body).trigger("wc-password-strength-removed")):0===t.length&&(e.after('<div class="woocommerce-password-strength" aria-live="polite"></div>'),s(document.body).trigger("wc-password-strength-added"))},checkPasswordStrength:function(s,r){var e=s.find(".woocommerce-password-strength"),t=s.find(".woocommerce-password-hint"),a='<small class="woocommerce-password-hint">'+wc_password_strength_meter_params.i18n_password_hint+"</small>",o=wp.passwordStrength.meter(r.val(),wp.passwordStrength.userInputBlacklist()),d="";switch(e.removeClass("short bad good strong"),t.remove(),o<wc_password_strength_meter_params.min_password_strength&&(d=" - "+wc_password_strength_meter_params.i18n_password_error),o){case 0:e.addClass("short").html(pwsL10n["short"]+d),e.after(a);break;case 1:case 2:e.addClass("bad").html(pwsL10n.bad+d),e.after(a);break;case 3:e.addClass("good").html(pwsL10n.good+d);break;case 4:e.addClass("strong").html(pwsL10n.strong+d);break;case 5:e.addClass("short").html(pwsL10n.mismatch)}return o}};r.init()}(jQuery);
|
|
@ -183,6 +183,10 @@ jQuery( function( $ ) {
|
|||
* Init zoom.
|
||||
*/
|
||||
ProductGallery.prototype.initZoomForTarget = function( zoomTarget ) {
|
||||
if ( ! this.zoom_enabled ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var galleryWidth = this.$target.width(),
|
||||
zoomEnabled = false;
|
||||
|
||||
|
@ -265,10 +269,10 @@ jQuery( function( $ ) {
|
|||
eventTarget = $( e.target ),
|
||||
clicked;
|
||||
|
||||
if ( ! eventTarget.is( '.woocommerce-product-gallery__trigger' ) ) {
|
||||
clicked = eventTarget.closest( '.woocommerce-product-gallery__image' );
|
||||
} else {
|
||||
if ( eventTarget.is( '.woocommerce-product-gallery__trigger' ) || eventTarget.is( '.woocommerce-product-gallery__trigger img' ) ) {
|
||||
clicked = this.$target.find( '.flex-active-slide' );
|
||||
} else {
|
||||
clicked = eventTarget.closest( '.woocommerce-product-gallery__image' );
|
||||
}
|
||||
|
||||
var options = $.extend( {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* SelectWoo 5.0.0
|
||||
* SelectWoo 1.0.1
|
||||
* https://github.com/woocommerce/selectWoo
|
||||
*
|
||||
* Released under the MIT license
|
||||
|
@ -1694,6 +1694,7 @@ S2.define('select2/selection/multiple',[
|
|||
};
|
||||
|
||||
MultipleSelection.prototype.update = function (data) {
|
||||
var self = this;
|
||||
this.clear();
|
||||
|
||||
if (data.length === 0) {
|
||||
|
@ -1719,6 +1720,14 @@ S2.define('select2/selection/multiple',[
|
|||
var $rendered = this.$selection.find('.select2-selection__rendered');
|
||||
|
||||
Utils.appendMany($rendered, $selections);
|
||||
|
||||
// Return cursor to search field after updating.
|
||||
// Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
|
||||
if ('undefined' !== typeof this.$search) {
|
||||
setTimeout(function(){
|
||||
self.$search.focus();
|
||||
}, 1);
|
||||
}
|
||||
};
|
||||
|
||||
return MultipleSelection;
|
||||
|
@ -3524,6 +3533,7 @@ S2.define('select2/data/ajax',[
|
|||
}
|
||||
|
||||
callback(results);
|
||||
self.container.focusOnActiveElement();
|
||||
}, function () {
|
||||
// Attempt to detect if a request was aborted
|
||||
// Only works if the transport exposes a status property
|
||||
|
@ -5416,7 +5426,7 @@ S2.define('select2/core',[
|
|||
// Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
|
||||
setTimeout(function(){
|
||||
self.focusOnActiveElement();
|
||||
},1);
|
||||
}, 1);
|
||||
});
|
||||
|
||||
$(document).on('keydown', function (evt) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* SelectWoo 5.0.0
|
||||
* SelectWoo 1.0.1
|
||||
* https://github.com/woocommerce/selectWoo
|
||||
*
|
||||
* Released under the MIT license
|
||||
|
@ -1694,6 +1694,7 @@ S2.define('select2/selection/multiple',[
|
|||
};
|
||||
|
||||
MultipleSelection.prototype.update = function (data) {
|
||||
var self = this;
|
||||
this.clear();
|
||||
|
||||
if (data.length === 0) {
|
||||
|
@ -1719,6 +1720,14 @@ S2.define('select2/selection/multiple',[
|
|||
var $rendered = this.$selection.find('.select2-selection__rendered');
|
||||
|
||||
Utils.appendMany($rendered, $selections);
|
||||
|
||||
// Return cursor to search field after updating.
|
||||
// Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
|
||||
if ('undefined' !== typeof this.$search) {
|
||||
setTimeout(function(){
|
||||
self.$search.focus();
|
||||
}, 1);
|
||||
}
|
||||
};
|
||||
|
||||
return MultipleSelection;
|
||||
|
@ -3524,6 +3533,7 @@ S2.define('select2/data/ajax',[
|
|||
}
|
||||
|
||||
callback(results);
|
||||
self.container.focusOnActiveElement();
|
||||
}, function () {
|
||||
// Attempt to detect if a request was aborted
|
||||
// Only works if the transport exposes a status property
|
||||
|
@ -5416,7 +5426,7 @@ S2.define('select2/core',[
|
|||
// Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
|
||||
setTimeout(function(){
|
||||
self.focusOnActiveElement();
|
||||
},1);
|
||||
}, 1);
|
||||
});
|
||||
|
||||
$(document).on('keydown', function (evt) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -9,7 +9,7 @@
|
|||
},
|
||||
"require-dev": {
|
||||
"squizlabs/php_codesniffer": "*",
|
||||
"wp-coding-standards/wpcs": "0.10.0",
|
||||
"wp-coding-standards/wpcs": "0.13.1",
|
||||
"phpunit/phpunit": "6.2.3",
|
||||
"woocommerce/woocommerce-git-hooks": "1.0.2"
|
||||
},
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "c92d229f60735fd8c40ef05495816677",
|
||||
"content-hash": "5268174ad56d2293f14e24b931afeb63",
|
||||
"packages": [
|
||||
{
|
||||
"name": "composer/installers",
|
||||
|
@ -1486,64 +1486,37 @@
|
|||
},
|
||||
{
|
||||
"name": "squizlabs/php_codesniffer",
|
||||
"version": "2.9.1",
|
||||
"version": "3.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
|
||||
"reference": "dcbed1074f8244661eecddfc2a675430d8d33f62"
|
||||
"reference": "d667e245d5dcd4d7bf80f26f2c947d476b66213e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62",
|
||||
"reference": "dcbed1074f8244661eecddfc2a675430d8d33f62",
|
||||
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d667e245d5dcd4d7bf80f26f2c947d476b66213e",
|
||||
"reference": "d667e245d5dcd4d7bf80f26f2c947d476b66213e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-simplexml": "*",
|
||||
"ext-tokenizer": "*",
|
||||
"ext-xmlwriter": "*",
|
||||
"php": ">=5.1.2"
|
||||
"php": ">=5.4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.0"
|
||||
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0"
|
||||
},
|
||||
"bin": [
|
||||
"scripts/phpcs",
|
||||
"scripts/phpcbf"
|
||||
"bin/phpcs",
|
||||
"bin/phpcbf"
|
||||
],
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.x-dev"
|
||||
"dev-master": "3.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"CodeSniffer.php",
|
||||
"CodeSniffer/CLI.php",
|
||||
"CodeSniffer/Exception.php",
|
||||
"CodeSniffer/File.php",
|
||||
"CodeSniffer/Fixer.php",
|
||||
"CodeSniffer/Report.php",
|
||||
"CodeSniffer/Reporting.php",
|
||||
"CodeSniffer/Sniff.php",
|
||||
"CodeSniffer/Tokens.php",
|
||||
"CodeSniffer/Reports/",
|
||||
"CodeSniffer/Tokenizers/",
|
||||
"CodeSniffer/DocGenerators/",
|
||||
"CodeSniffer/Standards/AbstractPatternSniff.php",
|
||||
"CodeSniffer/Standards/AbstractScopeSniff.php",
|
||||
"CodeSniffer/Standards/AbstractVariableSniff.php",
|
||||
"CodeSniffer/Standards/IncorrectPatternException.php",
|
||||
"CodeSniffer/Standards/Generic/Sniffs/",
|
||||
"CodeSniffer/Standards/MySource/Sniffs/",
|
||||
"CodeSniffer/Standards/PEAR/Sniffs/",
|
||||
"CodeSniffer/Standards/PSR1/Sniffs/",
|
||||
"CodeSniffer/Standards/PSR2/Sniffs/",
|
||||
"CodeSniffer/Standards/Squiz/Sniffs/",
|
||||
"CodeSniffer/Standards/Zend/Sniffs/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
|
@ -1560,7 +1533,7 @@
|
|||
"phpcs",
|
||||
"standards"
|
||||
],
|
||||
"time": "2017-05-22T02:43:20+00:00"
|
||||
"time": "2017-10-16T22:40:25+00:00"
|
||||
},
|
||||
{
|
||||
"name": "theseer/tokenizer",
|
||||
|
@ -1687,22 +1660,26 @@
|
|||
},
|
||||
{
|
||||
"name": "wp-coding-standards/wpcs",
|
||||
"version": "0.10.0",
|
||||
"version": "0.13.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git",
|
||||
"reference": "b39490465f6fd7375743a395019cd597e12119c9"
|
||||
"reference": "1f64b1a0b5b789822d0303436ee4e30e0135e4dc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/b39490465f6fd7375743a395019cd597e12119c9",
|
||||
"reference": "b39490465f6fd7375743a395019cd597e12119c9",
|
||||
"url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/1f64b1a0b5b789822d0303436ee4e30e0135e4dc",
|
||||
"reference": "1f64b1a0b5b789822d0303436ee4e30e0135e4dc",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"squizlabs/php_codesniffer": "^2.6"
|
||||
"php": ">=5.3",
|
||||
"squizlabs/php_codesniffer": "^2.9.0 || ^3.0.2"
|
||||
},
|
||||
"type": "library",
|
||||
"suggest": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.1"
|
||||
},
|
||||
"type": "phpcodesniffer-standard",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
|
@ -1719,7 +1696,7 @@
|
|||
"standards",
|
||||
"wordpress"
|
||||
],
|
||||
"time": "2016-08-29T20:04:47+00:00"
|
||||
"time": "2017-08-05T16:08:58+00:00"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
Type,SKU,Name,Published,Is featured?,Visibility in catalog,Short description,Description,Date sale price starts,Date sale price ends,Tax class,In stock?,Stock,Backorders allowed?,Sold individually?,Weight (kg),Length (cm),Width (cm),Height (cm),Allow customer reviews?,Purchase note,Sale price,Regular price,Categories,Tags,Shipping class,Images,Download limit,Download expiry days,Parent,Grouped products,Upsells,Cross-sells,External URL,Button text,Download 1 name,Download 1 URL,Attribute 1 name,Attribute 1 value(s),Attribute 1 visible,Attribute 1 global,Attribute 2 name,Attribute 2 value(s),Attribute 2 visible,Attribute 2 global,Attribute 1 default,Attribute 2 default
|
||||
"simple, downloadable, virtual",WOO-SINGLE-2,Woo Single #2,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,2,3,"Music, Music > Singles",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_6_angle.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_6_flat.jpg",10,90,,,,,,,Song #2,https://woocommerce.files.wordpress.com/2017/06/woo-single-2.ogg,,,,,,,,,,
|
||||
"simple, downloadable, virtual",WOO-SINGLE-1,Woo Single #1,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,3,"Music, Music > Singles",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_flat.jpg",-1,-1,,,,,,,Song #1,https://woocommerce.files.wordpress.com/2017/06/woo-single-1.ogg,,,,,,,,,,
|
||||
grouped,WOO-SINGLES,Woo Singles,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,,"Music, Music > Singles",,,http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_6_flat.jpg,,,,"WOO-SINGLE-1,WOO-SINGLE-2","WOO-ALBUM-1,WOO-ALBUM-2",WOO-ALBUM-3,,,,,,,,,,,,,,
|
||||
"simple, virtual",WOO-ALBUM-4,Woo Album #4,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,9,"Music > Albums, Music",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_5_angle.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_5_flat.jpg",,,,,,,,,,,,,,,,,,,,
|
||||
"simple, virtual",WOO-ALBUM-3,Woo Album #3,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,9,"Music > Albums, Music",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_3_angle.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_3_flat.jpg",,,,,,,,,,,,,,,,,,,,
|
||||
"simple, virtual",WOO-ALBUM-2,Woo Album #2,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,9,"Music > Albums, Music",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_2_angle.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_2_flat.jpg",,,,,,,,,,,,,,,,,,,,
|
||||
"simple, virtual",WOO-ALBUM-1,Woo Album #1,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,9,"Music > Albums, Music",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_1_angle.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_1_flat.jpg",,,,,,,,,,,,,,,,,,,,
|
||||
simple,POSTER-WOO-LOGO,Woo Logo,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,15,Posters,,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/poster_5_up.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/Poster_5_flat.jpg",,,,,,"T-SHIRT-WOO-LOGO,HOODIE-WOO-LOGO",,,,,,,,,,,,,,
|
||||
simple,POSTER-WOO-NINJA,Woo Ninja,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,15,Posters,,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/poster_4_up.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/Poster_4_flat.jpg",,,,,,"T-SHIRT-WOO-NINJA,HOODIE-WOO-NINJA",,,,,,,,,,,,,,
|
||||
simple,POSTER-PREMIUM-QUALITY,Premium Quality,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,12,15,Posters,,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/poster_3_up.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/Poster_3_flat.jpg",,,,,T-SHIRT-PREMIUM-QUALITY,,,,,,,,,,,,,,,
|
||||
simple,POSTER-FLYING-NINJA,Flying Ninja,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,12,15,Posters,,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/poster_2_up.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/Poster_2_flat.jpg",,,,,,,,,,,,,,,,,,,,
|
||||
simple,POSTER-SHIP-YOUR-IDEA,Ship Your Idea,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,15,Posters,,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/poster_1_up.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/Poster_1_flat.jpg",,,,,"T-SHIRT-SHIP-YOUR-IDEA,HOODIE-SHIP-YOUR-IDEA","T-SHIRT-SHIP-YOUR-IDEA,HOODIE-SHIP-YOUR-IDEA",,,,,,,,,,,,,,
|
||||
simple,HOODIE-WOO-LOGO,Woo Logo,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,35,"Clothing, Clothing > Hoodies",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_6_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_6_back.jpg",,,,,,T-SHIRT-WOO-LOGO,,,,,,,,,,,,,,
|
||||
external,HOODIE-NINJA-SILHOUETTE,Ninja Silhouette,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,0,,,30,"Clothing, Clothing > Hoodies",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_5_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_5_back.jpg",,,,,,T-SHIRT-NINJA-SILHOUETTE,https://mercantile.wordpress.org/product/wordpress-logo-black-zip-hoodie/,Buy on WordPress Swag Store,,,,,,,,,,,,
|
||||
simple,HOODIE-HAPPY-NINJA,Happy Ninja,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,35,"Clothing, Clothing > Hoodies",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_4_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_4_back.jpg",,,,,,T-SHIRT-HAPPY-NINJA,,,,,,,,,,,,,,
|
||||
simple,HOODIE-PATIENT-NINJA,Patient Ninja,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,35,"Clothing, Clothing > Hoodies",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_3_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_3_back.jpg",,,,,,HOODIE-HAPPY-NINJA,,,,,,,,,,,,,,
|
||||
simple,HOODIE-WOO-NINJA,Woo Ninja,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,35,"Clothing, Clothing > Hoodies",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_2_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_2_back.jpg",,,,,,T-SHIRT-WOO-NINJA,,,,,,,,,,,,,,
|
||||
variable,HOODIE-SHIP-YOUR-IDEA,Ship Your Idea,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,30,"Clothing, Clothing > Hoodies",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_7_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_7_back.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_1_back.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_1_front.jpg",,,,,,T-SHIRT-SHIP-YOUR-IDEA,,,,,Color,"Black, Blue",0,1,Size,"L, XL",1,0,Black,L
|
||||
variation,HOODIE-SHIP-YOUR-IDEA-BLUE-XL,"Ship Your Idea - Blue, XL",1,0,visible,,,,,taxable,1,,0,0,,,,,1,,30,35,,,,http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_1_front.jpg,,,HOODIE-SHIP-YOUR-IDEA,,,T-SHIRT-SHIP-YOUR-IDEA,,,,,Color,Blue,,1,Size,XL,,0,,
|
||||
variation,HOODIE-SHIP-YOUR-IDEA-BLACK-L,"Ship Your Idea - Black, L",1,0,visible,,,,,taxable,1,,0,0,,,,,1,,,35,,,,http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_7_front.jpg,,,HOODIE-SHIP-YOUR-IDEA,,,T-SHIRT-SHIP-YOUR-IDEA,,,,,Color,Black,,1,Size,L,,0,,
|
||||
simple,T-SHIRT-HAPPY-NINJA,Happy Ninja,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,18,"Clothing, Clothing > T-shirts",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_7_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_7_back.jpg",,,,,HOODIE-HAPPY-NINJA,"T-SHIRT-WOO-NINJA,T-SHIRT-NINJA-SILHOUETTE",,,,,,,,,,,,,,
|
||||
simple,T-SHIRT-WOO-NINJA,Woo Ninja,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,20,"Clothing, Clothing > T-shirts",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_6_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_6_back.jpg",,,,,HOODIE-WOO-NINJA,"T-SHIRT-HAPPY-NINJA,T-SHIRT-NINJA-SILHOUETTE",,,,,,,,,,,,,,
|
||||
simple,T-SHIRT-NINJA-SILHOUETTE,Ninja Silhouette,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,20,"Clothing, Clothing > T-shirts",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_5_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_5_back.jpg",,,,,HOODIE-NINJA-SILHOUETTE,"T-SHIRT-WOO-NINJA,T-SHIRT-HAPPY-NINJA",,,,,,,,,,,,,,
|
||||
variable,T-SHIRT-SHIP-YOUR-IDEA,Ship Your Idea,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,20,"Clothing, Clothing > T-shirts",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front1.jpg",,,,,HOODIE-SHIP-YOUR-IDEA,,,,,,Color,"Black, Green",0,1,,,,,,
|
||||
variation,T-SHIRT-SHIP-YOUR-IDEA-GREEN,Ship Your Idea - Green,1,0,visible,,,,,taxable,1,,0,0,,,,,1,,,20,,,,http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg,,,T-SHIRT-SHIP-YOUR-IDEA,,,,,,,,Color,Green,,1,,,,,,
|
||||
variation,T-SHIRT-SHIP-YOUR-IDEA-BLACK,Ship Your Idea - Black,1,0,visible,,,,,taxable,1,,0,0,,,,,1,,,20,,,,http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front1.jpg,,,T-SHIRT-SHIP-YOUR-IDEA,,,,,,,,Color,Black,,1,,,,,,
|
||||
simple,T-SHIRT-PREMIUM-QUALITY,Premium Quality,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,20,"Clothing, Clothing > T-shirts",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",,,,,,,,,,,,,,,,,,,,
|
||||
simple,T-SHIRT-WOO-LOGO,Woo Logo,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,5,0,0,,,,,1,,18,20,"Clothing, Clothing > T-shirts",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_1_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_1_back.jpg",,,,,HOODIE-WOO-LOGO,,,,,,,,,,,,,,,
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,21 @@
|
|||
ID,Type,SKU,Name,Published,Is featured?,Visibility in catalog,Short description,Description,Date sale price starts,Date sale price ends,Tax status,Tax class,In stock?,Stock,Backorders allowed?,Sold individually?,Weight (kg),Length (cm),Width (cm),Height (cm),Allow customer reviews?,Purchase note,Sale price,Regular price,Categories,Tags,Shipping class,Images,Download limit,Download expiry days,Parent,Grouped products,Upsells,Cross-sells,External URL,Button text,Attribute 1 name,Attribute 1 value(s),Attribute 1 visible,Attribute 1 global
|
||||
,simple,woo-beanie,Beanie,1,0,visible,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,18,20,Accessories,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/beanie.jpg,,,,,,,,,Color,Red,1,1
|
||||
,simple,woo-belt,Belt,1,0,visible,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,55,65,Accessories,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/belt.jpg,,,,,,,,,,,,
|
||||
,simple,woo-cap,Cap,1,1,visible,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,16,18,Accessories,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/cap.jpg,,,,,,,,,Color,Yellow,1,1
|
||||
,simple,woo-sunglasses,Sunglasses,1,1,visible,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,,90,Accessories,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/sunglasses.jpg,,,,,,,,,,,,
|
||||
,simple,woo-hoodie-with-logo,Hoodie with Logo,1,0,visible,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,,45,Hoodies,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/hoodie-with-logo.jpg,,,,,,,,,Color,Blue,1,1
|
||||
,simple,woo-hoodie-with-pocket,Hoodie with Pocket,1,1,hidden,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,35,45,Hoodies,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/hoodie-with-pocket.jpg,,,,,,,,,Color,Gray,1,1
|
||||
,simple,woo-hoodie-with-zipper,Hoodie with Zipper,1,1,visible,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,,45,Hoodies,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/hoodie-with-zipper.jpg,,,,,,,,,,,,
|
||||
,variable,woo-hoodie,Hoodie,1,0,visible,This is a variable product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,42,45,Hoodies,,,"https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/hoodie.jpg, https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/05/hoodie-blue.jpg, https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/05/hoodie-green.jpg",,,,,,,,,Color,"Blue, Green, Red",1,1
|
||||
,simple,woo-long-sleeve-tee,Long Sleeve Tee,1,0,visible,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,,25,T-Shirts,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/long-sleeve-tee.jpg,,,,,,,,,Color,Green,1,1
|
||||
,simple,woo-polo,Polo,1,0,visible,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,,20,T-Shirts,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/polo.jpg,,,,,,,,,Color,Blue,1,1
|
||||
,simple,woo-tshirt,T-Shirt,1,0,visible,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,,18,T-Shirts,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/tshirt.jpg,,,,,,,,,Color,Gray,1,1
|
||||
,variable,woo-vneck-tee,V-Neck T-Shirt,1,1,visible,This is a variable product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,,18,T-Shirts,,,"https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/vneck-tee.jpg, https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/vnech-tee-green.jpg, https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/vnech-tee-blue.jpg",,,,,,,,,Color,"Blue, Green, Red",1,1
|
||||
,"simple, downloadable, virtual",woo-album,Album,1,0,visible,"This is a simple, virtual product.","Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.",,,taxable,,1,,0,0,,,,,1,,,15,Music,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/album.jpg,-1,-1,,,,,,,,,,
|
||||
,"simple, downloadable, virtual",woo-single,Single,1,0,visible,"This is a simple, virtual product.","Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.",,,taxable,,1,,0,0,,,,,1,,2,3,Music,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/single.jpg,-1,-1,,,,,,,,,,
|
||||
,variation,woo-vneck-tee-red,V-Neck T-Shirt - Red,1,0,visible,This is a product variation.,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.",,,taxable,,1,,0,0,,,,,0,,,20,,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/vneck-tee.jpg,,,woo-vneck-tee,,,,,,Color,Red,,1
|
||||
,variation,woo-vneck-tee-green,V-Neck T-Shirt - Green,1,0,visible,This is a product variation.,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.",,,taxable,,1,,0,0,,,,,0,,,20,,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/vnech-tee-green.jpg,,,woo-vneck-tee,,,,,,Color,Green,,1
|
||||
,variation,woo-vneck-tee-blue,V-Neck T-Shirt - Blue,1,0,visible,This is a product variation.,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.",,,taxable,,1,,0,0,,,,,0,,,15,,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/vnech-tee-blue.jpg,,,woo-vneck-tee,,,,,,Color,Blue,,1
|
||||
,variation,woo-hoodie-red,Hoodie - Red,1,0,visible,This is a product variation.,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.",,,taxable,,1,,0,0,,,,,0,,42,45,,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/hoodie.jpg,,,woo-hoodie,,,,,,Color,Red,,1
|
||||
,variation,woo-hoodie-green,Hoodie - Green,1,0,visible,This is a product variation.,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.",,,taxable,,1,,0,0,,,,,0,,,45,,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/05/hoodie-green.jpg,,,woo-hoodie,,,,,,Color,Green,,1
|
||||
,variation,woo-hoodie-blue,Hoodie - Blue,1,0,visible,This is a product variation.,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.",,,taxable,,1,,0,0,,,,,0,,,45,,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/05/hoodie-blue.jpg,,,woo-hoodie,,,,,,Color,Blue,,1
|
|
File diff suppressed because it is too large
Load Diff
|
@ -142,7 +142,7 @@ abstract class WC_Data {
|
|||
foreach ( $this->meta_data as $array_key => $meta ) {
|
||||
$this->meta_data[ $array_key ] = clone $meta;
|
||||
if ( ! empty( $meta->id ) ) {
|
||||
unset( $this->meta_data[ $array_key ]->id );
|
||||
$this->meta_data[ $array_key ]->id = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -270,17 +270,25 @@ abstract class WC_Data {
|
|||
* Check if the key is an internal one.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @param string $key
|
||||
* @param string $key Key to check.
|
||||
* @return bool true if it's an internal key, false otherwise
|
||||
*/
|
||||
protected function is_internal_meta_key( $key ) {
|
||||
if ( $this->data_store && ! empty( $key ) && in_array( $key, $this->data_store->get_internal_meta_keys() ) ) {
|
||||
wc_doing_it_wrong( __FUNCTION__, sprintf( __( 'Generic add/update/get meta methods should not be used for internal meta data, including "%s". Use getters and setters.', 'woocommerce' ), $key ), '3.2.0' );
|
||||
$internal_meta_key = ! empty( $key ) && $this->data_store && in_array( $key, $this->data_store->get_internal_meta_keys() );
|
||||
|
||||
return true;
|
||||
if ( ! $internal_meta_key ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
$has_setter_or_getter = is_callable( array( $this, 'set_' . $key ) ) || is_callable( array( $this, 'get_' . $key ) );
|
||||
|
||||
if ( ! $has_setter_or_getter ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
wc_doing_it_wrong( __FUNCTION__, sprintf( __( 'Generic add/update/get meta methods should not be used for internal meta data, including "%s". Use getters and setters.', 'woocommerce' ), $key ), '3.2.0' );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -112,7 +112,7 @@ class WC_Admin_Assets {
|
|||
wp_register_script( 'wc-shipping-classes', WC()->plugin_url() . '/assets/js/admin/wc-shipping-classes' . $suffix . '.js', array( 'jquery', 'wp-util', 'underscore', 'backbone' ), WC_VERSION );
|
||||
wp_register_script( 'wc-clipboard', WC()->plugin_url() . '/assets/js/admin/wc-clipboard' . $suffix . '.js', array( 'jquery' ), WC_VERSION );
|
||||
wp_register_script( 'select2', WC()->plugin_url() . '/assets/js/select2/select2.full' . $suffix . '.js', array( 'jquery' ), '4.0.3' );
|
||||
wp_register_script( 'selectWoo', WC()->plugin_url() . '/assets/js/selectWoo/selectWoo.full' . $suffix . '.js', array( 'jquery' ), '1.0.0' );
|
||||
wp_register_script( 'selectWoo', WC()->plugin_url() . '/assets/js/selectWoo/selectWoo.full' . $suffix . '.js', array( 'jquery' ), '1.0.1' );
|
||||
wp_register_script( 'wc-enhanced-select', WC()->plugin_url() . '/assets/js/admin/wc-enhanced-select' . $suffix . '.js', array( 'jquery', 'selectWoo' ), WC_VERSION );
|
||||
wp_localize_script( 'wc-enhanced-select', 'wc_enhanced_select_params', array(
|
||||
'i18n_no_matches' => _x( 'No matches found', 'enhanced select', 'woocommerce' ),
|
||||
|
|
|
@ -235,12 +235,12 @@ class WC_Admin_Notices {
|
|||
$theme_file = false;
|
||||
if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {
|
||||
$theme_file = get_stylesheet_directory() . '/' . $file;
|
||||
} elseif ( file_exists( get_stylesheet_directory() . '/woocommerce/' . $file ) ) {
|
||||
$theme_file = get_stylesheet_directory() . '/woocommerce/' . $file;
|
||||
} elseif ( file_exists( get_stylesheet_directory() . '/' . WC()->template_path() . $file ) ) {
|
||||
$theme_file = get_stylesheet_directory() . '/' . WC()->template_path() . $file;
|
||||
} elseif ( file_exists( get_template_directory() . '/' . $file ) ) {
|
||||
$theme_file = get_template_directory() . '/' . $file;
|
||||
} elseif ( file_exists( get_template_directory() . '/woocommerce/' . $file ) ) {
|
||||
$theme_file = get_template_directory() . '/woocommerce/' . $file;
|
||||
} elseif ( file_exists( get_template_directory() . '/' . WC()->template_path() . $file ) ) {
|
||||
$theme_file = get_template_directory() . '/' . WC()->template_path() . $file;
|
||||
}
|
||||
|
||||
if ( false !== $theme_file ) {
|
||||
|
|
|
@ -194,7 +194,7 @@ class WC_Admin_Permalink_Settings {
|
|||
$product_base = '/' . _x( 'product', 'slug', 'woocommerce' ) . $product_base;
|
||||
}
|
||||
} elseif ( empty( $product_base ) ) {
|
||||
$product_base = false;
|
||||
$product_base = _x( 'product', 'slug', 'woocommerce' );
|
||||
}
|
||||
|
||||
$permalinks['product_base'] = wc_sanitize_permalink( $product_base );
|
||||
|
|
|
@ -176,7 +176,7 @@ class WC_Admin_Post_Types {
|
|||
'<strong>' . date_i18n( __( 'M j, Y @ G:i', 'woocommerce' ), strtotime( $post->post_date ) ) . '</strong>'
|
||||
),
|
||||
10 => __( 'Order draft updated.', 'woocommerce' ),
|
||||
11 => __( 'Order updated and sent to the customer.', 'woocommerce' ),
|
||||
11 => __( 'Order updated and sent.', 'woocommerce' ),
|
||||
);
|
||||
|
||||
$messages['shop_coupon'] = array(
|
||||
|
|
|
@ -276,7 +276,9 @@ class WC_Admin_Setup_Wizard {
|
|||
*/
|
||||
public function setup_wizard_content() {
|
||||
echo '<div class="wc-setup-content">';
|
||||
call_user_func( $this->steps[ $this->step ]['view'], $this );
|
||||
if ( ! empty( $this->steps[ $this->step ]['view'] ) ) {
|
||||
call_user_func( $this->steps[ $this->step ]['view'], $this );
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
|
@ -302,6 +304,9 @@ class WC_Admin_Setup_Wizard {
|
|||
$state = '*';
|
||||
}
|
||||
|
||||
$locale_info = include( WC()->plugin_path() . '/i18n/locale-info.php' );
|
||||
$currency_by_country = wp_list_pluck( $locale_info, 'currency_code' );
|
||||
|
||||
?>
|
||||
<form method="post" class="address-step">
|
||||
<?php wp_nonce_field( 'wc-setup' ); ?>
|
||||
|
@ -389,6 +394,9 @@ class WC_Admin_Setup_Wizard {
|
|||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<script type="text/javascript">
|
||||
var wc_setup_currencies = <?php echo json_encode( $currency_by_country ); ?>;
|
||||
</script>
|
||||
|
||||
<label class="location-prompt" for="product_type">
|
||||
<?php esc_html_e( 'What type of product do you plan to sell?', 'woocommerce' ); ?>
|
||||
|
@ -467,56 +475,6 @@ class WC_Admin_Setup_Wizard {
|
|||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tout WooCommerce Services for North American stores.
|
||||
*/
|
||||
protected function wc_setup_wcs_tout() {
|
||||
$base_location = wc_get_base_location();
|
||||
|
||||
if ( false === $base_location['country'] ) {
|
||||
$base_location = WC_Geolocation::geolocate_ip();
|
||||
}
|
||||
|
||||
if ( ! in_array( $base_location['country'], array( 'US', 'CA' ), true ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$default_content = array(
|
||||
'title' => __( 'Enable WooCommerce Shipping (recommended)', 'woocommerce' ),
|
||||
'description' => __( 'Print labels and get discounted USPS shipping rates, right from your WooCommerce dashboard. Powered by WooCommerce Services.', 'woocommerce' ),
|
||||
);
|
||||
|
||||
switch ( $base_location['country'] ) {
|
||||
case 'CA':
|
||||
$local_content = array(
|
||||
'title' => __( 'Enable WooCommerce Shipping (recommended)', 'woocommerce' ),
|
||||
'description' => __( 'Display live rates from Canada Post at checkout to make shipping a breeze. Powered by WooCommerce Services.', 'woocommerce' ),
|
||||
);
|
||||
break;
|
||||
default:
|
||||
$local_content = array();
|
||||
}
|
||||
|
||||
$content = wp_parse_args( $local_content, $default_content );
|
||||
?>
|
||||
<ul class="wc-wizard-shipping-methods">
|
||||
<li class="wc-wizard-shipping">
|
||||
<div class="wc-wizard-shipping-enable">
|
||||
<input type="checkbox" name="woocommerce_install_services" class="input-checkbox" value="woo-services-enabled" checked />
|
||||
<label>
|
||||
<?php echo esc_html( $content['title'] ) ?>
|
||||
</label>
|
||||
</div>
|
||||
<div class="wc-wizard-shipping-description">
|
||||
<p>
|
||||
<?php echo esc_html( $content['description'] ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Finishes replying to the client, but keeps the process running for further (async) code execution.
|
||||
* @see https://core.trac.wordpress.org/ticket/41358
|
||||
|
@ -636,14 +594,15 @@ class WC_Admin_Setup_Wizard {
|
|||
*
|
||||
* Can also be used to determine if WCS supports a given country.
|
||||
*
|
||||
* @param $country_code
|
||||
* @param string $country_code
|
||||
* @param string $currency_code
|
||||
* @return bool|string Carrier name if supported, boolean False otherwise.
|
||||
*/
|
||||
protected function get_wcs_shipping_carrier( $country_code ) {
|
||||
switch ( $country_code ) {
|
||||
case 'US':
|
||||
protected function get_wcs_shipping_carrier( $country_code, $currency_code ) {
|
||||
switch ( array( $country_code, $currency_code ) ) {
|
||||
case array( 'US', 'USD' ):
|
||||
return 'USPS';
|
||||
case 'CA':
|
||||
case array( 'CA', 'CAD' ):
|
||||
return 'Canada Post';
|
||||
default:
|
||||
return false;
|
||||
|
@ -653,14 +612,15 @@ class WC_Admin_Setup_Wizard {
|
|||
/**
|
||||
* Get shipping methods based on country code.
|
||||
*
|
||||
* @param $country_code
|
||||
* @param string $country_code
|
||||
* @param string $currency_code
|
||||
* @return array
|
||||
*/
|
||||
protected function get_wizard_shipping_methods( $country_code ) {
|
||||
protected function get_wizard_shipping_methods( $country_code, $currency_code ) {
|
||||
$shipping_methods = array(
|
||||
'live_rates' => array(
|
||||
'name' => __( 'Live Rates', 'woocommerce' ),
|
||||
'description' => __( 'Shipping rates updated in realtime. Powered by Jetpack.', 'woocommerce' ),
|
||||
'description' => __( 'WooCommerce Services and Jetpack will be installed and activated for you.', 'woocommerce' ),
|
||||
),
|
||||
'flat_rate' => array(
|
||||
'name' => __( 'Flat Rate', 'woocommerce' ),
|
||||
|
@ -680,7 +640,7 @@ class WC_Admin_Setup_Wizard {
|
|||
),
|
||||
);
|
||||
|
||||
$live_rate_carrier = $this->get_wcs_shipping_carrier( $country_code );
|
||||
$live_rate_carrier = $this->get_wcs_shipping_carrier( $country_code, $currency_code );
|
||||
|
||||
if ( false === $live_rate_carrier || ! current_user_can('install_plugins') ) {
|
||||
unset( $shipping_methods['live_rates'] );
|
||||
|
@ -693,12 +653,13 @@ class WC_Admin_Setup_Wizard {
|
|||
* Render the available shipping methods for a given country code.
|
||||
*
|
||||
* @param string $country_code
|
||||
* @param string $currency_code
|
||||
* @param string $input_prefix
|
||||
*/
|
||||
protected function shipping_method_selection_form( $country_code, $input_prefix ) {
|
||||
$live_rate_carrier = $this->get_wcs_shipping_carrier( $country_code );
|
||||
protected function shipping_method_selection_form( $country_code, $currency_code, $input_prefix ) {
|
||||
$live_rate_carrier = $this->get_wcs_shipping_carrier( $country_code, $currency_code );
|
||||
$selected = $live_rate_carrier ? 'live_rates' : 'flat_rate';
|
||||
$shipping_methods = $this->get_wizard_shipping_methods( $country_code );
|
||||
$shipping_methods = $this->get_wizard_shipping_methods( $country_code, $currency_code );
|
||||
?>
|
||||
<div class="wc-wizard-shipping-method-select">
|
||||
<div class="wc-wizard-shipping-method-dropdown">
|
||||
|
@ -752,7 +713,8 @@ class WC_Admin_Setup_Wizard {
|
|||
$country_code = WC()->countries->get_base_country();
|
||||
$country_name = WC()->countries->countries[ $country_code ];
|
||||
$prefixed_country_name = WC()->countries->estimated_for_prefix( $country_code ) . $country_name;
|
||||
$wcs_carrier = $this->get_wcs_shipping_carrier( $country_code );
|
||||
$currency_code = get_woocommerce_currency();
|
||||
$wcs_carrier = $this->get_wcs_shipping_carrier( $country_code, $currency_code );
|
||||
$existing_zones = WC_Shipping_Zones::get_zones();
|
||||
|
||||
if ( false === $dimension_unit || false === $weight_unit ) {
|
||||
|
@ -770,7 +732,7 @@ class WC_Admin_Setup_Wizard {
|
|||
} elseif ( $wcs_carrier ) {
|
||||
$intro_text = sprintf(
|
||||
/* translators: %1$s: country name including the 'the' prefix, %2$s: shipping carrier name */
|
||||
__( "You're all set up to ship anywhere in %1\$s, and outside of it. We recommend using live rates to get accurate %2\$s shipping prices to cover the cost of order fulfillment.", 'woocommerce' ),
|
||||
__( "You're all set up to ship anywhere in %1\$s, and outside of it. We recommend using <strong>live rates</strong> (which are powered by our WooCommerce Services plugin and Jetpack) to get accurate %2\$s shipping prices to cover the cost of order fulfillment.", 'woocommerce' ),
|
||||
$prefixed_country_name,
|
||||
$wcs_carrier
|
||||
);
|
||||
|
@ -784,7 +746,7 @@ class WC_Admin_Setup_Wizard {
|
|||
|
||||
?>
|
||||
<h1><?php esc_html_e( 'Shipping', 'woocommerce' ); ?></h1>
|
||||
<p><?php echo esc_html( $intro_text ); ?></p>
|
||||
<p><?php echo wp_kses_post( $intro_text ); ?></p>
|
||||
<form method="post">
|
||||
<?php if ( empty( $existing_zones ) ) : ?>
|
||||
<ul class="wc-wizard-services shipping">
|
||||
|
@ -801,7 +763,7 @@ class WC_Admin_Setup_Wizard {
|
|||
<p><?php echo esc_html( $country_name ); ?></p>
|
||||
</div>
|
||||
<div class="wc-wizard-service-description">
|
||||
<?php $this->shipping_method_selection_form( $country_code, 'shipping_zones[domestic]' ); ?>
|
||||
<?php $this->shipping_method_selection_form( $country_code, $currency_code, 'shipping_zones[domestic]' ); ?>
|
||||
</div>
|
||||
<div class="wc-wizard-service-enable">
|
||||
<span class="wc-wizard-service-toggle">
|
||||
|
@ -815,7 +777,7 @@ class WC_Admin_Setup_Wizard {
|
|||
<p><?php echo esc_html_e( 'Locations not covered by your other zones', 'woocommerce' ); ?></p>
|
||||
</div>
|
||||
<div class="wc-wizard-service-description">
|
||||
<?php $this->shipping_method_selection_form( $country_code, 'shipping_zones[intl]' ); ?>
|
||||
<?php $this->shipping_method_selection_form( $country_code, $currency_code, 'shipping_zones[intl]' ); ?>
|
||||
</div>
|
||||
<div class="wc-wizard-service-enable">
|
||||
<span class="wc-wizard-service-toggle">
|
||||
|
@ -1031,8 +993,8 @@ class WC_Admin_Setup_Wizard {
|
|||
$user_email = $this->get_current_user_email();
|
||||
|
||||
$stripe_description = '<p>' . sprintf(
|
||||
__( 'Accept all major debit & credit cards from customers in 135+ countries on your site. <a href="%s" target="_blank">Learn more</a>.', 'woocommerce' ),
|
||||
'https://wordpress.org/plugins/woocommerce-gateway-stripe/'
|
||||
__( 'Accept debit and credit cards in 135+ currencies, methods such as Alipay, and one-touch checkout with Apple Pay. <a href="%s" target="_blank">Learn more</a>.', 'woocommerce' ),
|
||||
'https://woocommerce.com/products/stripe/'
|
||||
) . '</p>';
|
||||
$paypal_bt_description = '<p>' . sprintf(
|
||||
__( 'Safe and secure payments using credit cards or your customer\'s PayPal account. <a href="%s" target="_blank">Learn more</a>.', 'woocommerce' ),
|
||||
|
@ -1063,7 +1025,7 @@ class WC_Admin_Setup_Wizard {
|
|||
'type' => 'email',
|
||||
'value' => $user_email,
|
||||
'placeholder' => __( 'Stripe email address', 'woocommerce' ),
|
||||
'description' => __( "Enter your email address and we'll create an account for you. Powered by WooCommerce Services.", 'woocommerce' ),
|
||||
'description' => __( "Enter your email address and we'll handle account creation. WooCommerce Services and Jetpack will be installed and activated for you.", 'woocommerce' ),
|
||||
'required' => true,
|
||||
),
|
||||
),
|
||||
|
@ -1374,9 +1336,14 @@ class WC_Admin_Setup_Wizard {
|
|||
<ul class="wc-wizard-services featured">
|
||||
<li class="wc-wizard-service-item <?php echo get_option( 'woocommerce_setup_automated_taxes' ) ? 'checked' : ''; ?>">
|
||||
<div class="wc-wizard-service-description">
|
||||
<h3><?php esc_html_e( 'Automated Taxes', 'woocommerce' ); ?></h3>
|
||||
<h3><?php esc_html_e( 'Automated Taxes (powered by WooCommerce Services)', 'woocommerce' ); ?></h3>
|
||||
<p>
|
||||
<?php esc_html_e( 'We’ll automatically calculate and charge the correct rate of tax for each time a customer checks out. Powered by WooCommerce Services.', 'woocommerce' ); ?>
|
||||
<?php esc_html_e( 'Automatically calculate and charge the correct rate of tax for each time a customer checks out. If toggled on, WooCommerce Services and Jetpack will be installed and activated for you.', 'woocommerce' ); ?>
|
||||
</p>
|
||||
<p class="wc-wizard-service-learn-more">
|
||||
<a href="<?php echo esc_url( 'https://wordpress.org/plugins/woocommerce-services/' ); ?>" target="_blank">
|
||||
<?php esc_html_e( 'Learn more about WooCommerce Services', 'woocommerce' ); ?>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
@ -1615,10 +1582,12 @@ class WC_Admin_Setup_Wizard {
|
|||
exit;
|
||||
}
|
||||
|
||||
$redirect_url = site_url( add_query_arg( array(
|
||||
$redirect_url = esc_url_raw( add_query_arg( array(
|
||||
'page' => 'wc-setup',
|
||||
'step' => 'activate',
|
||||
'from' => 'wpcom',
|
||||
'activate_error' => false,
|
||||
) ) );
|
||||
), admin_url() ) );
|
||||
$connection_url = Jetpack::init()->build_connect_url( true, $redirect_url, 'woocommerce-setup-wizard' );
|
||||
|
||||
wp_redirect( esc_url_raw( $connection_url ) );
|
||||
|
|
|
@ -379,6 +379,22 @@ class WC_Product_CSV_Importer_Controller {
|
|||
include_once( dirname( __FILE__ ) . '/views/html-csv-import-done.php' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Columns to normalize.
|
||||
*
|
||||
* @param array $columns List of columns names and keys.
|
||||
* @return array
|
||||
*/
|
||||
protected function normalize_columns_names( $columns ) {
|
||||
$normalized = array();
|
||||
|
||||
foreach ( $columns as $key => $value ) {
|
||||
$normalized[ strtolower( $key ) ] = $value;
|
||||
}
|
||||
|
||||
return $normalized;
|
||||
}
|
||||
|
||||
/**
|
||||
* Auto map column names.
|
||||
*
|
||||
|
@ -395,8 +411,9 @@ class WC_Product_CSV_Importer_Controller {
|
|||
/**
|
||||
* @hooked wc_importer_generic_mappings - 10
|
||||
* @hooked wc_importer_wordpress_mappings - 10
|
||||
* @hooked wc_importer_default_english_mappings - 100
|
||||
*/
|
||||
$default_columns = apply_filters( 'woocommerce_csv_product_import_mapping_default_columns', array(
|
||||
$default_columns = $this->normalize_columns_names( apply_filters( 'woocommerce_csv_product_import_mapping_default_columns', array(
|
||||
__( 'ID', 'woocommerce' ) => 'id',
|
||||
__( 'Type', 'woocommerce' ) => 'type',
|
||||
__( 'SKU', 'woocommerce' ) => 'sku',
|
||||
|
@ -435,26 +452,20 @@ class WC_Product_CSV_Importer_Controller {
|
|||
__( 'External URL', 'woocommerce' ) => 'product_url',
|
||||
__( 'Button text', 'woocommerce' ) => 'button_text',
|
||||
__( 'Position', 'woocommerce' ) => 'menu_order',
|
||||
) );
|
||||
) ) );
|
||||
|
||||
// Normalize the columns so they are case-insensitive.
|
||||
$normalized_default_columns = array();
|
||||
foreach ( $default_columns as $key => $val ) {
|
||||
$normalized_default_columns[ strtolower( $key ) ] = $val;
|
||||
}
|
||||
|
||||
$special_columns = $this->get_special_columns( apply_filters( 'woocommerce_csv_product_import_mapping_special_columns',
|
||||
$special_columns = $this->get_special_columns( $this->normalize_columns_names( apply_filters( 'woocommerce_csv_product_import_mapping_special_columns',
|
||||
array(
|
||||
strtolower( __( 'Attribute %d name', 'woocommerce' ) ) => 'attributes:name',
|
||||
strtolower( __( 'Attribute %d value(s)', 'woocommerce' ) ) => 'attributes:value',
|
||||
strtolower( __( 'Attribute %d visible', 'woocommerce' ) ) => 'attributes:visible',
|
||||
strtolower( __( 'Attribute %d global', 'woocommerce' ) ) => 'attributes:taxonomy',
|
||||
strtolower( __( 'Attribute %d default', 'woocommerce' ) ) => 'attributes:default',
|
||||
strtolower( __( 'Download %d name', 'woocommerce' ) ) => 'downloads:name',
|
||||
strtolower( __( 'Download %d URL', 'woocommerce' ) ) => 'downloads:url',
|
||||
strtolower( __( 'Meta: %s', 'woocommerce' ) ) => 'meta:',
|
||||
__( 'Attribute %d name', 'woocommerce' ) => 'attributes:name',
|
||||
__( 'Attribute %d value(s)', 'woocommerce' ) => 'attributes:value',
|
||||
__( 'Attribute %d visible', 'woocommerce' ) => 'attributes:visible',
|
||||
__( 'Attribute %d global', 'woocommerce' ) => 'attributes:taxonomy',
|
||||
__( 'Attribute %d default', 'woocommerce' ) => 'attributes:default',
|
||||
__( 'Download %d name', 'woocommerce' ) => 'downloads:name',
|
||||
__( 'Download %d URL', 'woocommerce' ) => 'downloads:url',
|
||||
__( 'Meta: %s', 'woocommerce' ) => 'meta:',
|
||||
)
|
||||
) );
|
||||
) ) );
|
||||
|
||||
$headers = array();
|
||||
foreach ( $raw_headers as $key => $field ) {
|
||||
|
@ -462,8 +473,8 @@ class WC_Product_CSV_Importer_Controller {
|
|||
$index = $num_indexes ? $key : $field;
|
||||
$headers[ $index ] = $field;
|
||||
|
||||
if ( isset( $normalized_default_columns[ $field ] ) ) {
|
||||
$headers[ $index ] = $normalized_default_columns[ $field ];
|
||||
if ( isset( $default_columns[ $field ] ) ) {
|
||||
$headers[ $index ] = $default_columns[ $field ];
|
||||
} else {
|
||||
foreach ( $special_columns as $regex => $special_key ) {
|
||||
if ( preg_match( $regex, $field, $matches ) ) {
|
||||
|
|
|
@ -34,6 +34,7 @@ class WC_Meta_Box_Order_Actions {
|
|||
|
||||
$order_actions = apply_filters( 'woocommerce_order_actions', array(
|
||||
'send_order_details' => __( 'Email order details to customer', 'woocommerce' ),
|
||||
'send_order_details_admin' => __( 'Resend new order notification', 'woocommerce' ),
|
||||
'regenerate_download_permissions' => __( 'Regenerate download permissions', 'woocommerce' ),
|
||||
) );
|
||||
?>
|
||||
|
@ -81,7 +82,7 @@ class WC_Meta_Box_Order_Actions {
|
|||
* @param WP_Post $post
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
// Order data saved, now get it so we can manipulate status
|
||||
// Order data saved, now get it so we can manipulate status.
|
||||
$order = wc_get_order( $post_id );
|
||||
|
||||
// Handle button actions
|
||||
|
@ -105,6 +106,19 @@ class WC_Meta_Box_Order_Actions {
|
|||
// Change the post saved message.
|
||||
add_filter( 'redirect_post_location', array( __CLASS__, 'set_email_sent_message' ) );
|
||||
|
||||
} elseif ( 'send_order_details_admin' === $action ) {
|
||||
|
||||
do_action( 'woocommerce_before_resend_order_emails', $order, 'new_order' );
|
||||
|
||||
WC()->payment_gateways();
|
||||
WC()->shipping();
|
||||
WC()->mailer()->emails['WC_Email_New_Order']->trigger( $order->get_id(), $order );
|
||||
|
||||
do_action( 'woocommerce_after_resend_order_email', $order, 'new_order' );
|
||||
|
||||
// Change the post saved message.
|
||||
add_filter( 'redirect_post_location', array( __CLASS__, 'set_email_sent_message' ) );
|
||||
|
||||
} elseif ( 'regenerate_download_permissions' === $action ) {
|
||||
|
||||
$data_store = WC_Data_Store::load( 'customer-download' );
|
||||
|
|
|
@ -124,7 +124,32 @@ if ( wc_tax_enabled() ) {
|
|||
}
|
||||
?>
|
||||
<table class="wc-order-totals">
|
||||
<?php if ( 0 < $order->get_total_discount() ) : ?>
|
||||
<tr>
|
||||
<td class="label"><?php _e( 'Discount:', 'woocommerce' ); ?></td>
|
||||
<td width="1%"></td>
|
||||
<td class="total">
|
||||
<?php echo wc_price( $order->get_total_discount(), array( 'currency' => $order->get_currency() ) ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_admin_order_totals_after_discount', $order->get_id() ); ?>
|
||||
|
||||
<?php if ( $order->get_shipping_methods() ) : ?>
|
||||
<tr>
|
||||
<td class="label"><?php _e( 'Shipping:', 'woocommerce' ); ?></td>
|
||||
<td width="1%"></td>
|
||||
<td class="total"><?php
|
||||
if ( ( $refunded = $order->get_total_shipping_refunded() ) > 0 ) {
|
||||
echo '<del>' . strip_tags( wc_price( $order->get_shipping_total(), array( 'currency' => $order->get_currency() ) ) ) . '</del> <ins>' . wc_price( $order->get_shipping_total() - $refunded, array( 'currency' => $order->get_currency() ) ) . '</ins>';
|
||||
} else {
|
||||
echo wc_price( $order->get_shipping_total(), array( 'currency' => $order->get_currency() ) );
|
||||
}
|
||||
?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_admin_order_totals_after_shipping', $order->get_id() ); ?>
|
||||
|
||||
<?php if ( wc_tax_enabled() ) : ?>
|
||||
|
@ -146,7 +171,7 @@ if ( wc_tax_enabled() ) {
|
|||
<?php do_action( 'woocommerce_admin_order_totals_after_tax', $order->get_id() ); ?>
|
||||
|
||||
<tr>
|
||||
<td class="label"><?php _e( 'Order total', 'woocommerce' ); ?>:</td>
|
||||
<td class="label"><?php _e( 'Total', 'woocommerce' ); ?>:</td>
|
||||
<td width="1%"></td>
|
||||
<td class="total">
|
||||
<?php echo $order->get_formatted_order_total(); ?>
|
||||
|
|
|
@ -169,18 +169,27 @@ class WC_Plugin_Updates {
|
|||
/**
|
||||
* Get active plugins that have a tested version lower than the input version.
|
||||
*
|
||||
* @param string $version
|
||||
* @param string $new_version
|
||||
* @param string $release 'major' or 'minor'.
|
||||
* @return array of plugin info arrays
|
||||
*/
|
||||
public function get_untested_plugins( $version, $release ) {
|
||||
$extensions = array_merge( $this->get_plugins_with_header( self::VERSION_TESTED_HEADER ), $this->get_plugins_for_woocommerce() );
|
||||
$untested = array();
|
||||
$version_parts = explode( '.', $version );
|
||||
$version = $version_parts[0];
|
||||
public function get_untested_plugins( $new_version, $release ) {
|
||||
$extensions = array_merge( $this->get_plugins_with_header( self::VERSION_TESTED_HEADER ), $this->get_plugins_for_woocommerce() );
|
||||
$untested = array();
|
||||
$new_version_parts = explode( '.', $new_version );
|
||||
$version = $new_version_parts[0];
|
||||
|
||||
if ( 'minor' === $release ) {
|
||||
$version .= '.' . $version_parts[1];
|
||||
$version .= '.' . $new_version_parts[1];
|
||||
}
|
||||
|
||||
if ( 'major' === $release ) {
|
||||
$current_version_parts = explode( '.', WC_VERSION );
|
||||
|
||||
// If user has already moved to the major version, we don't need to flag up anything.
|
||||
if ( version_compare( $current_version_parts[0] . '.' . $current_version_parts[1], $new_version_parts[0] . '.0', '>=' ) ) {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $extensions as $file => $plugin ) {
|
||||
|
|
|
@ -46,15 +46,10 @@ class WC_Plugins_Screen_Updates extends WC_Plugin_Updates {
|
|||
$new_version_parts = explode( '.', $this->new_version );
|
||||
|
||||
// If user has already moved to the minor version, we don't need to flag up anything.
|
||||
if ( version_compare( $current_version_parts[0] . $current_version_parts[1], $new_version_parts[0] . $new_version_parts[1], '=' ) ) {
|
||||
if ( version_compare( $current_version_parts[0] . '.' . $current_version_parts[1], $new_version_parts[0] . '.' . $new_version_parts[1], '=' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If user has already moved to the major version, we should only shown minor notices and assume everything is "ok" for major.
|
||||
if ( version_compare( $current_version_parts[0] . $current_version_parts[1], $new_version_parts[0] . '0', '>=' ) ) {
|
||||
$this->major_untested_plugins = array();
|
||||
}
|
||||
|
||||
if ( ! empty( $this->major_untested_plugins ) ) {
|
||||
$this->upgrade_notice .= $this->get_extensions_inline_warning_major();
|
||||
}
|
||||
|
|
|
@ -35,14 +35,13 @@ class WC_Updates_Screen_Updates extends WC_Plugin_Updates {
|
|||
return;
|
||||
}
|
||||
|
||||
$this->new_version = wc_clean( $updateable_plugins['woocommerce/woocommerce.php']->update->new_version );
|
||||
$this->new_version = wc_clean( $updateable_plugins['woocommerce/woocommerce.php']->update->new_version );
|
||||
$this->major_untested_plugins = $this->get_untested_plugins( $this->new_version, 'major' );
|
||||
if ( empty( $this->major_untested_plugins ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
echo $this->get_extensions_modal_warning();
|
||||
$this->update_screen_modal_js();
|
||||
if ( ! empty( $this->major_untested_plugins ) ) {
|
||||
echo $this->get_extensions_modal_warning();
|
||||
$this->update_screen_modal_js();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,22 +18,24 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
);
|
||||
?></p>
|
||||
|
||||
<table class="plugin-details-table" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php esc_html_e( 'Plugin', 'woocommerce' ); ?></th>
|
||||
<th><?php esc_html_e( 'Tested up to WooCommerce version', 'woocommerce' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ( $plugins as $plugin ) : ?>
|
||||
<div class="plugin-details-table-container">
|
||||
<table class="plugin-details-table" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?php echo esc_html( $plugin['Name'] ); ?></td>
|
||||
<td><?php echo esc_html( $plugin['WC tested up to'] ); ?></td>
|
||||
<th><?php esc_html_e( 'Plugin', 'woocommerce' ); ?></th>
|
||||
<th><?php esc_html_e( 'Tested up to WooCommerce version', 'woocommerce' ); ?></th>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ( $plugins as $plugin ) : ?>
|
||||
<tr>
|
||||
<td><?php echo esc_html( $plugin['Name'] ); ?></td>
|
||||
<td><?php echo esc_html( $plugin['WC tested up to'] ); ?></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p><?php esc_html_e( 'As this is a major update, we strongly recommend creating a backup of your site before updating.', 'woocommerce' ); ?> <a href="https://woocommerce.com/2017/05/create-use-backups-woocommerce/" target="_blank"><?php _e( 'Learn more', 'woocommerce' ); ?></a></p>
|
||||
|
||||
|
|
|
@ -28,7 +28,13 @@ class WC_Settings_Tax extends WC_Settings_Page {
|
|||
$this->id = 'tax';
|
||||
$this->label = __( 'Tax', 'woocommerce' );
|
||||
|
||||
parent::__construct();
|
||||
add_filter( 'woocommerce_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
|
||||
|
||||
if ( wc_tax_enabled() ) {
|
||||
add_action( 'woocommerce_sections_' . $this->id, array( $this, 'output_sections' ) );
|
||||
add_action( 'woocommerce_settings_' . $this->id, array( $this, 'output' ) );
|
||||
add_action( 'woocommerce_settings_save_' . $this->id, array( $this, 'save' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,23 +1,36 @@
|
|||
<?php
|
||||
/**
|
||||
* Admin View: Settings
|
||||
*
|
||||
* @package WooCommerce
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$tab_exists = isset( $tabs[ $current_tab ] ) || has_action( 'woocommerce_sections_' . $current_tab ) || has_action( 'woocommerce_settings_' . $current_tab ) || has_action( 'woocommerce_settings_tabs_' . $current_tab );
|
||||
$current_tab_label = isset( $tabs[ $current_tab ] ) ? $tabs[ $current_tab ] : '';
|
||||
|
||||
if ( ! $tab_exists ) {
|
||||
wp_safe_redirect( admin_url( 'admin.php?page=wc-settings' ) );
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<div class="wrap woocommerce">
|
||||
<form method="<?php echo esc_attr( apply_filters( 'woocommerce_settings_form_method_tab_' . $current_tab, 'post' ) ); ?>" id="mainform" action="" enctype="multipart/form-data">
|
||||
<nav class="nav-tab-wrapper woo-nav-tab-wrapper">
|
||||
<?php
|
||||
foreach ( $tabs as $name => $label ) {
|
||||
echo '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=' . $name ) . '" class="nav-tab ' . ( $current_tab == $name ? 'nav-tab-active' : '' ) . '">' . $label . '</a>';
|
||||
}
|
||||
do_action( 'woocommerce_settings_tabs' );
|
||||
|
||||
foreach ( $tabs as $slug => $label ) {
|
||||
echo '<a href="' . esc_html( admin_url( 'admin.php?page=wc-settings&tab=' . esc_attr( $slug ) ) ) . '" class="nav-tab ' . ( $current_tab === $slug ? 'nav-tab-active' : '' ) . '">' . esc_html( $label ) . '</a>';
|
||||
}
|
||||
|
||||
do_action( 'woocommerce_settings_tabs' );
|
||||
|
||||
?>
|
||||
</nav>
|
||||
<h1 class="screen-reader-text"><?php echo esc_html( $tabs[ $current_tab ] ); ?></h1>
|
||||
<h1 class="screen-reader-text"><?php echo esc_html( $current_tab_label ); ?></h1>
|
||||
<?php
|
||||
do_action( 'woocommerce_sections_' . $current_tab );
|
||||
|
||||
|
|
|
@ -32,9 +32,9 @@ class WC_REST_Product_Categories_Controller extends WC_REST_Product_Categories_V
|
|||
/**
|
||||
* Prepare a single product category output for response.
|
||||
*
|
||||
* @param WP_Term $item Term object.
|
||||
* @param WP_REST_Request $request
|
||||
* @return WP_REST_Response $response
|
||||
* @param WP_Term $item Term object.
|
||||
* @param WP_REST_Request $request Request instance.
|
||||
* @return WP_REST_Response
|
||||
*/
|
||||
public function prepare_item_for_response( $item, $request ) {
|
||||
// Get category display type.
|
||||
|
@ -50,13 +50,14 @@ class WC_REST_Product_Categories_Controller extends WC_REST_Product_Categories_V
|
|||
'parent' => (int) $item->parent,
|
||||
'description' => $item->description,
|
||||
'display' => $display_type ? $display_type : 'default',
|
||||
'image' => array(),
|
||||
'image' => null,
|
||||
'menu_order' => (int) $menu_order,
|
||||
'count' => (int) $item->count,
|
||||
);
|
||||
|
||||
// Get category image.
|
||||
if ( $image_id = get_woocommerce_term_meta( $item->term_id, 'thumbnail_id' ) ) {
|
||||
$image_id = get_woocommerce_term_meta( $item->term_id, 'thumbnail_id' );
|
||||
if ( $image_id ) {
|
||||
$attachment = get_post( $image_id );
|
||||
|
||||
$data['image'] = array(
|
||||
|
|
|
@ -23,7 +23,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller {
|
||||
|
||||
/**
|
||||
* Endpoint namespace.
|
||||
* Endpoint namespace.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
|
@ -92,7 +92,9 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
'callback' => array( $this, 'get_item' ),
|
||||
'permission_callback' => array( $this, 'get_item_permissions_check' ),
|
||||
'args' => array(
|
||||
'context' => $this->get_context_param( array( 'default' => 'view' ) ),
|
||||
'context' => $this->get_context_param( array(
|
||||
'default' => 'view',
|
||||
) ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
|
@ -396,7 +398,9 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
|
||||
if ( $parent_attributes[ $attribute_name ]->is_taxonomy() ) {
|
||||
// If dealing with a taxonomy, we need to get the slug from the name posted to the API.
|
||||
// @codingStandardsIgnoreStart
|
||||
$term = get_term_by( 'name', $attribute_value, $attribute_name );
|
||||
// @codingStandardsIgnoreEnd
|
||||
|
||||
if ( $term && ! is_wp_error( $term ) ) {
|
||||
$attribute_value = $term->slug;
|
||||
|
@ -449,7 +453,7 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
/**
|
||||
* Delete a variation.
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
*
|
||||
* @return bool|WP_Error|WP_REST_Response
|
||||
*/
|
||||
|
@ -459,7 +463,9 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
$result = false;
|
||||
|
||||
if ( ! $object || 0 === $object->get_id() ) {
|
||||
return new WP_Error( "woocommerce_rest_{$this->post_type}_invalid_id", __( 'Invalid ID.', 'woocommerce' ), array( 'status' => 404 ) );
|
||||
return new WP_Error( "woocommerce_rest_{$this->post_type}_invalid_id", __( 'Invalid ID.', 'woocommerce' ), array(
|
||||
'status' => 404,
|
||||
) );
|
||||
}
|
||||
|
||||
$supports_trash = EMPTY_TRASH_DAYS > 0 && is_callable( array( $object, 'get_status' ) );
|
||||
|
@ -476,7 +482,9 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
|
||||
if ( ! wc_rest_check_post_permissions( $this->post_type, 'delete', $object->get_id() ) ) {
|
||||
/* translators: %s: post type */
|
||||
return new WP_Error( "woocommerce_rest_user_cannot_delete_{$this->post_type}", sprintf( __( 'Sorry, you are not allowed to delete %s.', 'woocommerce' ), $this->post_type ), array( 'status' => rest_authorization_required_code() ) );
|
||||
return new WP_Error( "woocommerce_rest_user_cannot_delete_{$this->post_type}", sprintf( __( 'Sorry, you are not allowed to delete %s.', 'woocommerce' ), $this->post_type ), array(
|
||||
'status' => rest_authorization_required_code(),
|
||||
) );
|
||||
}
|
||||
|
||||
$request->set_param( 'context', 'edit' );
|
||||
|
@ -490,14 +498,18 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
// If we don't support trashing for this type, error out.
|
||||
if ( ! $supports_trash ) {
|
||||
/* translators: %s: post type */
|
||||
return new WP_Error( 'woocommerce_rest_trash_not_supported', sprintf( __( 'The %s does not support trashing.', 'woocommerce' ), $this->post_type ), array( 'status' => 501 ) );
|
||||
return new WP_Error( 'woocommerce_rest_trash_not_supported', sprintf( __( 'The %s does not support trashing.', 'woocommerce' ), $this->post_type ), array(
|
||||
'status' => 501,
|
||||
) );
|
||||
}
|
||||
|
||||
// Otherwise, only trash if we haven't already.
|
||||
if ( is_callable( array( $object, 'get_status' ) ) ) {
|
||||
if ( 'trash' === $object->get_status() ) {
|
||||
/* translators: %s: post type */
|
||||
return new WP_Error( 'woocommerce_rest_already_trashed', sprintf( __( 'The %s has already been deleted.', 'woocommerce' ), $this->post_type ), array( 'status' => 410 ) );
|
||||
return new WP_Error( 'woocommerce_rest_already_trashed', sprintf( __( 'The %s has already been deleted.', 'woocommerce' ), $this->post_type ), array(
|
||||
'status' => 410,
|
||||
) );
|
||||
}
|
||||
|
||||
$object->delete();
|
||||
|
@ -507,7 +519,9 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
|
||||
if ( ! $result ) {
|
||||
/* translators: %s: post type */
|
||||
return new WP_Error( 'woocommerce_rest_cannot_delete', sprintf( __( 'The %s cannot be deleted.', 'woocommerce' ), $this->post_type ), array( 'status' => 500 ) );
|
||||
return new WP_Error( 'woocommerce_rest_cannot_delete', sprintf( __( 'The %s cannot be deleted.', 'woocommerce' ), $this->post_type ), array(
|
||||
'status' => 500,
|
||||
) );
|
||||
}
|
||||
|
||||
// Delete parent product transients.
|
||||
|
@ -544,7 +558,9 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
if ( ! empty( $items[ $batch_type ] ) ) {
|
||||
$injected_items = array();
|
||||
foreach ( $items[ $batch_type ] as $item ) {
|
||||
$injected_items[] = is_array( $item ) ? array_merge( array( 'product_id' => $product_id ), $item ) : $item;
|
||||
$injected_items[] = is_array( $item ) ? array_merge( array(
|
||||
'product_id' => $product_id,
|
||||
), $item ) : $item;
|
||||
}
|
||||
$body_params[ $batch_type ] = $injected_items;
|
||||
}
|
||||
|
@ -671,7 +687,7 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
'readonly' => true,
|
||||
),
|
||||
'visible' => array(
|
||||
'description' => __( "Define if the attribute is visible on the \"Additional information\" tab in the product's page.", 'woocommerce' ),
|
||||
'description' => __( "Define if the variation is visible on the product's page.", 'woocommerce' ),
|
||||
'type' => 'boolean',
|
||||
'default' => true,
|
||||
'context' => array( 'view', 'edit' ),
|
||||
|
|
|
@ -89,7 +89,9 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
'callback' => array( $this, 'get_item' ),
|
||||
'permission_callback' => array( $this, 'get_item_permissions_check' ),
|
||||
'args' => array(
|
||||
'context' => $this->get_context_param( array( 'default' => 'view' ) ),
|
||||
'context' => $this->get_context_param( array(
|
||||
'default' => 'view',
|
||||
) ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
|
@ -231,7 +233,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
}
|
||||
|
||||
if ( ! empty( $tax_query ) ) {
|
||||
$args['tax_query'] = $tax_query;
|
||||
$args['tax_query'] = $tax_query; // WPCS: slow query ok.
|
||||
}
|
||||
|
||||
// Filter featured.
|
||||
|
@ -251,7 +253,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
$skus[] = $request['sku'];
|
||||
}
|
||||
|
||||
$args['meta_query'] = $this->add_meta_query( $args, array(
|
||||
$args['meta_query'] = $this->add_meta_query( $args, array( // WPCS: slow query ok.
|
||||
'key' => '_sku',
|
||||
'value' => $skus,
|
||||
'compare' => 'IN',
|
||||
|
@ -260,7 +262,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
|
||||
// Filter by tax class.
|
||||
if ( ! empty( $request['tax_class'] ) ) {
|
||||
$args['meta_query'] = $this->add_meta_query( $args, array(
|
||||
$args['meta_query'] = $this->add_meta_query( $args, array( // WPCS: slow query ok.
|
||||
'key' => '_tax_class',
|
||||
'value' => 'standard' !== $request['tax_class'] ? $request['tax_class'] : '',
|
||||
) );
|
||||
|
@ -268,12 +270,12 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
|
||||
// Price filter.
|
||||
if ( ! empty( $request['min_price'] ) || ! empty( $request['max_price'] ) ) {
|
||||
$args['meta_query'] = $this->add_meta_query( $args, wc_get_min_max_price_meta_query( $request ) );
|
||||
$args['meta_query'] = $this->add_meta_query( $args, wc_get_min_max_price_meta_query( $request ) ); // WPCS: slow query ok.
|
||||
}
|
||||
|
||||
// Filter product in stock or out of stock.
|
||||
if ( is_bool( $request['in_stock'] ) ) {
|
||||
$args['meta_query'] = $this->add_meta_query( $args, array(
|
||||
$args['meta_query'] = $this->add_meta_query( $args, array( // WPCS: slow query ok.
|
||||
'key' => '_stock_status',
|
||||
'value' => true === $request['in_stock'] ? 'instock' : 'outofstock',
|
||||
) );
|
||||
|
@ -485,7 +487,9 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
*/
|
||||
protected function get_attribute_options( $product_id, $attribute ) {
|
||||
if ( isset( $attribute['is_taxonomy'] ) && $attribute['is_taxonomy'] ) {
|
||||
return wc_get_product_terms( $product_id, $attribute['name'], array( 'fields' => 'names' ) );
|
||||
return wc_get_product_terms( $product_id, $attribute['name'], array(
|
||||
'fields' => 'names',
|
||||
) );
|
||||
} elseif ( isset( $attribute['value'] ) ) {
|
||||
return array_map( 'trim', explode( '|', $attribute['value'] ) );
|
||||
}
|
||||
|
@ -547,7 +551,8 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
* Get product data.
|
||||
*
|
||||
* @param WC_Product $product Product instance.
|
||||
* @param string $context 'view' or 'edit'
|
||||
* @param string $context Request context.
|
||||
* Options: 'view' and 'edit'.
|
||||
* @return array
|
||||
*/
|
||||
protected function get_product_data( $product, $context = 'view' ) {
|
||||
|
@ -678,7 +683,9 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
}
|
||||
|
||||
if ( 'variation' === $product->get_type() ) {
|
||||
return new WP_Error( "woocommerce_rest_invalid_{$this->post_type}_id", __( 'To manipulate product variations you should use the /products/<product_id>/variations/<id> endpoint.', 'woocommerce' ), array( 'status' => 404 ) );
|
||||
return new WP_Error( "woocommerce_rest_invalid_{$this->post_type}_id", __( 'To manipulate product variations you should use the /products/<product_id>/variations/<id> endpoint.', 'woocommerce' ), array(
|
||||
'status' => 404,
|
||||
) );
|
||||
}
|
||||
|
||||
// Post title.
|
||||
|
@ -1060,6 +1067,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
}
|
||||
|
||||
if ( ! wp_attachment_is_image( $attachment_id ) ) {
|
||||
/* translators: %s: attachment id */
|
||||
throw new WC_REST_Exception( 'woocommerce_product_invalid_image_id', sprintf( __( '#%s is an invalid image ID.', 'woocommerce' ), $attachment_id ), 400 );
|
||||
}
|
||||
|
||||
|
@ -1076,7 +1084,10 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
|
||||
// Set the image name if present.
|
||||
if ( ! empty( $image['name'] ) ) {
|
||||
wp_update_post( array( 'ID' => $attachment_id, 'post_title' => $image['name'] ) );
|
||||
wp_update_post( array(
|
||||
'ID' => $attachment_id,
|
||||
'post_title' => $image['name'],
|
||||
) );
|
||||
}
|
||||
|
||||
// Set the image source if present, for future reference.
|
||||
|
@ -1273,11 +1284,15 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
$result = false;
|
||||
|
||||
if ( ! $object || 0 === $object->get_id() ) {
|
||||
return new WP_Error( "woocommerce_rest_{$this->post_type}_invalid_id", __( 'Invalid ID.', 'woocommerce' ), array( 'status' => 404 ) );
|
||||
return new WP_Error( "woocommerce_rest_{$this->post_type}_invalid_id", __( 'Invalid ID.', 'woocommerce' ), array(
|
||||
'status' => 404,
|
||||
) );
|
||||
}
|
||||
|
||||
if ( 'variation' === $object->get_type() ) {
|
||||
return new WP_Error( "woocommerce_rest_invalid_{$this->post_type}_id", __( 'To manipulate product variations you should use the /products/<product_id>/variations/<id> endpoint.', 'woocommerce' ), array( 'status' => 404 ) );
|
||||
return new WP_Error( "woocommerce_rest_invalid_{$this->post_type}_id", __( 'To manipulate product variations you should use the /products/<product_id>/variations/<id> endpoint.', 'woocommerce' ), array(
|
||||
'status' => 404,
|
||||
) );
|
||||
}
|
||||
|
||||
$supports_trash = EMPTY_TRASH_DAYS > 0 && is_callable( array( $object, 'get_status' ) );
|
||||
|
@ -1294,7 +1309,9 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
|
||||
if ( ! wc_rest_check_post_permissions( $this->post_type, 'delete', $object->get_id() ) ) {
|
||||
/* translators: %s: post type */
|
||||
return new WP_Error( "woocommerce_rest_user_cannot_delete_{$this->post_type}", sprintf( __( 'Sorry, you are not allowed to delete %s.', 'woocommerce' ), $this->post_type ), array( 'status' => rest_authorization_required_code() ) );
|
||||
return new WP_Error( "woocommerce_rest_user_cannot_delete_{$this->post_type}", sprintf( __( 'Sorry, you are not allowed to delete %s.', 'woocommerce' ), $this->post_type ), array(
|
||||
'status' => rest_authorization_required_code(),
|
||||
) );
|
||||
}
|
||||
|
||||
$request->set_param( 'context', 'edit' );
|
||||
|
@ -1321,14 +1338,18 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
// If we don't support trashing for this type, error out.
|
||||
if ( ! $supports_trash ) {
|
||||
/* translators: %s: post type */
|
||||
return new WP_Error( 'woocommerce_rest_trash_not_supported', sprintf( __( 'The %s does not support trashing.', 'woocommerce' ), $this->post_type ), array( 'status' => 501 ) );
|
||||
return new WP_Error( 'woocommerce_rest_trash_not_supported', sprintf( __( 'The %s does not support trashing.', 'woocommerce' ), $this->post_type ), array(
|
||||
'status' => 501,
|
||||
) );
|
||||
}
|
||||
|
||||
// Otherwise, only trash if we haven't already.
|
||||
if ( is_callable( array( $object, 'get_status' ) ) ) {
|
||||
if ( 'trash' === $object->get_status() ) {
|
||||
/* translators: %s: post type */
|
||||
return new WP_Error( 'woocommerce_rest_already_trashed', sprintf( __( 'The %s has already been deleted.', 'woocommerce' ), $this->post_type ), array( 'status' => 410 ) );
|
||||
return new WP_Error( 'woocommerce_rest_already_trashed', sprintf( __( 'The %s has already been deleted.', 'woocommerce' ), $this->post_type ), array(
|
||||
'status' => 410,
|
||||
) );
|
||||
}
|
||||
|
||||
$object->delete();
|
||||
|
@ -1338,7 +1359,9 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
|
||||
if ( ! $result ) {
|
||||
/* translators: %s: post type */
|
||||
return new WP_Error( 'woocommerce_rest_cannot_delete', sprintf( __( 'The %s cannot be deleted.', 'woocommerce' ), $this->post_type ), array( 'status' => 500 ) );
|
||||
return new WP_Error( 'woocommerce_rest_cannot_delete', sprintf( __( 'The %s cannot be deleted.', 'woocommerce' ), $this->post_type ), array(
|
||||
'status' => 500,
|
||||
) );
|
||||
}
|
||||
|
||||
// Delete parent product transients.
|
||||
|
@ -1401,7 +1424,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
'readonly' => true,
|
||||
),
|
||||
'date_created_gmt' => array(
|
||||
'description' => __( "The date the product was created, as GMT.", 'woocommerce' ),
|
||||
'description' => __( 'The date the product was created, as GMT.', 'woocommerce' ),
|
||||
'type' => 'date-time',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
|
@ -1413,7 +1436,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
'readonly' => true,
|
||||
),
|
||||
'date_modified_gmt' => array(
|
||||
'description' => __( "The date the product was last modified, as GMT.", 'woocommerce' ),
|
||||
'description' => __( 'The date the product was last modified, as GMT.', 'woocommerce' ),
|
||||
'type' => 'date-time',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
|
@ -1492,7 +1515,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
'date_on_sale_to_gmt' => array(
|
||||
'description' => __( "End date of sale price, in the site's timezone.", 'woocommerce' ),
|
||||
'description' => __( 'End date of sale price, as GMT.', 'woocommerce' ),
|
||||
'type' => 'date-time',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
|
@ -1815,7 +1838,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
'readonly' => true,
|
||||
),
|
||||
'date_created_gmt' => array(
|
||||
'description' => __( "The date the image was created, as GMT.", 'woocommerce' ),
|
||||
'description' => __( 'The date the image was created, as GMT.', 'woocommerce' ),
|
||||
'type' => 'date-time',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
|
@ -1827,7 +1850,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
'readonly' => true,
|
||||
),
|
||||
'date_modified_gmt' => array(
|
||||
'description' => __( "The date the image was last modified, as GMT.", 'woocommerce' ),
|
||||
'description' => __( 'The date the image was last modified, as GMT.', 'woocommerce' ),
|
||||
'type' => 'date-time',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
|
|
|
@ -836,7 +836,11 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
|
|||
$outdated_templates = false;
|
||||
$scan_files = WC_Admin_Status::scan_template_files( WC()->plugin_path() . '/templates/' );
|
||||
foreach ( $scan_files as $file ) {
|
||||
if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {
|
||||
$located = apply_filters( 'wc_get_template', $file, $file, array(), WC()->template_path(), WC()->plugin_path() . '/templates/' );
|
||||
|
||||
if ( file_exists( $located ) ) {
|
||||
$theme_file = $located;
|
||||
} elseif ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {
|
||||
$theme_file = get_stylesheet_directory() . '/' . $file;
|
||||
} elseif ( file_exists( get_stylesheet_directory() . '/' . WC()->template_path() . $file ) ) {
|
||||
$theme_file = get_stylesheet_directory() . '/' . WC()->template_path() . $file;
|
||||
|
|
|
@ -1076,10 +1076,11 @@ class WC_API_Products extends WC_API_Resource {
|
|||
|
||||
$product->set_date_on_sale_to( $date_to );
|
||||
$product->set_date_on_sale_from( $date_from );
|
||||
|
||||
if ( $product->is_on_sale() ) {
|
||||
$product->set_price( $product->get_sale_price() );
|
||||
$product->set_price( $product->get_sale_price( 'edit' ) );
|
||||
} else {
|
||||
$product->set_price( $product->get_regular_price() );
|
||||
$product->set_price( $product->get_regular_price( 'edit' ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1566,10 +1566,11 @@ class WC_API_Products extends WC_API_Resource {
|
|||
|
||||
$product->set_date_on_sale_to( $date_to );
|
||||
$product->set_date_on_sale_from( $date_from );
|
||||
|
||||
if ( $product->is_on_sale() ) {
|
||||
$product->set_price( $product->get_sale_price() );
|
||||
$product->set_price( $product->get_sale_price( 'edit' ) );
|
||||
} else {
|
||||
$product->set_price( $product->get_regular_price() );
|
||||
$product->set_price( $product->get_regular_price( 'edit' ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,9 +46,9 @@ class WC_REST_Product_Categories_V1_Controller extends WC_REST_Terms_Controller
|
|||
/**
|
||||
* Prepare a single product category output for response.
|
||||
*
|
||||
* @param WP_Term $item Term object.
|
||||
* @param WP_REST_Request $request
|
||||
* @return WP_REST_Response $response
|
||||
* @param WP_Term $item Term object.
|
||||
* @param WP_REST_Request $request Request instance.
|
||||
* @return WP_REST_Response
|
||||
*/
|
||||
public function prepare_item_for_response( $item, $request ) {
|
||||
// Get category display type.
|
||||
|
@ -64,13 +64,14 @@ class WC_REST_Product_Categories_V1_Controller extends WC_REST_Terms_Controller
|
|||
'parent' => (int) $item->parent,
|
||||
'description' => $item->description,
|
||||
'display' => $display_type ? $display_type : 'default',
|
||||
'image' => array(),
|
||||
'image' => null,
|
||||
'menu_order' => (int) $menu_order,
|
||||
'count' => (int) $item->count,
|
||||
);
|
||||
|
||||
// Get category image.
|
||||
if ( $image_id = get_woocommerce_term_meta( $item->term_id, 'thumbnail_id' ) ) {
|
||||
$image_id = get_woocommerce_term_meta( $item->term_id, 'thumbnail_id' );
|
||||
if ( $image_id ) {
|
||||
$attachment = get_post( $image_id );
|
||||
|
||||
$data['image'] = array(
|
||||
|
@ -106,8 +107,8 @@ class WC_REST_Product_Categories_V1_Controller extends WC_REST_Terms_Controller
|
|||
/**
|
||||
* Update term meta fields.
|
||||
*
|
||||
* @param WP_Term $term
|
||||
* @param WP_REST_Request $request
|
||||
* @param WP_Term $term Term object.
|
||||
* @param WP_REST_Request $request Request instance.
|
||||
* @return bool|WP_Error
|
||||
*/
|
||||
protected function update_term_meta_fields( $term, $request ) {
|
||||
|
@ -145,7 +146,10 @@ class WC_REST_Product_Categories_V1_Controller extends WC_REST_Terms_Controller
|
|||
|
||||
// Set the image title.
|
||||
if ( ! empty( $request['image']['title'] ) ) {
|
||||
wp_update_post( array( 'ID' => $image_id, 'post_title' => wc_clean( $request['image']['title'] ) ) );
|
||||
wp_update_post( array(
|
||||
'ID' => $image_id,
|
||||
'post_title' => wc_clean( $request['image']['title'] ),
|
||||
) );
|
||||
}
|
||||
} else {
|
||||
delete_woocommerce_term_meta( $id, 'thumbnail_id' );
|
||||
|
|
|
@ -1829,7 +1829,7 @@ class WC_REST_Products_V1_Controller extends WC_REST_Posts_Controller {
|
|||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
'date_on_sale_to' => array(
|
||||
'description' => __( 'End data of sale price.', 'woocommerce' ),
|
||||
'description' => __( 'End date of sale price.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
|
@ -2314,7 +2314,7 @@ class WC_REST_Products_V1_Controller extends WC_REST_Posts_Controller {
|
|||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
'date_on_sale_to' => array(
|
||||
'description' => __( 'End data of sale price.', 'woocommerce' ),
|
||||
'description' => __( 'End date of sale price.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
|
|
|
@ -773,11 +773,20 @@ class WC_AJAX {
|
|||
$order_id = absint( $_POST['order_id'] );
|
||||
$order = wc_get_order( $order_id );
|
||||
$items_to_add = wp_parse_id_list( is_array( $_POST['item_to_add'] ) ? $_POST['item_to_add'] : array( $_POST['item_to_add'] ) );
|
||||
$items = ( ! empty( $_POST['items'] ) ) ? $_POST['items'] : '';
|
||||
|
||||
if ( ! $order ) {
|
||||
throw new Exception( __( 'Invalid order', 'woocommerce' ) );
|
||||
}
|
||||
|
||||
// If we passed through items it means we need to save first before adding a new one.
|
||||
if ( ! empty( $items ) ) {
|
||||
$save_items = array();
|
||||
parse_str( $items, $save_items );
|
||||
// Save order items.
|
||||
wc_save_order_items( $order->get_id(), $save_items );
|
||||
}
|
||||
|
||||
foreach ( $items_to_add as $item_to_add ) {
|
||||
if ( ! in_array( get_post_type( $item_to_add ), array( 'product', 'product_variation' ) ) ) {
|
||||
continue;
|
||||
|
@ -985,11 +994,20 @@ class WC_AJAX {
|
|||
try {
|
||||
$order_id = absint( $_POST['order_id'] );
|
||||
$order_item_ids = $_POST['order_item_ids'];
|
||||
$items = ( ! empty( $_POST['items'] ) ) ? $_POST['items'] : '';
|
||||
|
||||
if ( ! is_array( $order_item_ids ) && is_numeric( $order_item_ids ) ) {
|
||||
$order_item_ids = array( $order_item_ids );
|
||||
}
|
||||
|
||||
// If we passed through items it means we need to save first before deleting.
|
||||
if ( ! empty( $items ) ) {
|
||||
$save_items = array();
|
||||
parse_str( $items, $save_items );
|
||||
// Save order items
|
||||
wc_save_order_items( $order_id, $save_items );
|
||||
}
|
||||
|
||||
if ( sizeof( $order_item_ids ) > 0 ) {
|
||||
foreach ( $order_item_ids as $id ) {
|
||||
wc_delete_order_item( absint( $id ) );
|
||||
|
|
|
@ -14,10 +14,14 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* API class.
|
||||
*/
|
||||
class WC_API extends WC_Legacy_API {
|
||||
|
||||
/**
|
||||
* Setup class.
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -43,7 +47,7 @@ class WC_API extends WC_Legacy_API {
|
|||
* Add new query vars.
|
||||
*
|
||||
* @since 2.0
|
||||
* @param array $vars
|
||||
* @param array $vars Query vars.
|
||||
* @return string[]
|
||||
*/
|
||||
public function add_query_vars( $vars ) {
|
||||
|
@ -54,6 +58,7 @@ class WC_API extends WC_Legacy_API {
|
|||
|
||||
/**
|
||||
* WC API for payment gateway IPNs, etc.
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
public static function add_endpoint() {
|
||||
|
@ -70,8 +75,8 @@ class WC_API extends WC_Legacy_API {
|
|||
public function handle_api_requests() {
|
||||
global $wp;
|
||||
|
||||
if ( ! empty( $_GET['wc-api'] ) ) {
|
||||
$wp->query_vars['wc-api'] = $_GET['wc-api'];
|
||||
if ( ! empty( $_GET['wc-api'] ) ) { // WPCS: input var okay, CSRF ok.
|
||||
$wp->query_vars['wc-api'] = sanitize_key( wp_unslash( $_GET['wc-api'] ) ); // WPCS: input var okay, CSRF ok.
|
||||
}
|
||||
|
||||
// wc-api endpoint requests.
|
||||
|
@ -84,7 +89,7 @@ class WC_API extends WC_Legacy_API {
|
|||
nocache_headers();
|
||||
|
||||
// Clean the API request.
|
||||
$api_request = strtolower( wc_clean( $wp->query_vars['wc-api'] ) );
|
||||
$api_request = $wp->query_vars['wc-api'];
|
||||
|
||||
// Trigger generic action before request hook.
|
||||
do_action( 'woocommerce_api_request', $api_request );
|
||||
|
@ -103,6 +108,7 @@ class WC_API extends WC_Legacy_API {
|
|||
|
||||
/**
|
||||
* Init WP REST API.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
private function rest_api_init() {
|
||||
|
@ -129,12 +135,6 @@ class WC_API extends WC_Legacy_API {
|
|||
// Authentication.
|
||||
include_once( dirname( __FILE__ ) . '/api/class-wc-rest-authentication.php' );
|
||||
|
||||
// WP-API classes and functions.
|
||||
include_once( dirname( __FILE__ ) . '/vendor/wp-rest-functions.php' );
|
||||
if ( ! class_exists( 'WP_REST_Controller' ) ) {
|
||||
include_once( dirname( __FILE__ ) . '/vendor/abstract-wp-rest-controller.php' );
|
||||
}
|
||||
|
||||
// Abstract controllers.
|
||||
include_once( dirname( __FILE__ ) . '/abstracts/abstract-wc-rest-controller.php' );
|
||||
include_once( dirname( __FILE__ ) . '/abstracts/abstract-wc-rest-posts-controller.php' );
|
||||
|
@ -205,6 +205,7 @@ class WC_API extends WC_Legacy_API {
|
|||
|
||||
/**
|
||||
* Register REST API routes.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
public function register_rest_routes() {
|
||||
|
@ -275,6 +276,7 @@ class WC_API extends WC_Legacy_API {
|
|||
|
||||
/**
|
||||
* Register WC settings from WP-API to the REST API.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function register_wp_admin_settings() {
|
||||
|
|
|
@ -21,7 +21,6 @@ class WC_Cache_Helper {
|
|||
public static function init() {
|
||||
add_action( 'template_redirect', array( __CLASS__, 'geolocation_ajax_redirect' ) );
|
||||
add_action( 'wp', array( __CLASS__, 'prevent_caching' ) );
|
||||
add_filter( 'nocache_headers', array( __CLASS__, 'set_nocache_constants' ) );
|
||||
add_action( 'admin_notices', array( __CLASS__, 'notices' ) );
|
||||
add_action( 'delete_version_transients', array( __CLASS__, 'delete_version_transients' ) );
|
||||
}
|
||||
|
@ -159,6 +158,7 @@ class WC_Cache_Helper {
|
|||
$page_ids = array_filter( array( wc_get_page_id( 'cart' ), wc_get_page_id( 'checkout' ), wc_get_page_id( 'myaccount' ) ) );
|
||||
|
||||
if ( isset( $_GET['download_file'] ) || isset( $_GET['add-to-cart'] ) || is_page( $page_ids ) ) {
|
||||
add_filter( 'nocache_headers', array( __CLASS__, 'set_nocache_constants' ) );
|
||||
nocache_headers();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ final class WC_Cart_Fees {
|
|||
public function add_fee( $args = array() ) {
|
||||
$fee_props = (object) wp_parse_args( $args, $this->default_fee_props );
|
||||
$fee_props->name = $fee_props->name ? $fee_props->name : __( 'Fee', 'woocommerce' );
|
||||
$fee_props->tax_class = in_array( $fee_props->tax_class, WC_Tax::get_tax_classes(), true ) ? $fee_props->tax_class: '';
|
||||
$fee_props->tax_class = in_array( $fee_props->tax_class, array_merge( WC_Tax::get_tax_classes(), WC_Tax::get_tax_class_slugs() ), true ) ? $fee_props->tax_class: '';
|
||||
$fee_props->taxable = wc_string_to_bool( $fee_props->taxable );
|
||||
$fee_props->amount = wc_format_decimal( $fee_props->amount );
|
||||
|
||||
|
|
|
@ -410,6 +410,27 @@ final class WC_Cart_Totals {
|
|||
return ( $a->sort < $b->sort ) ? -1 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ran to remove all base taxes from an item. Used when prices include tax, and the customer is tax exempt.
|
||||
*
|
||||
* @since 3.2.2
|
||||
* @param object $item Item to adjust the prices of.
|
||||
* @return object
|
||||
*/
|
||||
protected function remove_item_base_taxes( $item ) {
|
||||
if ( $item->price_includes_tax ) {
|
||||
$base_tax_rates = WC_Tax::get_base_tax_rates( $item->product->get_tax_class( 'unfiltered' ) );
|
||||
|
||||
// Work out a new base price without the shop's base tax.
|
||||
$taxes = WC_Tax::calc_tax( $item->subtotal, $base_tax_rates, true, true );
|
||||
|
||||
// Now we have a new item price (excluding TAX).
|
||||
$item->subtotal = $item->subtotal - array_sum( $taxes );
|
||||
$item->price_includes_tax = false;
|
||||
}
|
||||
return $item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Only ran if woocommerce_adjust_non_base_location_prices is true.
|
||||
*
|
||||
|
@ -423,15 +444,17 @@ final class WC_Cart_Totals {
|
|||
* @return object
|
||||
*/
|
||||
protected function adjust_non_base_location_price( $item ) {
|
||||
$base_tax_rates = WC_Tax::get_base_tax_rates( $item->product->get_tax_class( 'unfiltered' ) );
|
||||
if ( $item->price_includes_tax ) {
|
||||
$base_tax_rates = WC_Tax::get_base_tax_rates( $item->product->get_tax_class( 'unfiltered' ) );
|
||||
|
||||
if ( $item->tax_rates !== $base_tax_rates ) {
|
||||
// Work out a new base price without the shop's base tax.
|
||||
$taxes = WC_Tax::calc_tax( $item->subtotal, $base_tax_rates, true, true );
|
||||
if ( $item->tax_rates !== $base_tax_rates ) {
|
||||
// Work out a new base price without the shop's base tax.
|
||||
$taxes = WC_Tax::calc_tax( $item->subtotal, $base_tax_rates, true, true );
|
||||
|
||||
// Now we have a new item price (excluding TAX).
|
||||
$item->subtotal = $item->subtotal - array_sum( $taxes );
|
||||
$item->price_includes_tax = false;
|
||||
// Now we have a new item price (excluding TAX).
|
||||
$item->subtotal = $item->subtotal - array_sum( $taxes );
|
||||
$item->price_includes_tax = false;
|
||||
}
|
||||
}
|
||||
return $item;
|
||||
}
|
||||
|
@ -655,8 +678,12 @@ final class WC_Cart_Totals {
|
|||
*/
|
||||
protected function calculate_item_subtotals() {
|
||||
foreach ( $this->items as $item_key => $item ) {
|
||||
if ( $item->price_includes_tax && apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {
|
||||
$item = $this->adjust_non_base_location_price( $item );
|
||||
if ( $item->price_includes_tax ) {
|
||||
if ( $this->cart->get_customer()->get_is_vat_exempt() ) {
|
||||
$item = $this->remove_item_base_taxes( $item );
|
||||
} elseif ( apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {
|
||||
$item = $this->adjust_non_base_location_price( $item );
|
||||
}
|
||||
}
|
||||
|
||||
$subtotal_taxes = array();
|
||||
|
@ -726,11 +753,20 @@ final class WC_Cart_Totals {
|
|||
$this->coupon_discount_totals = (array) $discounts->get_discounts_by_item( true );
|
||||
$this->coupon_discount_tax_totals = $coupon_discount_tax_amounts;
|
||||
|
||||
$this->set_total( 'discounts_total', array_sum( $this->coupon_discount_totals ) );
|
||||
$this->set_total( 'discounts_tax_total', array_sum( $this->coupon_discount_tax_totals ) );
|
||||
if ( wc_prices_include_tax() ) {
|
||||
$this->set_total( 'discounts_total', array_sum( $this->coupon_discount_totals ) - array_sum( $this->coupon_discount_tax_totals ) );
|
||||
$this->set_total( 'discounts_tax_total', array_sum( $this->coupon_discount_tax_totals ) );
|
||||
} else {
|
||||
$this->set_total( 'discounts_total', array_sum( $this->coupon_discount_totals ) );
|
||||
$this->set_total( 'discounts_tax_total', array_sum( $this->coupon_discount_tax_totals ) );
|
||||
}
|
||||
|
||||
$this->cart->set_coupon_discount_totals( wc_remove_number_precision_deep( $coupon_discount_amounts ) );
|
||||
$this->cart->set_coupon_discount_tax_totals( wc_remove_number_precision_deep( $coupon_discount_tax_amounts ) );
|
||||
|
||||
// Add totals to cart object. Note: Discount total for cart is excl tax.
|
||||
$this->cart->set_discount_total( $this->get_total( 'discounts_total' ) );
|
||||
$this->cart->set_discount_tax( $this->get_total( 'discounts_tax_total' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -774,10 +810,6 @@ final class WC_Cart_Totals {
|
|||
*/
|
||||
protected function calculate_totals() {
|
||||
$this->set_total( 'total', round( $this->get_total( 'items_total', true ) + $this->get_total( 'fees_total', true ) + $this->get_total( 'shipping_total', true ) + array_sum( $this->get_merged_taxes( true ) ) ) );
|
||||
|
||||
// Add totals to cart object.
|
||||
$this->cart->set_discount_total( $this->get_total( 'discounts_total' ) );
|
||||
$this->cart->set_discount_tax( $this->get_total( 'discounts_tax_total' ) );
|
||||
$this->cart->set_total_tax( array_sum( $this->get_merged_taxes( false ) ) );
|
||||
|
||||
// Allow plugins to hook and alter totals before final total is calculated.
|
||||
|
|
|
@ -1495,9 +1495,11 @@ class WC_Cart extends WC_Legacy_Cart {
|
|||
$users_query = new WP_User_Query( array(
|
||||
'fields' => 'ID',
|
||||
'meta_query' => array(
|
||||
'key' => '_billing_email',
|
||||
'value' => $check_emails,
|
||||
'compare' => 'IN',
|
||||
array(
|
||||
'key' => '_billing_email',
|
||||
'value' => $check_emails,
|
||||
'compare' => 'IN',
|
||||
),
|
||||
),
|
||||
) );
|
||||
|
||||
|
@ -1754,9 +1756,8 @@ class WC_Cart extends WC_Legacy_Cart {
|
|||
public function get_fees() {
|
||||
$fees = $this->fees_api()->get_fees();
|
||||
|
||||
if ( ! empty( $this->fees ) ) {
|
||||
wc_deprecated_function( 'WC_Cart->fees', '3.2', sprintf( 'Fees should only be added through the Fees API (%s)', 'WC_Cart::add_fee()' ) );
|
||||
$fees = $fees + $this->fees;
|
||||
if ( property_exists( $this, 'fees' ) ) {
|
||||
$fees = $fees + (array) $this->fees;
|
||||
}
|
||||
return $fees;
|
||||
}
|
||||
|
|
|
@ -1149,7 +1149,7 @@ class WC_Countries {
|
|||
'label' => __( 'Phone', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'type' => 'tel',
|
||||
'class' => array( 'form-row-first' ),
|
||||
'class' => array( 'form-row-wide' ),
|
||||
'validate' => array( 'phone' ),
|
||||
'autocomplete' => 'tel',
|
||||
'priority' => 100,
|
||||
|
@ -1158,7 +1158,7 @@ class WC_Countries {
|
|||
'label' => __( 'Email address', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'type' => 'email',
|
||||
'class' => array( 'form-row-last' ),
|
||||
'class' => array( 'form-row-wide' ),
|
||||
'validate' => array( 'email' ),
|
||||
'autocomplete' => 'no' === get_option( 'woocommerce_registration_generate_username' ) ? 'email' : 'email username',
|
||||
'priority' => 110,
|
||||
|
|
|
@ -11,12 +11,12 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
class WC_Deprecated_Action_Hooks extends WC_Deprecated_Hooks {
|
||||
|
||||
/**
|
||||
* Array of deprecated hooks we need to handle.
|
||||
* Array of deprecated hooks we need to handle. Format of 'new' => 'old'.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $deprecated_hooks = array(
|
||||
'woocommerce_new_order_item' => array(
|
||||
'woocommerce_new_order_item' => array(
|
||||
'woocommerce_order_add_shipping',
|
||||
'woocommerce_order_add_coupon',
|
||||
'woocommerce_order_add_tax',
|
||||
|
@ -25,15 +25,16 @@ class WC_Deprecated_Action_Hooks extends WC_Deprecated_Hooks {
|
|||
'woocommerce_add_order_item_meta',
|
||||
'woocommerce_add_order_fee_meta',
|
||||
),
|
||||
'woocommerce_update_order_item' => array(
|
||||
'woocommerce_update_order_item' => array(
|
||||
'woocommerce_order_edit_product',
|
||||
'woocommerce_order_update_coupon',
|
||||
'woocommerce_order_update_shipping',
|
||||
'woocommerce_order_update_fee',
|
||||
'woocommerce_order_update_tax',
|
||||
),
|
||||
'woocommerce_new_payment_token' => 'woocommerce_payment_token_created',
|
||||
'woocommerce_new_product_variation' => 'woocommerce_create_product_variation',
|
||||
'woocommerce_new_payment_token' => 'woocommerce_payment_token_created',
|
||||
'woocommerce_new_product_variation' => 'woocommerce_create_product_variation',
|
||||
'woocommerce_order_details_after_order_table_items' => 'woocommerce_order_items_table'
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
@ -45,12 +45,10 @@ class WC_Discounts {
|
|||
* @param array $object Cart or order object.
|
||||
*/
|
||||
public function __construct( $object = array() ) {
|
||||
$this->object = $object;
|
||||
|
||||
if ( is_a( $this->object, 'WC_Cart' ) ) {
|
||||
$this->set_items_from_cart( $this->object );
|
||||
} elseif ( is_a( $this->object, 'WC_Order' ) ) {
|
||||
$this->set_items_from_order( $this->object );
|
||||
if ( is_a( $object, 'WC_Cart' ) ) {
|
||||
$this->set_items_from_cart( $object );
|
||||
} elseif ( is_a( $object, 'WC_Order' ) ) {
|
||||
$this->set_items_from_order( $object );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -67,6 +65,8 @@ class WC_Discounts {
|
|||
return;
|
||||
}
|
||||
|
||||
$this->object = $cart;
|
||||
|
||||
foreach ( $cart->get_cart() as $key => $cart_item ) {
|
||||
$item = new stdClass();
|
||||
$item->key = $key;
|
||||
|
@ -87,12 +87,14 @@ class WC_Discounts {
|
|||
* @param array $order Cart object.
|
||||
*/
|
||||
public function set_items_from_order( $order ) {
|
||||
$this->items = $this->discounts = array();
|
||||
$this->items = $this->discounts = array();
|
||||
|
||||
if ( ! is_a( $order, 'WC_Order' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->object = $order;
|
||||
|
||||
foreach ( $order->get_items() as $order_item ) {
|
||||
$item = new stdClass();
|
||||
$item->key = $order_item->get_id();
|
||||
|
@ -242,7 +244,7 @@ class WC_Discounts {
|
|||
foreach ( $items_to_apply as $item ) {
|
||||
$discounted_price = $this->get_discounted_price_in_cents( $item );
|
||||
$price_to_discount = wc_remove_number_precision( ( 'yes' === get_option( 'woocommerce_calc_discounts_sequentially', 'no' ) ) ? $discounted_price : $item->price );
|
||||
$discount = wc_add_number_precision( $coupon->get_discount_amount( $price_to_discount, $item->object ) ) * $item->quantity;
|
||||
$discount = wc_add_number_precision( $coupon->get_discount_amount( $price_to_discount / $item->quantity, $item->object, true ) ) * $item->quantity;
|
||||
$discount = min( $discounted_price, $discount );
|
||||
|
||||
// Store code and discount amount per item.
|
||||
|
@ -292,39 +294,19 @@ class WC_Discounts {
|
|||
*/
|
||||
protected function get_items_to_apply_coupon( $coupon ) {
|
||||
$items_to_apply = array();
|
||||
$limit_usage_qty = 0;
|
||||
$applied_count = 0;
|
||||
|
||||
if ( null !== $coupon->get_limit_usage_to_x_items() ) {
|
||||
$limit_usage_qty = $coupon->get_limit_usage_to_x_items();
|
||||
}
|
||||
|
||||
foreach ( $this->items as $item ) {
|
||||
$item_to_apply = clone $item; // Clone the item so changes to this item do not affect the originals.
|
||||
|
||||
if ( 0 === $this->get_discounted_price_in_cents( $item_to_apply ) ) {
|
||||
if ( 0 === $this->get_discounted_price_in_cents( $item_to_apply ) || 0 >= $item_to_apply->quantity ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! $coupon->is_valid_for_product( $item_to_apply->product, $item_to_apply->object ) && ! $coupon->is_valid_for_cart() ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( $limit_usage_qty && $applied_count >= $limit_usage_qty ) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ( $limit_usage_qty && $item_to_apply->quantity > ( $limit_usage_qty - $applied_count ) ) {
|
||||
$limit_to_qty = absint( $limit_usage_qty - $applied_count );
|
||||
|
||||
// Lower the qty and cost so the discount is applied less.
|
||||
$item_to_apply->price = ( $item_to_apply->price / $item_to_apply->quantity ) * $limit_to_qty;
|
||||
$item_to_apply->quantity = $limit_to_qty;
|
||||
}
|
||||
if ( 0 >= $item_to_apply->quantity ) {
|
||||
continue;
|
||||
}
|
||||
$items_to_apply[] = $item_to_apply;
|
||||
$applied_count += $item_to_apply->quantity;
|
||||
}
|
||||
return $items_to_apply;
|
||||
}
|
||||
|
@ -338,8 +320,15 @@ class WC_Discounts {
|
|||
* @return int Total discounted.
|
||||
*/
|
||||
protected function apply_coupon_percent( $coupon, $items_to_apply ) {
|
||||
$total_discount = 0;
|
||||
$cart_total = 0;
|
||||
$total_discount = 0;
|
||||
$cart_total = 0;
|
||||
$limit_usage_qty = 0;
|
||||
$applied_count = 0;
|
||||
$adjust_final_discount = true;
|
||||
|
||||
if ( null !== $coupon->get_limit_usage_to_x_items() ) {
|
||||
$limit_usage_qty = $coupon->get_limit_usage_to_x_items();
|
||||
}
|
||||
|
||||
// Because get_amount() could return an empty string, let's be sure to set our local variable to a known good value.
|
||||
$coupon_amount = ( '' === $coupon->get_amount() ) ? 0 : $coupon->get_amount();
|
||||
|
@ -351,20 +340,27 @@ class WC_Discounts {
|
|||
// Get the price we actually want to discount, based on settings.
|
||||
$price_to_discount = ( 'yes' === get_option( 'woocommerce_calc_discounts_sequentially', 'no' ) ) ? $discounted_price : $item->price;
|
||||
|
||||
// Total up.
|
||||
$cart_total += $price_to_discount;
|
||||
// See how many and what price to apply to.
|
||||
$apply_quantity = max( 0, ( $limit_usage_qty && ( $limit_usage_qty - $applied_count ) < $item->quantity ? $limit_usage_qty - $applied_count : $item->quantity ) );
|
||||
$price_to_discount = ( $price_to_discount / $item->quantity ) * $apply_quantity;
|
||||
|
||||
// Run coupon calculations.
|
||||
$discount = floor( $price_to_discount * ( $coupon_amount / 100 ) );
|
||||
|
||||
if ( is_a( $this->object, 'WC_Cart' ) && has_filter( 'woocommerce_coupon_get_discount_amount' ) ) {
|
||||
// Send through the legacy filter, but not as cents.
|
||||
$discount = wc_add_number_precision( apply_filters( 'woocommerce_coupon_get_discount_amount', wc_remove_number_precision( $discount ), wc_remove_number_precision( $price_to_discount ), $item->object, false, $coupon ) );
|
||||
$filtered_discount = wc_add_number_precision( apply_filters( 'woocommerce_coupon_get_discount_amount', wc_remove_number_precision( $discount ), wc_remove_number_precision( $price_to_discount ), $item->object, false, $coupon ) );
|
||||
|
||||
if ( $filtered_discount !== $discount ) {
|
||||
$discount = $filtered_discount;
|
||||
$adjust_final_discount = false;
|
||||
}
|
||||
}
|
||||
|
||||
$discount = min( $discounted_price, $discount );
|
||||
|
||||
$total_discount += $discount;
|
||||
$discount = min( $discounted_price, $discount );
|
||||
$cart_total = $cart_total + $price_to_discount;
|
||||
$total_discount = $total_discount + $discount;
|
||||
$applied_count = $applied_count + $apply_quantity;
|
||||
|
||||
// Store code and discount amount per item.
|
||||
$this->discounts[ $coupon->get_code() ][ $item->key ] += $discount;
|
||||
|
@ -373,7 +369,7 @@ class WC_Discounts {
|
|||
// Work out how much discount would have been given to the cart as a whole and compare to what was discounted on all line items.
|
||||
$cart_total_discount = wc_cart_round_discount( $cart_total * ( $coupon_amount / 100 ), 0 );
|
||||
|
||||
if ( $total_discount < $cart_total_discount ) {
|
||||
if ( $total_discount < $cart_total_discount && $adjust_final_discount ) {
|
||||
$total_discount += $this->apply_coupon_remainder( $coupon, $items_to_apply, $cart_total_discount - $total_discount );
|
||||
}
|
||||
|
||||
|
@ -390,8 +386,14 @@ class WC_Discounts {
|
|||
* @return int Total discounted.
|
||||
*/
|
||||
protected function apply_coupon_fixed_product( $coupon, $items_to_apply, $amount = null ) {
|
||||
$total_discount = 0;
|
||||
$amount = $amount ? $amount : wc_add_number_precision( $coupon->get_amount() );
|
||||
$total_discount = 0;
|
||||
$amount = $amount ? $amount: wc_add_number_precision( $coupon->get_amount() );
|
||||
$limit_usage_qty = 0;
|
||||
$applied_count = 0;
|
||||
|
||||
if ( null !== $coupon->get_limit_usage_to_x_items() ) {
|
||||
$limit_usage_qty = $coupon->get_limit_usage_to_x_items();
|
||||
}
|
||||
|
||||
foreach ( $items_to_apply as $item ) {
|
||||
// Find out how much price is available to discount for the item.
|
||||
|
@ -401,15 +403,22 @@ class WC_Discounts {
|
|||
$price_to_discount = ( 'yes' === get_option( 'woocommerce_calc_discounts_sequentially', 'no' ) ) ? $discounted_price : $item->price;
|
||||
|
||||
// Run coupon calculations.
|
||||
$discount = $amount * $item->quantity;
|
||||
if ( $limit_usage_qty ) {
|
||||
$apply_quantity = max( 0, ( $limit_usage_qty - $applied_count < $item->quantity ? $limit_usage_qty - $applied_count: $item->quantity ) );
|
||||
$discount = min( $amount, $item->price / $item->quantity ) * $apply_quantity;
|
||||
} else {
|
||||
$apply_quantity = $item->quantity;
|
||||
$discount = $amount * $apply_quantity;
|
||||
}
|
||||
|
||||
if ( is_a( $this->object, 'WC_Cart' ) && has_filter( 'woocommerce_coupon_get_discount_amount' ) ) {
|
||||
// Send through the legacy filter, but not as cents.
|
||||
$discount = wc_add_number_precision( apply_filters( 'woocommerce_coupon_get_discount_amount', wc_remove_number_precision( $discount ), wc_remove_number_precision( $price_to_discount ), $item->object, false, $coupon ) );
|
||||
}
|
||||
|
||||
$discount = min( $discounted_price, $discount );
|
||||
$total_discount += $discount;
|
||||
$discount = min( $discounted_price, $discount );
|
||||
$total_discount = $total_discount + $discount;
|
||||
$applied_count = $applied_count + $apply_quantity;
|
||||
|
||||
// Store code and discount amount per item.
|
||||
$this->discounts[ $coupon->get_code() ][ $item->key ] += $discount;
|
||||
|
|
|
@ -928,11 +928,11 @@ class WC_Form_Handler {
|
|||
|
||||
try {
|
||||
$creds = array(
|
||||
'user_login' => trim( $_POST['username'] ),
|
||||
'user_password' => $_POST['password'],
|
||||
'remember' => isset( $_POST['rememberme'] ),
|
||||
);
|
||||
|
||||
$username = trim( $_POST['username'] );
|
||||
$validation_error = new WP_Error();
|
||||
$validation_error = apply_filters( 'woocommerce_process_login_errors', $validation_error, $_POST['username'], $_POST['password'] );
|
||||
|
||||
|
@ -940,29 +940,13 @@ class WC_Form_Handler {
|
|||
throw new Exception( '<strong>' . __( 'Error:', 'woocommerce' ) . '</strong> ' . $validation_error->get_error_message() );
|
||||
}
|
||||
|
||||
if ( empty( $username ) ) {
|
||||
if ( empty( $creds['user_login'] ) ) {
|
||||
throw new Exception( '<strong>' . __( 'Error:', 'woocommerce' ) . '</strong> ' . __( 'Username is required.', 'woocommerce' ) );
|
||||
}
|
||||
|
||||
if ( is_email( $username ) && apply_filters( 'woocommerce_get_username_from_email', true ) ) {
|
||||
$user = get_user_by( 'email', $username );
|
||||
|
||||
if ( ! $user ) {
|
||||
$user = get_user_by( 'login', $username );
|
||||
}
|
||||
|
||||
if ( isset( $user->user_login ) ) {
|
||||
$creds['user_login'] = $user->user_login;
|
||||
} else {
|
||||
throw new Exception( '<strong>' . __( 'Error:', 'woocommerce' ) . '</strong> ' . __( 'A user could not be found with this email address.', 'woocommerce' ) );
|
||||
}
|
||||
} else {
|
||||
$creds['user_login'] = $username;
|
||||
}
|
||||
|
||||
// On multisite, ensure user exists on current site, if not add them before allowing login.
|
||||
if ( is_multisite() ) {
|
||||
$user_data = get_user_by( 'login', $username );
|
||||
$user_data = get_user_by( is_email( $creds['user_login'] ) ? 'email' : 'login', $creds['user_login'] );
|
||||
|
||||
if ( $user_data && ! is_user_member_of_blog( $user_data->ID, get_current_blog_id() ) ) {
|
||||
add_user_to_blog( get_current_blog_id(), $user_data->ID, 'customer' );
|
||||
|
@ -974,7 +958,7 @@ class WC_Form_Handler {
|
|||
|
||||
if ( is_wp_error( $user ) ) {
|
||||
$message = $user->get_error_message();
|
||||
$message = str_replace( '<strong>' . esc_html( $creds['user_login'] ) . '</strong>', '<strong>' . esc_html( $username ) . '</strong>', $message );
|
||||
$message = str_replace( '<strong>' . esc_html( $creds['user_login'] ) . '</strong>', '<strong>' . esc_html( $creds['user_login'] ) . '</strong>', $message );
|
||||
throw new Exception( $message );
|
||||
} else {
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ class WC_Frontend_Scripts {
|
|||
'flexslider' => array(
|
||||
'src' => self::get_asset_url( 'assets/js/flexslider/jquery.flexslider' . $suffix . '.js' ),
|
||||
'deps' => array( 'jquery' ),
|
||||
'version' => '2.6.3',
|
||||
'version' => '2.6.1',
|
||||
),
|
||||
'js-cookie' => array(
|
||||
'src' => self::get_asset_url( 'assets/js/js-cookie/js.cookie' . $suffix . '.js' ),
|
||||
|
@ -234,7 +234,7 @@ class WC_Frontend_Scripts {
|
|||
'selectWoo' => array(
|
||||
'src' => self::get_asset_url( 'assets/js/selectWoo/selectWoo.full' . $suffix . '.js' ),
|
||||
'deps' => array( 'jquery' ),
|
||||
'version' => '1.0.0',
|
||||
'version' => '1.0.1',
|
||||
),
|
||||
'wc-address-i18n' => array(
|
||||
'src' => self::get_asset_url( 'assets/js/frontend/address-i18n' . $suffix . '.js' ),
|
||||
|
|
|
@ -124,6 +124,9 @@ class WC_Order extends WC_Abstract_Order {
|
|||
do_action( 'woocommerce_payment_complete_order_status_' . $this->get_status(), $this->get_id() );
|
||||
}
|
||||
} catch ( Exception $e ) {
|
||||
$logger = wc_get_logger();
|
||||
$logger->error( sprintf( 'Payment complete of order #%d failed!', $this->get_id() ), array( 'order' => $this, 'error' => $e ) );
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -294,6 +297,9 @@ class WC_Order extends WC_Abstract_Order {
|
|||
$this->set_status( $new_status, $note, $manual );
|
||||
$this->save();
|
||||
} catch ( Exception $e ) {
|
||||
$logger = wc_get_logger();
|
||||
$logger->error( sprintf( 'Update status of order #%d failed!', $this->get_id() ), array( 'order' => $this, 'error' => $e ) );
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -737,10 +737,21 @@ class WC_Tax {
|
|||
|
||||
/**
|
||||
* Get store tax classes.
|
||||
*
|
||||
* @return array Array of class names ("Reduced rate", "Zero rate", etc).
|
||||
*/
|
||||
public static function get_tax_classes() {
|
||||
return array_filter( array_map( 'trim', explode( "\n", get_option( 'woocommerce_tax_classes' ) ) ) );
|
||||
return array_filter( array_map( 'trim', explode( "\n", get_option( 'woocommerce_tax_classes' ) ) ), array( __CLASS__, 'is_valid_tax_class' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter out invalid tax classes.
|
||||
*
|
||||
* @param string $tax_class Tax class name.
|
||||
* @return boolean
|
||||
*/
|
||||
private static function is_valid_tax_class( $tax_class ) {
|
||||
return ! empty( $tax_class ) && sanitize_title( $tax_class );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -750,7 +761,7 @@ class WC_Tax {
|
|||
* @return array Array of class slugs ("reduced-rate", "zero-rate", etc).
|
||||
*/
|
||||
public static function get_tax_class_slugs() {
|
||||
return array_map( 'sanitize_title', self::get_tax_classes() );
|
||||
return array_filter( array_map( 'sanitize_title', self::get_tax_classes() ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -371,12 +371,12 @@ class WC_Tracker {
|
|||
foreach ( $files as $file ) {
|
||||
if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {
|
||||
$theme_file = get_stylesheet_directory() . '/' . $file;
|
||||
} elseif ( file_exists( get_stylesheet_directory() . '/woocommerce/' . $file ) ) {
|
||||
$theme_file = get_stylesheet_directory() . '/woocommerce/' . $file;
|
||||
} elseif ( file_exists( get_stylesheet_directory() . '/' . WC()->template_path() . $file ) ) {
|
||||
$theme_file = get_stylesheet_directory() . '/' . WC()->template_path() . $file;
|
||||
} elseif ( file_exists( get_template_directory() . '/' . $file ) ) {
|
||||
$theme_file = get_template_directory() . '/' . $file;
|
||||
} elseif ( file_exists( get_template_directory() . '/woocommerce/' . $file ) ) {
|
||||
$theme_file = get_template_directory() . '/woocommerce/' . $file;
|
||||
} elseif ( file_exists( get_template_directory() . '/' . WC()->template_path() . $file ) ) {
|
||||
$theme_file = get_template_directory() . '/' . WC()->template_path() . $file;
|
||||
} else {
|
||||
$theme_file = false;
|
||||
}
|
||||
|
|
|
@ -644,8 +644,9 @@ class WC_Order_Data_Store_CPT extends Abstract_WC_Order_Data_Store_CPT implement
|
|||
|
||||
// Remove any existing meta queries for the same keys to prevent conflicts.
|
||||
$existing_queries = wp_list_pluck( $wp_query_args['meta_query'], 'key', true );
|
||||
foreach ( $existing_queries as $query_index => $query_contents ) {
|
||||
unset( $wp_query_args['meta_query'][ $query_index ] );
|
||||
$meta_query_index = array_search( $db_key, $existing_queries );
|
||||
if ( false !== $meta_query_index ) {
|
||||
unset( $wp_query_args['meta_query'][ $meta_query_index ] );
|
||||
}
|
||||
|
||||
$wp_query_args = $this->parse_date_for_wp_query( $query_vars[ $query_var_key ], $db_key, $wp_query_args );
|
||||
|
|
|
@ -696,6 +696,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
|
|||
}
|
||||
}
|
||||
update_post_meta( $product->get_id(), '_product_attributes', $meta_values );
|
||||
delete_transient( 'wc_layered_nav_counts' );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -760,6 +761,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
|
|||
*/
|
||||
protected function clear_caches( &$product ) {
|
||||
wc_delete_product_transients( $product->get_id() );
|
||||
WC_Cache_Helper::incr_cache_prefix( 'product_' . $product->get_id() );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -45,20 +45,7 @@ class WC_Product_Grouped_Data_Store_CPT extends WC_Product_Data_Store_CPT implem
|
|||
*/
|
||||
protected function handle_updated_props( &$product ) {
|
||||
if ( in_array( 'children', $this->updated_props ) ) {
|
||||
$child_prices = array();
|
||||
foreach ( $product->get_children( 'edit' ) as $child_id ) {
|
||||
$child = wc_get_product( $child_id );
|
||||
if ( $child ) {
|
||||
$child_prices[] = $child->get_price();
|
||||
}
|
||||
}
|
||||
$child_prices = array_filter( $child_prices );
|
||||
delete_post_meta( $product->get_id(), '_price' );
|
||||
|
||||
if ( ! empty( $child_prices ) ) {
|
||||
add_post_meta( $product->get_id(), '_price', min( $child_prices ) );
|
||||
add_post_meta( $product->get_id(), '_price', max( $child_prices ) );
|
||||
}
|
||||
$this->update_prices_from_children( $product );
|
||||
}
|
||||
parent::handle_updated_props( $product );
|
||||
}
|
||||
|
@ -70,24 +57,28 @@ class WC_Product_Grouped_Data_Store_CPT extends WC_Product_Data_Store_CPT implem
|
|||
* @param WC_Product|int $product
|
||||
*/
|
||||
public function sync_price( &$product ) {
|
||||
global $wpdb;
|
||||
$this->update_prices_from_children( $product );
|
||||
}
|
||||
|
||||
$children_ids = get_posts( array(
|
||||
'post_parent' => $product->get_id(),
|
||||
'post_type' => 'product',
|
||||
'fields' => 'ids',
|
||||
) );
|
||||
$prices = $children_ids ? array_unique( $wpdb->get_col( "SELECT meta_value FROM $wpdb->postmeta WHERE meta_key = '_price' AND post_id IN ( " . implode( ',', array_map( 'absint', $children_ids ) ) . " )" ) ) : array();
|
||||
|
||||
delete_post_meta( $product->get_id(), '_price' );
|
||||
delete_transient( 'wc_var_prices_' . $product->get_id() );
|
||||
|
||||
if ( $prices ) {
|
||||
sort( $prices );
|
||||
// To allow sorting and filtering by multiple values, we have no choice but to store child prices in this manner.
|
||||
foreach ( $prices as $price ) {
|
||||
add_post_meta( $product->get_id(), '_price', $price, false );
|
||||
/**
|
||||
* Loop over child products and update the grouped product prices.
|
||||
*
|
||||
* @param WC_Product $product Product object.
|
||||
*/
|
||||
protected function update_prices_from_children( &$product ) {
|
||||
$child_prices = array();
|
||||
foreach ( $product->get_children( 'edit' ) as $child_id ) {
|
||||
$child = wc_get_product( $child_id );
|
||||
if ( $child ) {
|
||||
$child_prices[] = $child->get_price();
|
||||
}
|
||||
}
|
||||
$child_prices = array_filter( $child_prices );
|
||||
delete_post_meta( $product->get_id(), '_price' );
|
||||
|
||||
if ( ! empty( $child_prices ) ) {
|
||||
add_post_meta( $product->get_id(), '_price', min( $child_prices ) );
|
||||
add_post_meta( $product->get_id(), '_price', max( $child_prices ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,6 +72,8 @@ class WC_Email_Cancelled_Order extends WC_Email {
|
|||
* @param WC_Order $order Order object.
|
||||
*/
|
||||
public function trigger( $order_id, $order = false ) {
|
||||
$this->setup_locale();
|
||||
|
||||
if ( $order_id && ! is_a( $order, 'WC_Order' ) ) {
|
||||
$order = wc_get_order( $order_id );
|
||||
}
|
||||
|
@ -82,12 +84,10 @@ class WC_Email_Cancelled_Order extends WC_Email {
|
|||
$this->placeholders['{order_number}'] = $this->object->get_order_number();
|
||||
}
|
||||
|
||||
if ( ! $this->is_enabled() || ! $this->get_recipient() ) {
|
||||
return;
|
||||
if ( $this->is_enabled() && $this->get_recipient() ) {
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
}
|
||||
|
||||
$this->setup_locale();
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
$this->restore_locale();
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,8 @@ class WC_Email_Customer_Completed_Order extends WC_Email {
|
|||
* @param WC_Order $order Order object.
|
||||
*/
|
||||
public function trigger( $order_id, $order = false ) {
|
||||
$this->setup_locale();
|
||||
|
||||
if ( $order_id && ! is_a( $order, 'WC_Order' ) ) {
|
||||
$order = wc_get_order( $order_id );
|
||||
}
|
||||
|
@ -60,12 +62,10 @@ class WC_Email_Customer_Completed_Order extends WC_Email {
|
|||
$this->placeholders['{order_number}'] = $this->object->get_order_number();
|
||||
}
|
||||
|
||||
if ( ! $this->is_enabled() || ! $this->get_recipient() ) {
|
||||
return;
|
||||
if ( $this->is_enabled() && $this->get_recipient() ) {
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
}
|
||||
|
||||
$this->setup_locale();
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
$this->restore_locale();
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ class WC_Email_Customer_Invoice extends WC_Email {
|
|||
if ( $paid ) {
|
||||
return __( 'Your {site_title} order from {order_date}', 'woocommerce' );
|
||||
} else {
|
||||
return __( 'Invoice for order {order_number} from {order_date}', 'woocommerce' );
|
||||
return __( 'Invoice for order {order_number}', 'woocommerce' );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ class WC_Email_Customer_Invoice extends WC_Email {
|
|||
*/
|
||||
public function get_default_heading( $paid = false ) {
|
||||
if ( $paid ) {
|
||||
return __( 'Order {order_number} details', 'woocommerce' );
|
||||
return __( 'Your order details', 'woocommerce' );
|
||||
} else {
|
||||
return __( 'Invoice for order {order_number}', 'woocommerce' );
|
||||
}
|
||||
|
@ -110,6 +110,8 @@ class WC_Email_Customer_Invoice extends WC_Email {
|
|||
* @param WC_Order $order Order object.
|
||||
*/
|
||||
public function trigger( $order_id, $order = false ) {
|
||||
$this->setup_locale();
|
||||
|
||||
if ( $order_id && ! is_a( $order, 'WC_Order' ) ) {
|
||||
$order = wc_get_order( $order_id );
|
||||
}
|
||||
|
@ -121,12 +123,10 @@ class WC_Email_Customer_Invoice extends WC_Email {
|
|||
$this->placeholders['{order_number}'] = $this->object->get_order_number();
|
||||
}
|
||||
|
||||
if ( ! $this->get_recipient() ) {
|
||||
return;
|
||||
if ( $this->get_recipient() ) {
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
}
|
||||
|
||||
$this->setup_locale();
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
$this->restore_locale();
|
||||
}
|
||||
|
||||
|
|
|
@ -90,6 +90,7 @@ class WC_Email_Customer_New_Account extends WC_Email {
|
|||
* @param bool $password_generated
|
||||
*/
|
||||
public function trigger( $user_id, $user_pass = '', $password_generated = false ) {
|
||||
$this->setup_locale();
|
||||
|
||||
if ( $user_id ) {
|
||||
$this->object = new WP_User( $user_id );
|
||||
|
@ -101,12 +102,10 @@ class WC_Email_Customer_New_Account extends WC_Email {
|
|||
$this->password_generated = $password_generated;
|
||||
}
|
||||
|
||||
if ( ! $this->is_enabled() || ! $this->get_recipient() ) {
|
||||
return;
|
||||
if ( $this->is_enabled() && $this->get_recipient() ) {
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
}
|
||||
|
||||
$this->setup_locale();
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
$this->restore_locale();
|
||||
}
|
||||
|
||||
|
|
|
@ -75,6 +75,8 @@ class WC_Email_Customer_Note extends WC_Email {
|
|||
* @param array $args
|
||||
*/
|
||||
public function trigger( $args ) {
|
||||
$this->setup_locale();
|
||||
|
||||
if ( ! empty( $args ) ) {
|
||||
$defaults = array(
|
||||
'order_id' => '',
|
||||
|
@ -90,17 +92,13 @@ class WC_Email_Customer_Note extends WC_Email {
|
|||
$this->customer_note = $customer_note;
|
||||
$this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() );
|
||||
$this->placeholders['{order_number}'] = $this->object->get_order_number();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->is_enabled() || ! $this->get_recipient() ) {
|
||||
return;
|
||||
if ( $this->is_enabled() && $this->get_recipient() ) {
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
}
|
||||
|
||||
$this->setup_locale();
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
$this->restore_locale();
|
||||
}
|
||||
|
||||
|
|
|
@ -70,6 +70,8 @@ class WC_Email_Customer_On_Hold_Order extends WC_Email {
|
|||
* @param WC_Order $order Order object.
|
||||
*/
|
||||
public function trigger( $order_id, $order = false ) {
|
||||
$this->setup_locale();
|
||||
|
||||
if ( $order_id && ! is_a( $order, 'WC_Order' ) ) {
|
||||
$order = wc_get_order( $order_id );
|
||||
}
|
||||
|
@ -81,12 +83,10 @@ class WC_Email_Customer_On_Hold_Order extends WC_Email {
|
|||
$this->placeholders['{order_number}'] = $this->object->get_order_number();
|
||||
}
|
||||
|
||||
if ( ! $this->is_enabled() || ! $this->get_recipient() ) {
|
||||
return;
|
||||
if ( $this->is_enabled() && $this->get_recipient() ) {
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
}
|
||||
|
||||
$this->setup_locale();
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
$this->restore_locale();
|
||||
}
|
||||
|
||||
|
|
|
@ -72,6 +72,8 @@ class WC_Email_Customer_Processing_Order extends WC_Email {
|
|||
* @param WC_Order $order Order object.
|
||||
*/
|
||||
public function trigger( $order_id, $order = false ) {
|
||||
$this->setup_locale();
|
||||
|
||||
if ( $order_id && ! is_a( $order, 'WC_Order' ) ) {
|
||||
$order = wc_get_order( $order_id );
|
||||
}
|
||||
|
@ -83,12 +85,10 @@ class WC_Email_Customer_Processing_Order extends WC_Email {
|
|||
$this->placeholders['{order_number}'] = $this->object->get_order_number();
|
||||
}
|
||||
|
||||
if ( ! $this->is_enabled() || ! $this->get_recipient() ) {
|
||||
return;
|
||||
if ( $this->is_enabled() && $this->get_recipient() ) {
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
}
|
||||
|
||||
$this->setup_locale();
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
$this->restore_locale();
|
||||
}
|
||||
|
||||
|
|
|
@ -149,6 +149,7 @@ class WC_Email_Customer_Refunded_Order extends WC_Email {
|
|||
* @param int $refund_id
|
||||
*/
|
||||
public function trigger( $order_id, $partial_refund = false, $refund_id = null ) {
|
||||
$this->setup_locale();
|
||||
$this->partial_refund = $partial_refund;
|
||||
$this->id = $this->partial_refund ? 'customer_partially_refunded_order' : 'customer_refunded_order';
|
||||
|
||||
|
@ -165,12 +166,10 @@ class WC_Email_Customer_Refunded_Order extends WC_Email {
|
|||
$this->refund = false;
|
||||
}
|
||||
|
||||
if ( ! $this->is_enabled() || ! $this->get_recipient() ) {
|
||||
return;
|
||||
if ( $this->is_enabled() && $this->get_recipient() ) {
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
}
|
||||
|
||||
$this->setup_locale();
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
$this->restore_locale();
|
||||
}
|
||||
|
||||
|
|
|
@ -88,21 +88,20 @@ class WC_Email_Customer_Reset_Password extends WC_Email {
|
|||
* @param string $reset_key
|
||||
*/
|
||||
public function trigger( $user_login = '', $reset_key = '' ) {
|
||||
$this->setup_locale();
|
||||
|
||||
if ( $user_login && $reset_key ) {
|
||||
$this->object = get_user_by( 'login', $user_login );
|
||||
|
||||
$this->user_login = $user_login;
|
||||
$this->reset_key = $reset_key;
|
||||
$this->user_email = stripslashes( $this->object->user_email );
|
||||
$this->recipient = $this->user_email;
|
||||
}
|
||||
|
||||
if ( ! $this->is_enabled() || ! $this->get_recipient() ) {
|
||||
return;
|
||||
if ( $this->is_enabled() && $this->get_recipient() ) {
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
}
|
||||
|
||||
$this->setup_locale();
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
$this->restore_locale();
|
||||
}
|
||||
|
||||
|
|
|
@ -72,6 +72,8 @@ class WC_Email_Failed_Order extends WC_Email {
|
|||
* @param WC_Order $order Order object.
|
||||
*/
|
||||
public function trigger( $order_id, $order = false ) {
|
||||
$this->setup_locale();
|
||||
|
||||
if ( $order_id && ! is_a( $order, 'WC_Order' ) ) {
|
||||
$order = wc_get_order( $order_id );
|
||||
}
|
||||
|
@ -82,12 +84,10 @@ class WC_Email_Failed_Order extends WC_Email {
|
|||
$this->placeholders['{order_number}'] = $this->object->get_order_number();
|
||||
}
|
||||
|
||||
if ( ! $this->is_enabled() || ! $this->get_recipient() ) {
|
||||
return;
|
||||
if ( $this->is_enabled() && $this->get_recipient() ) {
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
}
|
||||
|
||||
$this->setup_locale();
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
$this->restore_locale();
|
||||
}
|
||||
|
||||
|
|
|
@ -76,6 +76,8 @@ class WC_Email_New_Order extends WC_Email {
|
|||
* @param WC_Order $order Order object.
|
||||
*/
|
||||
public function trigger( $order_id, $order = false ) {
|
||||
$this->setup_locale();
|
||||
|
||||
if ( $order_id && ! is_a( $order, 'WC_Order' ) ) {
|
||||
$order = wc_get_order( $order_id );
|
||||
}
|
||||
|
@ -86,12 +88,10 @@ class WC_Email_New_Order extends WC_Email {
|
|||
$this->placeholders['{order_number}'] = $this->object->get_order_number();
|
||||
}
|
||||
|
||||
if ( ! $this->is_enabled() || ! $this->get_recipient() ) {
|
||||
return;
|
||||
if ( $this->is_enabled() && $this->get_recipient() ) {
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
}
|
||||
|
||||
$this->setup_locale();
|
||||
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
||||
$this->restore_locale();
|
||||
}
|
||||
|
||||
|
|
|
@ -261,6 +261,10 @@ class WC_Email extends WC_Settings_API {
|
|||
$find = array_merge( (array) $this->find, $find );
|
||||
$replace = array_merge( (array) $this->replace, $replace );
|
||||
|
||||
// Take care of blogname which is no longer defined as a valid placeholder.
|
||||
$find[] = '{blogname}';
|
||||
$replace[] = $this->get_blogname();
|
||||
|
||||
// If using the older style filters for find and replace, ensure the array is associative and then pass through filters. @todo deprecate in 4.0.0.
|
||||
if ( has_filter( 'woocommerce_email_format_string_replace' ) || has_filter( 'woocommerce_email_format_string_find' ) ) {
|
||||
$legacy_find = $this->find;
|
||||
|
@ -657,7 +661,7 @@ class WC_Email extends WC_Settings_API {
|
|||
protected function save_template( $template_code, $template_path ) {
|
||||
if ( current_user_can( 'edit_themes' ) && ! empty( $template_code ) && ! empty( $template_path ) ) {
|
||||
$saved = false;
|
||||
$file = get_stylesheet_directory() . '/woocommerce/' . $template_path;
|
||||
$file = get_stylesheet_directory() . '/' . WC()->template_path() . $template_path;
|
||||
$code = wp_unslash( $template_code );
|
||||
|
||||
if ( is_writeable( $file ) ) {
|
||||
|
|
|
@ -494,7 +494,7 @@ class WC_Product_CSV_Exporter extends WC_CSV_Batch_Exporter {
|
|||
|
||||
if ( 0 === strpos( $attribute_name, 'pa_' ) ) {
|
||||
$option_term = get_term_by( 'slug', $attribute, $attribute_name );
|
||||
$row[ 'attributes:value' . $i ] = $option_term && ! is_wp_error( $option_term ) ? $option_term->name : $attribute;
|
||||
$row[ 'attributes:value' . $i ] = $option_term && ! is_wp_error( $option_term ) ? str_replace( ',', '\\,', $option_term->name ) : $attribute;
|
||||
$row[ 'attributes:taxonomy' . $i ] = 1;
|
||||
} else {
|
||||
$row[ 'attributes:value' . $i ] = $attribute;
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
jQuery( function( $ ) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Object to handle PayPal admin functions.
|
||||
*/
|
||||
var wc_paypal_admin = {
|
||||
isTestMode: function() {
|
||||
return $( '#woocommerce_paypal_testmode' ).is( ':checked' );
|
||||
},
|
||||
|
||||
/**
|
||||
* Initialize.
|
||||
*/
|
||||
init: function() {
|
||||
$( document.body ).on( 'change', '#woocommerce_paypal_testmode', function() {
|
||||
var test_api_username = $( '#woocommerce_paypal_sandbox_api_username' ).parents( 'tr' ).eq( 0 ),
|
||||
test_api_password = $( '#woocommerce_paypal_sandbox_api_password' ).parents( 'tr' ).eq( 0 ),
|
||||
test_api_signature = $( '#woocommerce_paypal_sandbox_api_signature' ).parents( 'tr' ).eq( 0 ),
|
||||
live_api_username = $( '#woocommerce_paypal_api_username' ).parents( 'tr' ).eq( 0 ),
|
||||
live_api_password = $( '#woocommerce_paypal_api_password' ).parents( 'tr' ).eq( 0 ),
|
||||
live_api_signature = $( '#woocommerce_paypal_api_signature' ).parents( 'tr' ).eq( 0 );
|
||||
|
||||
if ( $( this ).is( ':checked' ) ) {
|
||||
test_api_username.show();
|
||||
test_api_password.show();
|
||||
test_api_signature.show();
|
||||
live_api_username.hide();
|
||||
live_api_password.hide();
|
||||
live_api_signature.hide();
|
||||
} else {
|
||||
test_api_username.hide();
|
||||
test_api_password.hide();
|
||||
test_api_signature.hide();
|
||||
live_api_username.show();
|
||||
live_api_password.show();
|
||||
live_api_signature.show();
|
||||
}
|
||||
} );
|
||||
|
||||
$( '#woocommerce_paypal_testmode' ).change();
|
||||
}
|
||||
};
|
||||
|
||||
wc_paypal_admin.init();
|
||||
});
|
|
@ -0,0 +1 @@
|
|||
jQuery(function($){'use strict';var wc_paypal_admin={isTestMode:function(){return $('#woocommerce_paypal_testmode').is(':checked')},init:function(){$(document.body).on('change','#woocommerce_paypal_testmode',function(){var test_api_username=$('#woocommerce_paypal_sandbox_api_username').parents('tr').eq(0),test_api_password=$('#woocommerce_paypal_sandbox_api_password').parents('tr').eq(0),test_api_signature=$('#woocommerce_paypal_sandbox_api_signature').parents('tr').eq(0),live_api_username=$('#woocommerce_paypal_api_username').parents('tr').eq(0),live_api_password=$('#woocommerce_paypal_api_password').parents('tr').eq(0),live_api_signature=$('#woocommerce_paypal_api_signature').parents('tr').eq(0);if($(this).is(':checked')){test_api_username.show();test_api_password.show();test_api_signature.show();live_api_username.hide();live_api_password.hide();live_api_signature.hide()}else{test_api_username.hide();test_api_password.hide();test_api_signature.hide();live_api_username.show();live_api_password.show();live_api_signature.show()}});$('#woocommerce_paypal_testmode').change()}};wc_paypal_admin.init()})
|
|
@ -55,6 +55,12 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
|
|||
|
||||
self::$log_enabled = $this->debug;
|
||||
|
||||
if ( $this->testmode ) {
|
||||
$this->description .= ' ' . sprintf( __( 'SANDBOX ENABLED. You can use sandbox testing accounts only. See the <a href="%s">PayPal Sandbox Testing Guide</a> for more details.', 'woocommerce' ), 'https://developer.paypal.com/docs/classic/lifecycle/ug_sandbox/' );
|
||||
$this->description = trim( $this->description );
|
||||
}
|
||||
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
|
||||
add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
|
||||
add_action( 'woocommerce_order_status_on-hold_to_processing', array( $this, 'capture_payment' ) );
|
||||
add_action( 'woocommerce_order_status_on-hold_to_completed', array( $this, 'capture_payment' ) );
|
||||
|
@ -271,9 +277,9 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
|
|||
protected function init_api() {
|
||||
include_once( dirname( __FILE__ ) . '/includes/class-wc-gateway-paypal-api-handler.php' );
|
||||
|
||||
WC_Gateway_Paypal_API_Handler::$api_username = $this->get_option( 'api_username' );
|
||||
WC_Gateway_Paypal_API_Handler::$api_password = $this->get_option( 'api_password' );
|
||||
WC_Gateway_Paypal_API_Handler::$api_signature = $this->get_option( 'api_signature' );
|
||||
WC_Gateway_Paypal_API_Handler::$api_username = $this->testmode ? $this->get_option( 'sandbox_api_username' ) : $this->get_option( 'api_username' );
|
||||
WC_Gateway_Paypal_API_Handler::$api_password = $this->testmode ? $this->get_option( 'sandbox_api_password' ) : $this->get_option( 'api_password' );
|
||||
WC_Gateway_Paypal_API_Handler::$api_signature = $this->testmode ? $this->get_option( 'sandbox_api_signature' ) : $this->get_option( 'api_signature' );
|
||||
WC_Gateway_Paypal_API_Handler::$sandbox = $this->testmode;
|
||||
}
|
||||
|
||||
|
@ -348,4 +354,22 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load admin scripts.
|
||||
*
|
||||
* @since 3.3.0
|
||||
*/
|
||||
public function admin_scripts() {
|
||||
$screen = get_current_screen();
|
||||
$screen_id = $screen ? $screen->id: '';
|
||||
|
||||
if ( 'woocommerce_page_wc-settings' !== $screen_id ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
||||
|
||||
wp_enqueue_script( 'woocommerce_paypal_admin', WC()->plugin_url() . '/includes/gateways/paypal/assets/js/paypal-admin' . $suffix . '.js', array(), WC_VERSION, true );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ return array(
|
|||
'description' => sprintf( __( 'Enter your PayPal API credentials to process refunds via PayPal. Learn how to access your <a href="%s">PayPal API Credentials</a>.', 'woocommerce' ), 'https://developer.paypal.com/webapps/developer/docs/classic/api/apiCredentials/#creating-an-api-signature' ),
|
||||
),
|
||||
'api_username' => array(
|
||||
'title' => __( 'API username', 'woocommerce' ),
|
||||
'title' => __( 'Live API username', 'woocommerce' ),
|
||||
'type' => 'text',
|
||||
'description' => __( 'Get your API credentials from PayPal.', 'woocommerce' ),
|
||||
'default' => '',
|
||||
|
@ -134,7 +134,7 @@ return array(
|
|||
'placeholder' => __( 'Optional', 'woocommerce' ),
|
||||
),
|
||||
'api_password' => array(
|
||||
'title' => __( 'API password', 'woocommerce' ),
|
||||
'title' => __( 'Live API password', 'woocommerce' ),
|
||||
'type' => 'password',
|
||||
'description' => __( 'Get your API credentials from PayPal.', 'woocommerce' ),
|
||||
'default' => '',
|
||||
|
@ -142,7 +142,31 @@ return array(
|
|||
'placeholder' => __( 'Optional', 'woocommerce' ),
|
||||
),
|
||||
'api_signature' => array(
|
||||
'title' => __( 'API signature', 'woocommerce' ),
|
||||
'title' => __( 'Live API signature', 'woocommerce' ),
|
||||
'type' => 'text',
|
||||
'description' => __( 'Get your API credentials from PayPal.', 'woocommerce' ),
|
||||
'default' => '',
|
||||
'desc_tip' => true,
|
||||
'placeholder' => __( 'Optional', 'woocommerce' ),
|
||||
),
|
||||
'sandbox_api_username' => array(
|
||||
'title' => __( 'Sandbox API username', 'woocommerce' ),
|
||||
'type' => 'text',
|
||||
'description' => __( 'Get your API credentials from PayPal.', 'woocommerce' ),
|
||||
'default' => '',
|
||||
'desc_tip' => true,
|
||||
'placeholder' => __( 'Optional', 'woocommerce' ),
|
||||
),
|
||||
'sandbox_api_password' => array(
|
||||
'title' => __( 'Sandbox API password', 'woocommerce' ),
|
||||
'type' => 'password',
|
||||
'description' => __( 'Get your API credentials from PayPal.', 'woocommerce' ),
|
||||
'default' => '',
|
||||
'desc_tip' => true,
|
||||
'placeholder' => __( 'Optional', 'woocommerce' ),
|
||||
),
|
||||
'sandbox_api_signature' => array(
|
||||
'title' => __( 'Sandbox API signature', 'woocommerce' ),
|
||||
'type' => 'text',
|
||||
'description' => __( 'Get your API credentials from PayPal.', 'woocommerce' ),
|
||||
'default' => '',
|
||||
|
|
|
@ -500,25 +500,38 @@ abstract class WC_Product_Importer implements WC_Importer_Interface {
|
|||
}
|
||||
|
||||
$id = 0;
|
||||
$upload_dir = wp_upload_dir();
|
||||
$upload_dir = wp_upload_dir( null, false );
|
||||
$base_url = $upload_dir['baseurl'] . '/';
|
||||
|
||||
// Check first if attachment is on WordPress uploads directory.
|
||||
if ( false !== strpos( $url, $base_url ) ) {
|
||||
// Search for yyyy/mm/slug.extension.
|
||||
// Check first if attachment is inside the WordPress uploads directory, or we're given a filename only.
|
||||
if ( false !== strpos( $url, $base_url ) || false === strpos( $url, '://' ) ) {
|
||||
// Search for yyyy/mm/slug.extension or slug.extension - remove the base URL.
|
||||
$file = str_replace( $base_url, '', $url );
|
||||
$args = array(
|
||||
'post_type' => 'attachment',
|
||||
'post_status' => 'any',
|
||||
'fields' => 'ids',
|
||||
'meta_query' => array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'value' => str_replace( $base_url, '', $url ),
|
||||
'compare' => 'LIKE',
|
||||
'key' => '_wp_attached_file',
|
||||
'value' => '^' . $file,
|
||||
'compare' => 'REGEXP',
|
||||
),
|
||||
array(
|
||||
'key' => '_wp_attached_file',
|
||||
'value' => '/' . $file,
|
||||
'compare' => 'LIKE',
|
||||
),
|
||||
array(
|
||||
'key' => '_wc_attachment_source',
|
||||
'value' => '/' . $file,
|
||||
'compare' => 'LIKE',
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
// This is an external URL, so compare to source.
|
||||
$args = array(
|
||||
'post_type' => 'attachment',
|
||||
'post_status' => 'any',
|
||||
|
|
|
@ -480,6 +480,23 @@ class WC_Product_CSV_Importer extends WC_Product_Importer {
|
|||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse download file urls, we should allow shortcodes here.
|
||||
*
|
||||
* Allow shortcodes if present, othersiwe esc_url the value.
|
||||
*
|
||||
* @param string $value Field value.
|
||||
* @return string
|
||||
*/
|
||||
public function parse_download_file_field( $value ) {
|
||||
// Absolute file paths.
|
||||
if ( 0 === strpos( $value, 'http' ) ) {
|
||||
return esc_url_raw( $value );
|
||||
}
|
||||
// Relative and shortcode paths.
|
||||
return wc_clean( $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get formatting callback.
|
||||
*
|
||||
|
@ -535,7 +552,7 @@ class WC_Product_CSV_Importer extends WC_Product_Importer {
|
|||
'/attributes:value*/' => array( $this, 'parse_comma_field' ),
|
||||
'/attributes:visible*/' => array( $this, 'parse_bool_field' ),
|
||||
'/attributes:taxonomy*/' => array( $this, 'parse_bool_field' ),
|
||||
'/downloads:url*/' => 'esc_url',
|
||||
'/downloads:url*/' => array( $this, 'parse_download_file_field' ),
|
||||
'/meta:*/' => 'wp_kses_post', // Allow some HTML in meta fields.
|
||||
);
|
||||
|
||||
|
|
|
@ -79,6 +79,7 @@ abstract class WC_Legacy_Cart {
|
|||
break;
|
||||
case 'prices_include_tax' :
|
||||
$value = wc_prices_include_tax();
|
||||
break;
|
||||
case 'round_at_subtotal' :
|
||||
$value = 'yes' === get_option( 'woocommerce_tax_round_at_subtotal' );
|
||||
break;
|
||||
|
@ -142,10 +143,17 @@ abstract class WC_Legacy_Cart {
|
|||
$value = &$this->coupon_discount_tax_totals;
|
||||
break;
|
||||
case 'fees' :
|
||||
$this->fees = $this->get_fees();
|
||||
wc_deprecated_function( 'WC_Cart->fees', '3.2', sprintf( 'the fees API (%s)', 'WC_Cart::get_fees' ) );
|
||||
|
||||
// Grab fees from the new API.
|
||||
$new_fees = $this->fees_api()->get_fees();
|
||||
|
||||
// Add new fees to the legacy prop so it can be adjusted via legacy property.
|
||||
$this->fees = $new_fees;
|
||||
|
||||
// Return by reference.
|
||||
$value = &$this->fees;
|
||||
break;
|
||||
|
||||
// Deprecated args. TODO: Remove in 4.0.
|
||||
case 'tax' :
|
||||
wc_deprecated_argument( 'WC_Cart->tax', '2.3', 'Use WC_Tax directly' );
|
||||
|
@ -212,7 +220,8 @@ abstract class WC_Legacy_Cart {
|
|||
$this->set_coupon_discount_tax_totals( $value );
|
||||
break;
|
||||
case 'fees' :
|
||||
$this->fees_api->set_fees( $value );
|
||||
wc_deprecated_function( 'WC_Cart->fees', '3.2', sprintf( 'the fees API (%s)', 'WC_Cart::add_fee' ) );
|
||||
$this->fees = $value;
|
||||
break;
|
||||
default :
|
||||
$this->$name = $value;
|
||||
|
|
|
@ -38,8 +38,8 @@ class WC_Shortcode_Cart {
|
|||
WC()->customer->set_location( $country, $state, $postcode, $city );
|
||||
WC()->customer->set_shipping_location( $country, $state, $postcode, $city );
|
||||
} else {
|
||||
WC()->customer->set_to_base();
|
||||
WC()->customer->set_shipping_to_base();
|
||||
WC()->customer->set_billing_address_to_base();
|
||||
WC()->customer->set_shipping_address_to_base();
|
||||
}
|
||||
|
||||
WC()->customer->set_calculated_shipping( true );
|
||||
|
|
|
@ -220,8 +220,6 @@ class WC_Shortcode_My_Account {
|
|||
'key' => $rp_key,
|
||||
'login' => $rp_login,
|
||||
) );
|
||||
} else {
|
||||
self::set_reset_password_cookie();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -327,8 +325,7 @@ class WC_Shortcode_My_Account {
|
|||
$user = check_password_reset_key( $key, $login );
|
||||
|
||||
if ( is_wp_error( $user ) ) {
|
||||
wc_add_notice( $user->get_error_message(), 'error' );
|
||||
|
||||
wc_add_notice( __( 'This key is invalid or has already been used. Please reset your password again if needed.', 'woocommerce' ), 'error' );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue