diff --git a/.gitignore b/.gitignore index 2ba87075ebf..dc90fddabe1 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,5 @@ Thumbs.db # Logs /logs + +/vendor/ diff --git a/assets/css/admin.css b/assets/css/admin.css index 973dea007aa..9fb04c9b1dd 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -1 +1 @@ -@charset "UTF-8";.button.wc-reload:after,.woocommerce-help-tip:after{speak:none;text-transform:none;-webkit-font-smoothing:antialiased}@-webkit-keyframes spin{100%{-webkit-transform:rotate(360deg)}}@-moz-keyframes spin{100%{-moz-transform:rotate(360deg)}}@keyframes spin{100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-ms-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}.select2-container{margin:0;position:relative;display:block!important;zoom:1;vertical-align:middle}.select2-container,.select2-drop,.select2-search,.select2-search input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.select2-container .select2-choice{display:block;padding:0 0 0 8px;overflow:hidden;position:relative;border:1px solid #ccc;white-space:nowrap;color:#444;text-decoration:none;border-radius:3px;background-clip:padding-box;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#fff;font-weight:400}html[dir=rtl] .select2-container .select2-choice{padding:0 8px 0 0}.select2-container.select2-drop-above .select2-choice{border-bottom-color:#ccc;border-radius:0 0 4px 4px}.select2-container.select2-allowclear .select2-choice .select2-chosen{margin-right:42px}.select2-container .select2-choice>.select2-chosen{margin-right:26px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;float:none;width:auto}html[dir=rtl] .select2-container .select2-choice>.select2-chosen{margin-left:26px;margin-right:0}.select2-container .select2-choice abbr{display:none;width:12px;height:12px;position:absolute;right:24px;top:5px;font-size:1px;text-decoration:none;border:0;background:url(../images/select2.png) right top no-repeat;cursor:pointer;outline:0}.select2-container.select2-allowclear .select2-choice abbr{display:inline-block}.select2-container .select2-choice abbr:hover{background-position:right -11px;cursor:pointer}.select2-drop-mask{border:0;margin:0;padding:0;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:9998;background-color:#fff;filter:alpha(opacity=0)}.select2-drop{width:100%;margin-top:-1px;position:absolute;top:100%;background:#fff;color:#000;border:1px solid #ccc;border-top:0;border-radius:0 0 3px 3px}.select2-drop.select2-drop-above{margin-top:1px;border-top:1px solid #ccc;border-bottom:0;border-radius:3px 3px 0 0}.select2-drop-active{border:1px solid #666;border-top:none}.select2-drop.select2-drop-above.select2-drop-active{border-top:1px solid #666}.select2-drop-auto-width{border-top:1px solid #ccc;width:auto}.select2-drop-auto-width .select2-search{padding-top:4px}.select2-container .select2-choice .select2-arrow{display:inline-block;width:18px;height:100%;position:absolute;right:0;top:0;border-radius:0 3px 3px 0;background-clip:padding-box}html[dir=rtl] .select2-container .select2-choice .select2-arrow{left:0;right:auto;border-radius:3px 0 0 3px}.select2-container .select2-choice .select2-arrow b{display:block;width:100%;height:100%;position:relative}.select2-container .select2-choice .select2-arrow b:after{position:absolute;display:block;content:"";top:50%;left:50%;border:4px solid transparent;border-top-color:#666;margin-left:-7px;margin-top:-2px}.select2-search{display:inline-block;width:100%;margin:0;padding-left:4px;padding-right:4px;position:relative;z-index:10000;white-space:nowrap;padding-bottom:4px}.select2-search input{width:100%;height:auto!important;padding:4px 20px 4px 5px!important;margin:0;outline:0;font-family:sans-serif;font-size:1em;border:1px solid #ccc;-webkit-box-shadow:none;box-shadow:none;background:url(../images/select2.png) 100% -22px no-repeat #fff}html[dir=rtl] .select2-search input{padding:4px 5px 4px 20px;background:url(../images/select2.png) -37px -22px no-repeat #fff}.select2-drop.select2-drop-above .select2-search input{margin-top:4px}.select2-search input.select2-active{background:url(../images/select2-spinner.gif) 100% no-repeat #fff}.select2-container-active .select2-choice,.select2-container-active .select2-choices{border:1px solid #666;outline:0}.select2-dropdown-open .select2-choice{border-bottom-color:transparent;-webkit-box-shadow:0 1px 0 #fff inset;box-shadow:0 1px 0 #fff inset;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-dropdown-open .select2-choice .select2-arrow b:after{border-top-color:transparent;border-bottom-color:#666;margin-top:-6px}.select2-dropdown-open.select2-drop-above .select2-choice,.select2-dropdown-open.select2-drop-above .select2-choices{border:1px solid #666;border-top-color:transparent}.select2-dropdown-open .select2-choice .select2-arrow{background:0 0;border-left:none;filter:none}html[dir=rtl] .select2-dropdown-open .select2-choice .select2-arrow{border-right:none}.select2-dropdown-open .select2-choice .select2-arrow b{background-position:-18px 1px}html[dir=rtl] .select2-dropdown-open .select2-choice .select2-arrow b{background-position:-16px 1px}.select2-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.select2-results{max-height:200px;padding:4px;margin:0;position:relative;overflow-x:hidden;overflow-y:auto;-webkit-tap-highlight-color:transparent;background:#fafafa}html[dir=rtl] .select2-results{padding:0 4px 0 0;margin:4px 0 4px 4px}.select2-results ul.select2-result-sub{margin:0;padding-left:0}.select2-results li{list-style:none;display:list-item;background-image:none;margin:3px 0}.select2-results li.select2-result-with-children>.select2-result-label{font-weight:700}.select2-results .select2-result-label{padding:5px 7px;margin:0;cursor:pointer;min-height:1em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.select2-results-dept-1 .select2-result-label{padding-left:20px}.select2-results-dept-2 .select2-result-label{padding-left:40px}.select2-results-dept-3 .select2-result-label{padding-left:60px}.select2-results-dept-4 .select2-result-label{padding-left:80px}.select2-results-dept-5 .select2-result-label{padding-left:100px}.select2-results-dept-6 .select2-result-label{padding-left:110px}.select2-results-dept-7 .select2-result-label{padding-left:120px}.select2-results .select2-highlighted{background:#f1f1f1;color:#000;border-radius:3px}.select2-results li em{background:#feffde;font-style:normal}.select2-results .select2-highlighted em{background:0 0}.select2-results .select2-highlighted ul{background:#fff;color:#000}.select2-results .select2-ajax-error,.select2-results .select2-no-results,.select2-results .select2-searching,.select2-results .select2-selection-limit{background:#f4f4f4;display:list-item;padding-left:5px}.select2-results .select2-disabled.select2-highlighted{color:#666;background:#f4f4f4;display:list-item;cursor:default}.select2-results .select2-disabled{background:#f4f4f4;display:list-item;cursor:default}.select2-results .select2-selected{display:none}.select2-more-results.select2-active{background:url(../images/select2-spinner.gif) 100% no-repeat #f4f4f4}.select2-results .select2-ajax-error{background:rgba(255,50,50,.2)}.select2-more-results{background:#f4f4f4;display:list-item}.select2-container.select2-container-disabled .select2-choice{background-color:#f4f4f4;background-image:none;border:1px solid #ddd;cursor:default}.select2-container.select2-container-disabled .select2-choice .select2-arrow{background-color:#f4f4f4;background-image:none;border-left:0}.select2-container.select2-container-disabled .select2-choice abbr{display:none}.select2-container-multi .select2-choices{height:auto!important;height:1%;margin:0;padding:0 5px 0 0;position:relative;border:1px solid #ccc;cursor:text;overflow:hidden;background-color:#fff;min-height:26px}html[dir=rtl] .select2-container-multi .select2-choices{padding:0 0 0 5px}.select2-locked{padding:3px 5px!important}.select2-container-multi.select2-container-active .select2-choices{border:1px solid #666;outline:0}.select2-container-multi .select2-choices li{float:left;list-style:none}html[dir=rtl] .select2-container-multi .select2-choices li{float:right}.select2-container-multi .select2-choices .select2-search-field{margin:0;padding:0;white-space:nowrap}.select2-container-multi .select2-choices .select2-search-field:first-child{width:100%}.select2-container-multi .select2-choices .select2-search-field input{margin:1px 0;outline:0;border:0;-webkit-box-shadow:none;box-shadow:none;background:0 0!important}.select2-container-multi .select2-choices .select2-search-field input.select2-active{background:url(../images/select2-spinner.gif) 100% no-repeat #fff!important}.select2-default{color:#999!important}.select2-container-multi .select2-choices .select2-search-choice{padding:5px 8px 5px 24px;margin:3px 0 3px 5px;position:relative;line-height:15px;color:#333;cursor:default;border-radius:2px;background-clip:padding-box;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#e4e4e4}html[dir=rtl] .select2-container-multi .select2-choices .select2-search-choice{margin:3px 5px 3px 0;padding:5px 24px 5px 8px}.select2-container-multi .select2-choices .select2-search-choice .select2-chosen{cursor:default}.select2-container-multi .select2-choices .select2-search-choice-focus{background:#d4d4d4}.select2-search-choice-close{display:block;width:12px;height:13px;position:absolute;right:7px;top:6px;font-size:1px;outline:0;background:url(../images/select2.png) right top no-repeat}html[dir=rtl] .select2-search-choice-close{right:auto;left:7px}.select2-container-multi .select2-search-choice-close{left:7px}html[dir=rtl] .select2-container-multi .select2-search-choice-close{left:auto;right:7px}.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover,.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close{background-position:right -11px}.select2-container-multi.select2-container-disabled .select2-choices{background-color:#f4f4f4;background-image:none;border:1px solid #ddd;cursor:default}.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice{padding:3px 5px;border:1px solid #ddd;background-image:none;background-color:#f4f4f4}.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close{display:none;background:0 0}.select2-result-selectable .select2-match,.select2-result-unselectable .select2-match{text-decoration:underline}.select2-offscreen,.select2-offscreen:focus{clip:rect(0 0 0 0)!important;width:1px!important;height:1px!important;border:0!important;margin:0!important;padding:0!important;overflow:hidden!important;position:absolute!important;outline:0!important;left:0!important;top:0!important}.select2-display-none{display:none}.select2-measure-scrollbar{position:absolute;top:-10000px;left:-10000px;width:100px;height:100px;overflow:scroll}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-resolution:2dppx){.select2-search input{background-image:url(../images/select2x2.png)!important;background-repeat:no-repeat!important;background-size:60px 40px!important;background-position:100% -21px!important}}@font-face{font-family:star;src:url(../fonts/star.eot);src:url(../fonts/star.eot?#iefix) format("embedded-opentype"),url(../fonts/star.woff) format("woff"),url(../fonts/star.ttf) format("truetype"),url(../fonts/star.svg#star) format("svg");font-weight:400;font-style:normal}@font-face{font-family:WooCommerce;src:url(../fonts/WooCommerce.eot);src:url(../fonts/WooCommerce.eot?#iefix) format("embedded-opentype"),url(../fonts/WooCommerce.woff) format("woff"),url(../fonts/WooCommerce.ttf) format("truetype"),url(../fonts/WooCommerce.svg#WooCommerce) format("svg");font-weight:400;font-style:normal}.blockUI.blockOverlay:before{height:1em;width:1em;position:absolute;top:50%;left:50%;margin-left:-.5em;margin-top:-.5em;display:block;content:"";-webkit-animation:spin 1s ease-in-out infinite;-moz-animation:spin 1s ease-in-out infinite;animation:spin 1s ease-in-out infinite;background:url(../images/icons/loader.svg) center center;background-size:cover;line-height:1;text-align:center;font-size:2em;color:rgba(0,0,0,.75)}.wc_addons_wrap .products{overflow:hidden}.wc_addons_wrap .products li{float:left;margin:0 1em 1em 0!important;padding:0;vertical-align:top;width:300px}.wc_addons_wrap .products li a{text-decoration:none;color:inherit;border:1px solid #ddd;display:block;min-height:220px;overflow:hidden;background:#f5f5f5;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),inset 0 -1px 0 rgba(0,0,0,.1)}.wc_addons_wrap .products li a img{max-width:258px;max-height:24px;padding:17px 20px;display:block;margin:0;background:#fff;border-right:260px solid #fff}.wc_addons_wrap .products li a .price,.wc_addons_wrap .products li a img.extension-thumb+h3{display:none}.wc_addons_wrap .products li a h2,.wc_addons_wrap .products li a h3{margin:0!important;padding:20px!important;background:#fff}.wc_addons_wrap .products li a p{padding:20px!important;margin:0!important;border-top:1px solid #f1f1f1}.wc_addons_wrap .products li a:focus,.wc_addons_wrap .products li a:hover{background-color:#fff}.wc_addons_wrap .storefront{background:url(../images/storefront-bg.jpg) bottom right #f6f6f6;border:1px solid #ddd;padding:20px;overflow:hidden;zoom:1}.wc_addons_wrap .storefront img{width:278px;height:auto;float:left;margin:0 20px 0 0;box-shadow:0 1px 6px rgba(0,0,0,.1)}.wc_addons_wrap .storefront p{max-width:750px}.woocommerce-BlankState a.button-primary,.woocommerce-BlankState button.button-primary,.woocommerce-message a.button-primary,.woocommerce-message button.button-primary{background:#bb77ae;border-color:#A36597;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #A36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #A36597;color:#fff;text-shadow:0 -1px 1px #A36597,1px 0 1px #A36597,0 1px 1px #A36597,-1px 0 1px #A36597}.woocommerce-BlankState a.button-primary:active,.woocommerce-BlankState a.button-primary:focus,.woocommerce-BlankState a.button-primary:hover,.woocommerce-BlankState button.button-primary:active,.woocommerce-BlankState button.button-primary:focus,.woocommerce-BlankState button.button-primary:hover,.woocommerce-message a.button-primary:active,.woocommerce-message a.button-primary:focus,.woocommerce-message a.button-primary:hover,.woocommerce-message button.button-primary:active,.woocommerce-message button.button-primary:focus,.woocommerce-message button.button-primary:hover{background:#A36597;border-color:#A36597;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #A36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #A36597}.woocommerce-message{position:relative;border-left-color:#cc99c2!important;overflow:hidden}.woocommerce-message a.docs,.woocommerce-message a.skip{text-decoration:none!important}.woocommerce-message a.woocommerce-message-close{position:absolute;top:10px;right:10px;padding:10px 15px 10px 21px;font-size:13px;line-height:1.23076923;text-decoration:none}.woocommerce-message a.woocommerce-message-close:before{position:absolute;top:8px;left:0;-webkit-transition:all .1s ease-in-out;transition:all .1s ease-in-out}.woocommerce-message .twitter-share-button{margin-top:-3px;margin-left:3px;vertical-align:middle}#variable_product_options #message,#variable_product_options .notice{margin:10px}.clear{clear:both}#woocommerce-fields-bulk.inline-edit-col label,#woocommerce-fields.inline-edit-col{clear:left}.wrap.woocommerce div.error,.wrap.woocommerce div.updated{margin-top:10px}mark.amount{background:0 0;color:inherit}.postbox,.woocommerce{input:invalid;input-border:1px solid #cc010b;input-background:#ffebe8}.simplify-commerce-banner{overflow:hidden}.simplify-commerce-banner img{float:right;padding:15px 0;margin-left:1em;width:200px}.woocommerce-help-tip{color:#666;display:inline-block;font-size:1.1em;font-style:normal;height:16px;line-height:16px;position:relative;vertical-align:middle;width:16px}.woocommerce-help-tip:after{font-family:Dashicons;font-weight:400;font-variant:normal;line-height:1;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";cursor:help}h2 .woocommerce-help-tip{margin-top:-5px;margin-left:.25em}table.wc_status_table{margin-bottom:1em}table.wc_status_table h2{font-size:14px;margin:0}table.wc_status_table tr:nth-child(2n) td,table.wc_status_table tr:nth-child(2n) th{background:#fcfcfc}table.wc_status_table th{font-weight:700;padding:9px}table.wc_status_table td:first-child{width:33%}table.wc_status_table td.help{width:1em}table.wc_status_table td{padding:9px;font-size:1.1em}table.wc_status_table td mark{background:0 0}table.wc_status_table td mark.yes{color:#7ad03a}table.wc_status_table td mark.no{color:#999}table.wc_status_table td mark.error{color:#a00}table.wc_status_table td ul{margin:0}table.wc_status_table .help_tip{cursor:help}#debug-report{display:none;margin:10px 0;padding:0;position:relative}#debug-report textarea{font-family:monospace;width:100%;margin:0;height:300px;padding:20px;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;resize:none;font-size:12px;line-height:20px;outline:0}#log-viewer-select{padding:10px 0 8px;line-height:180%}#log-viewer textarea{width:100%;resize:vertical}.inline-edit-product.quick-edit-row .inline-edit-col-center,.inline-edit-product.quick-edit-row .inline-edit-col-right{float:right!important}#woocommerce-fields.inline-edit-col label.featured,#woocommerce-fields.inline-edit-col label.manage_stock{margin-left:10px}#woocommerce-fields.inline-edit-col .dimensions div{display:block;margin:.2em 0}#woocommerce-fields.inline-edit-col .dimensions div span.title{display:block;float:left;width:5em}#woocommerce-fields.inline-edit-col .dimensions div span.input-text-wrap{display:block;margin-left:5em}#woocommerce-fields.inline-edit-col .text{box-sizing:border-box;width:99%;float:left;margin:1px 1% 1px 1px}#woocommerce-fields.inline-edit-col .height,#woocommerce-fields.inline-edit-col .length,#woocommerce-fields.inline-edit-col .width{width:32.33%}#woocommerce-fields.inline-edit-col .height{margin-right:0}#woocommerce-fields-bulk.inline-edit-col .inline-edit-group label{clear:none;width:49%;margin:.2em 0}#woocommerce-fields-bulk.inline-edit-col .inline-edit-group.dimensions label{width:75%;max-width:75%}#woocommerce-fields-bulk.inline-edit-col .length,#woocommerce-fields-bulk.inline-edit-col .regular_price,#woocommerce-fields-bulk.inline-edit-col .sale_price,#woocommerce-fields-bulk.inline-edit-col .stock,#woocommerce-fields-bulk.inline-edit-col .weight{box-sizing:border-box;width:100%;margin-left:4.4em}#woocommerce-fields-bulk.inline-edit-col .height,#woocommerce-fields-bulk.inline-edit-col .length,#woocommerce-fields-bulk.inline-edit-col .width{box-sizing:border-box;width:25%}.column-coupon_code{line-height:2.25em}.column-coupon_code,ul.wc_coupon_list{margin:0;overflow:hidden;zoom:1;clear:both}ul.wc_coupon_list li{margin:0}ul.wc_coupon_list li.code{display:inline-block}ul.wc_coupon_list li.code:after{content:", "}ul.wc_coupon_list li.code:last-of-type:after{display:none}ul.wc_coupon_list li.code .tips{cursor:pointer}ul.wc_coupon_list_block{margin:0;padding-bottom:2px}ul.wc_coupon_list_block li{border-top:1px solid #fff;border-bottom:1px solid #ccc;line-height:2.5em;margin:0;padding:.5em 0}ul.wc_coupon_list_block li:first-child{border-top:0;padding-top:0}ul.wc_coupon_list_block li:last-child{border-bottom:0;padding-bottom:0}.button.wc-reload{text-indent:-9999px;position:relative;padding:0;height:28px;width:28px!important;display:inline-block}.button.wc-reload:after{font-family:Dashicons;font-weight:400;font-variant:normal;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";line-height:28px}#order_data h2,#order_data p.order_number{font-family:HelveticaNeue-Light,"Helvetica Neue Light","Helvetica Neue",sans-serif;font-weight:400}.tablenav .actions{overflow:visible}.tablenav .select2-container{float:left;max-width:200px;font-size:14px;vertical-align:middle;margin:1px 6px 1px 1px}#woocommerce-order-data .handlediv,#woocommerce-order-data .hndle{display:none}#woocommerce-order-data .inside{display:block!important}#order_data{padding:23px 24px 12px}#order_data h2{margin:0;font-size:21px;line-height:1.2;text-shadow:1px 1px 1px #fff;padding:0}#order_data h3{font-size:14px}#order_data h3,#order_data h4{color:#333;margin:1.33em 0 0}#order_data p{color:#777}#order_data p.order_number{margin:0;line-height:1.6em;font-size:16px}#order_data .order_data_column_container{clear:both}#order_data .order_data_column{width:32%;padding:0 2% 0 0;float:left}#order_data .order_data_column:last-child{padding-right:0}#order_data .order_data_column p{padding:0!important}#order_data .order_data_column .address strong{display:block}#order_data .order_data_column .form-field{float:left;width:48%;padding:0;margin:9px 0 0}#order_data .order_data_column .form-field label{display:block;padding:0 0 3px}#order_data .order_data_column .form-field input,#order_data .order_data_column .form-field select,#order_data .order_data_column .form-field textarea{width:100%}#order_data .order_data_column .form-field .select2-container{width:100%!important}#order_data .order_data_column .form-field .date-picker{width:50%}#order_data .order_data_column .form-field .hour,#order_data .order_data_column .form-field .minute{width:3em}#order_data .order_data_column .form-field small{display:block;margin:5px 0 0;color:#999}#order_data .order_data_column .form-field.last{float:right}#order_data .order_data_column .form-field-wide{width:100%;clear:both}#order_data .order_data_column .form-field-wide .wc-customer-search,#order_data .order_data_column .form-field-wide .wc-enhanced-select,#order_data .order_data_column .form-field-wide input,#order_data .order_data_column .form-field-wide select,#order_data .order_data_column .form-field-wide textarea{width:100%}#order_data .order_data_column p.none_set{color:#999}#order_data .order_data_column ._billing_address_1_field,#order_data .order_data_column ._billing_city_field,#order_data .order_data_column ._billing_country_field,#order_data .order_data_column ._billing_email_field,#order_data .order_data_column ._billing_first_name_field,#order_data .order_data_column ._shipping_address_1_field,#order_data .order_data_column ._shipping_city_field,#order_data .order_data_column ._shipping_country_field,#order_data .order_data_column ._shipping_first_name_field{float:left}#order_data .order_data_column ._billing_address_2_field,#order_data .order_data_column ._billing_last_name_field,#order_data .order_data_column ._billing_phone_field,#order_data .order_data_column ._billing_postcode_field,#order_data .order_data_column ._billing_state_field,#order_data .order_data_column ._shipping_address_2_field,#order_data .order_data_column ._shipping_last_name_field,#order_data .order_data_column ._shipping_postcode_field,#order_data .order_data_column ._shipping_state_field,#order_data .order_data_column .wc-customer-user label a,#order_data .order_data_column .wc-order-status label a{float:right}#order_data .order_data_column ._billing_company_field,#order_data .order_data_column ._shipping_company_field,#order_data .order_data_column ._transaction_id_field{clear:both;width:100%}#order_data .order_data_column ._billing_email_field{clear:left}#order_data .order_data_column div.edit_address{display:none;zoom:1;padding-right:1px}#order_data .order_data_column .billing-same-as-shipping,#order_data .order_data_column .load_customer_billing,#order_data .order_data_column .load_customer_shipping,#order_data .order_data_column a.edit_address{width:14px;height:0;padding:14px 0 0;margin:0 0 0 6px;overflow:hidden;position:relative;color:#999;border:0;float:right}#order_data .order_data_column .billing-same-as-shipping:focus,#order_data .order_data_column .billing-same-as-shipping:hover,#order_data .order_data_column .load_customer_billing:focus,#order_data .order_data_column .load_customer_billing:hover,#order_data .order_data_column .load_customer_shipping:focus,#order_data .order_data_column .load_customer_shipping:hover,#order_data .order_data_column a.edit_address:focus,#order_data .order_data_column a.edit_address:hover{color:#000}#order_data .order_data_column .billing-same-as-shipping:after,#order_data .order_data_column .load_customer_billing:after,#order_data .order_data_column .load_customer_shipping:after,#order_data .order_data_column a.edit_address:after{font-family:WooCommerce;position:absolute;top:0;left:0;text-align:center;vertical-align:top;line-height:14px;font-size:14px;font-weight:400;-webkit-font-smoothing:antialiased}#order_data .order_data_column .billing-same-as-shipping:after{content:"\e008"}#order_data .order_data_column .load_customer_billing:after,#order_data .order_data_column .load_customer_shipping:after{content:"\e03a"}#order_data .order_data_column a.edit_address:after{font-family:Dashicons;content:"\f464"}.order_actions{margin:0;overflow:hidden;zoom:1}.order_actions li{border-top:1px solid #fff;border-bottom:1px solid #ddd;padding:6px 0;margin:0;line-height:1.6em;float:left;width:50%;text-align:center}.order_actions li a{float:none;text-align:center;text-decoration:underline}.order_actions li.wide{width:auto;float:none;clear:both;padding:6px;text-align:left;overflow:hidden}.order_actions li #delete-action{line-height:25px;vertical-align:middle;text-align:left;float:left}.order_actions li .save_order{float:right}.order_actions li#actions{overflow:hidden}.order_actions li#actions .button{width:24px;box-sizing:border-box;float:right}.order_actions li#actions select{width:225px;box-sizing:border-box;float:left}#woocommerce-order-items .inside{margin:0;padding:0;background:#fefefe}#woocommerce-order-items .wc-order-data-row{border-bottom:1px solid #DFDFDF;padding:1.5em 2em;background:#f8f8f8;line-height:2em;text-align:right}#woocommerce-order-items .wc-order-data-row:after,#woocommerce-order-items .wc-order-data-row:before{content:" ";display:table}#woocommerce-order-items .wc-order-data-row:after{clear:both}#woocommerce-order-items .wc-order-data-row p{margin:0;line-height:2em}#woocommerce-order-items .wc-order-data-row .wc-used-coupons{text-align:left}#woocommerce-order-items .wc-order-data-row .wc-used-coupons .tips{display:inline-block}#woocommerce-order-items .wc-order-add-item{background:#fff;vertical-align:top;border-top:none}#woocommerce-order-items .wc-order-add-item .add_item_id,#woocommerce-order-items .wc-order-add-item .select2-container{vertical-align:top}#woocommerce-order-items .wc-order-add-item .add_item_id .search-field input,#woocommerce-order-items .wc-order-add-item .select2-container .search-field input{min-width:100px}#woocommerce-order-items .wc-order-add-item .select2-container{width:400px!important;text-align:left}#woocommerce-order-items .wc-order-add-item .calculate-action,#woocommerce-order-items .wc-order-add-item .cancel-action,#woocommerce-order-items .wc-order-add-item .save-action{float:left;margin-right:2px}#woocommerce-order-items .wc-used-coupons{float:left;width:50%}#woocommerce-order-items .wc-order-totals{float:right;width:50%;margin:0;padding:0;text-align:right}#woocommerce-order-items .wc-order-totals .amount{font-weight:700}#woocommerce-order-items .wc-order-totals .label{vertical-align:top}#woocommerce-order-items .wc-order-totals .total{font-size:1em!important;width:10em;margin:0 0 0 .5em;box-sizing:border-box}#woocommerce-order-items .wc-order-totals .total input[type=text]{width:96%;float:right}#woocommerce-order-items .wc-order-totals .refunded-total{color:#a00}#woocommerce-order-items .refund-actions{margin-top:5px;padding-top:12px;border-top:1px solid #DFDFDF}#woocommerce-order-items .refund-actions .button{float:right;margin-left:4px}#woocommerce-order-items .refund-actions .cancel-action,#woocommerce-order-items .wc-order-item-bulk-edit .cancel-action{float:left;margin-left:0}#woocommerce-order-items .add_meta{margin-left:0!important}#woocommerce-order-items h3 small{color:#999}#woocommerce-order-items .amount{white-space:nowrap}#woocommerce-order-items .add-items .description{margin-right:10px}#woocommerce-order-items .add-items .button{float:left;margin-right:.25em}#woocommerce-order-items .add-items .button-primary{float:none;margin-right:0}#woocommerce-order-items .inside{display:block!important}#woocommerce-order-items .handlediv,#woocommerce-order-items .hndle{display:none}#woocommerce-order-items .woocommerce_order_items_wrapper{margin:0}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items{width:100%;background:#fff}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items thead th{text-align:left;padding:1em;font-weight:400;color:#999;background:#f8f8f8;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items thead th.sortable{cursor:pointer}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items thead th:last-child{padding-right:2em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items thead th:first-child{padding-left:2em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items thead th .wc-arrow{float:right;position:relative;margin-right:-1em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody th,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td{padding:1.5em 1em 1em;text-align:left;line-height:1.5em;vertical-align:top;border-bottom:1px solid #f8f8f8}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody th textarea,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td textarea{width:100%}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody th select,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td select{width:50%}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody th input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody th textarea,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td textarea{font-size:14px;padding:4px;color:#555}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody th:last-child,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td:last-child{padding-right:2em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody th:first-child,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td:first-child{padding-left:2em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody tr td{cursor:pointer}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody tr.selected{background:#F5EBF3}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody tr.selected td{border-color:#E6CCE1;opacity:.8}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody tr:last-child td{border-bottom:1px solid #dfdfdf}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody tr:first-child td{border-top:8px solid #f8f8f8}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody#order_line_items tr:first-child td{border-top:none}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.thumb{text-align:left;width:38px;padding-bottom:1.5em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.thumb .wc-order-item-thumbnail{width:38px;height:38px;border:2px solid #e8e8e8;background:#f8f8f8;color:#ccc;position:relative;font-size:21px;display:block;text-align:center}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.thumb .wc-order-item-thumbnail:before{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;height:100%;text-align:center;content:"";width:38px;line-height:38px;display:block}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.thumb .wc-order-item-thumbnail img{width:100%;height:100%;margin:0;padding:0;position:relative}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.name .wc-order-item-sku,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.name .wc-order-item-variation{display:block;margin-top:.5em;font-size:.92em!important;color:#888}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item{min-width:200px}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .center,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .variation-id{text-align:center}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class{text-align:right}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class label{white-space:nowrap;color:#999;font-size:.833em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost label input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost label input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost label input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax label input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity label input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax label input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class label input{display:inline}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class input{width:70px;vertical-align:middle;text-align:right}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost select,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost select,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost select,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax select,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity select,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax select,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class select{width:85px;height:26px;vertical-align:middle;font-size:1em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .split-input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .split-input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .split-input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .split-input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .split-input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .split-input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .split-input{display:inline-block;background:#fff;border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);margin:1px 0;min-width:80px;overflow:hidden;line-height:1em;text-align:right}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .split-input div.input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .split-input div.input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .split-input div.input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .split-input div.input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .split-input div.input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .split-input div.input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .split-input div.input{width:100%;box-sizing:border-box}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .split-input div.input label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .split-input div.input label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .split-input div.input label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .split-input div.input label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .split-input div.input label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .split-input div.input label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .split-input div.input label{font-size:.75em;padding:4px 6px 0;color:#555;display:block}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .split-input div.input input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .split-input div.input input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .split-input div.input input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .split-input div.input input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .split-input div.input input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .split-input div.input input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .split-input div.input input{width:100%;box-sizing:border-box;border:0;box-shadow:none;margin:0;padding:0 6px 4px;color:#555;background:0 0}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .split-input div.input input::-webkit-input-placeholder,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .split-input div.input input::-webkit-input-placeholder,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .split-input div.input input::-webkit-input-placeholder,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .split-input div.input input::-webkit-input-placeholder,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .split-input div.input input::-webkit-input-placeholder,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .split-input div.input input::-webkit-input-placeholder,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .split-input div.input input::-webkit-input-placeholder{color:#ddd}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .split-input div.input:first-child,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .split-input div.input:first-child,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .split-input div.input:first-child,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .split-input div.input:first-child,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .split-input div.input:first-child,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .split-input div.input:first-child,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .split-input div.input:first-child{border-bottom:1px dashed #ddd;background:#fff}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .split-input div.input:first-child input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .split-input div.input:first-child label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .split-input div.input:first-child input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .split-input div.input:first-child label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .split-input div.input:first-child input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .split-input div.input:first-child label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .split-input div.input:first-child input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .split-input div.input:first-child label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .split-input div.input:first-child input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .split-input div.input:first-child label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .split-input div.input:first-child input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .split-input div.input:first-child label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .split-input div.input:first-child input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .split-input div.input:first-child label{color:#ccc}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .view,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .view,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .view,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .view,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .view,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .view,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .view{white-space:nowrap}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .edit,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .edit,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .edit,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .edit,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .edit,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .edit,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .edit{text-align:left}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost del,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost del,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost del,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax del,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity del,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax del,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class del,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class small.times{font-size:.92em!important;color:#888}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .wc-order-item-taxes{margin:0}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .wc-order-item-refund-fields label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .wc-order-item-taxes label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .wc-order-item-refund-fields label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .wc-order-item-taxes label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .wc-order-item-refund-fields label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .wc-order-item-taxes label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .wc-order-item-refund-fields label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .wc-order-item-taxes label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .wc-order-item-refund-fields label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .wc-order-item-taxes label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .wc-order-item-refund-fields label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .wc-order-item-taxes label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .wc-order-item-refund-fields label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .wc-order-item-taxes label{display:block}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .wc-order-item-discount{display:block;margin-top:.5em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class small.times{margin-right:.25em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity{text-align:center}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity input{text-align:center;width:50px}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items span.subtotal{opacity:.5}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.tax_class,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items th.tax_class{text-align:left}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .calculated{border-color:#ae8ca2;border-style:dotted}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.meta{width:100%}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.display_meta,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.meta{margin:.5em 0 0;font-size:.92em!important;color:#888}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.fee .thumb div:before,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.refund .thumb div:before,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.shipping .thumb div:before{color:#ccc;top:0;left:0;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;text-align:center;font-family:WooCommerce}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.display_meta tr th,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.meta tr th{border:0;padding:0 4px .5em 0;line-height:1.5em;width:20%}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.display_meta tr td,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.meta tr td{padding:0 4px .5em 0;border:0;line-height:1.5em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.display_meta tr td input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.meta tr td input{width:100%;margin:0;position:relative;border-bottom:0;box-shadow:none}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .refund_by,ul.order_notes li p.meta .exact-date{border-bottom:1px dotted #999}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.display_meta tr td textarea,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.meta tr td textarea{width:100%;height:4em;margin:0;box-shadow:none}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.display_meta tr td input:focus+textarea,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.meta tr td input:focus+textarea{border-top-color:#999}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.display_meta tr td p,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.meta tr td p{margin:0 0 .5em;line-height:1.5em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.display_meta tr td p:last-child,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.meta tr td p:last-child{margin:0}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.fee .thumb div{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;font-size:1.5em;line-height:1em;vertical-align:middle;margin:0}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.fee .thumb div:before{line-height:1;margin:0;text-indent:0;position:absolute;width:100%;height:100%;content:""}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.refund .thumb div{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;font-size:1.5em;line-height:1em;vertical-align:middle;margin:0}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.refund .thumb div:before{line-height:1;margin:0;text-indent:0;position:absolute;width:100%;height:100%;content:""}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.shipping .thumb div{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;font-size:1.5em;line-height:1em;vertical-align:middle;margin:0}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.shipping .thumb div:before{line-height:1;margin:0;text-indent:0;position:absolute;width:100%;height:100%;content:""}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.shipping .shipping_method,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.shipping .shipping_method_name{width:100%;margin:0 0 .5em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items th.line_tax{white-space:nowrap}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.line_tax .delete-order-tax,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items th.line_tax .delete-order-tax{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;float:right;font-size:14px;visibility:hidden;margin:3px -18px 0 0}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.line_tax .delete-order-tax:before,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items th.line_tax .delete-order-tax:before{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";color:#999}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.line_tax .delete-order-tax:hover:before,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items th.line_tax .delete-order-tax:hover:before{color:#a00}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.line_tax:hover .delete-order-tax,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items th.line_tax:hover .delete-order-tax{visibility:visible}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items small.refunded{display:block;color:#a00;white-space:nowrap;margin-top:.5em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items small.refunded:before{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;text-indent:0;width:100%;height:100%;text-align:center;content:"";position:relative;top:auto;left:auto;margin:-1px 4px 0 0;vertical-align:middle;line-height:1em}#woocommerce-order-items .wc-order-edit-line-item{padding-left:0}#woocommerce-order-items .wc-order-edit-line-item-actions{width:44px;text-align:right;padding-left:0;vertical-align:middle}#woocommerce-order-items .wc-order-edit-line-item-actions a{color:#ccc;display:inline-block;cursor:pointer;padding:0 0 .5em;margin:0 0 0 12px;vertical-align:middle;text-decoration:none;line-height:16px;width:16px;overflow:hidden}#woocommerce-order-items .wc-order-edit-line-item-actions a:before{margin:0;padding:0;font-size:16px;width:16px;height:16px}#woocommerce-order-items .wc-order-edit-line-item-actions .delete-order-item:before,#woocommerce-order-items .wc-order-edit-line-item-actions .delete_refund:before,#woocommerce-order-items .wc-order-edit-line-item-actions .edit-order-item:before{font-family:Dashicons;-webkit-font-smoothing:antialiased;text-indent:0;top:0;left:0;width:100%;height:100%;margin:0;text-align:center;position:relative;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1}#woocommerce-order-items .wc-order-edit-line-item-actions a:hover:before{color:#999}#woocommerce-order-items .wc-order-edit-line-item-actions a:first-child{margin-left:0}#woocommerce-order-items .wc-order-edit-line-item-actions .edit-order-item:before{content:""}#woocommerce-order-items .wc-order-edit-line-item-actions .delete-order-item:before,#woocommerce-order-items .wc-order-edit-line-item-actions .delete_refund:before{content:""}#woocommerce-order-items .wc-order-edit-line-item-actions .delete-order-item:hover:before,#woocommerce-order-items .wc-order-edit-line-item-actions .delete_refund:hover:before{color:#a00}#woocommerce-order-items tbody tr .wc-order-edit-line-item-actions{visibility:hidden}#woocommerce-order-items tbody tr:hover .wc-order-edit-line-item-actions{visibility:visible}#woocommerce-order-items .wc-order-totals .wc-order-edit-line-item-actions{width:1.5em;visibility:visible!important}#woocommerce-order-items .wc-order-totals .wc-order-edit-line-item-actions a{padding:0}#woocommerce-order-downloads .buttons{float:left;padding:0;margin:0;vertical-align:top}#woocommerce-order-downloads .buttons .add_item_id,#woocommerce-order-downloads .buttons .select2-container{width:400px!important;margin-right:9px;vertical-align:top;float:left}#woocommerce-order-downloads .buttons button{margin:2px 0 0}#woocommerce-order-downloads h3 small{color:#999}#poststuff #woocommerce-order-actions .inside{margin:0;padding:0}#poststuff #woocommerce-order-actions .inside ul.order_actions li{padding:6px 10px;box-sizing:border-box}#poststuff #woocommerce-order-actions .inside ul.order_actions li:last-child{border-bottom:0}#poststuff #woocommerce-order-notes .inside{margin:0;padding:0}#poststuff #woocommerce-order-notes .inside ul.order_notes li{padding:0 10px}#woocommerce_customers p.search-box{margin:6px 0 4px;float:left}#woocommerce_customers .tablenav{float:right;clear:none}.widefat.customers td{vertical-align:middle;padding:4px 7px}.widefat .column-order_title{width:15%}.widefat .column-order_title time{display:block;color:#999;margin:3px 0}.widefat .column-orders,.widefat .column-paying,.widefat .column-spent{text-align:center;width:8%}.widefat .column-last_order{width:11%}.widefat .column-order_actions,.widefat .column-user_actions,.widefat .column-wc_actions{width:110px}.widefat .column-order_actions a.button,.widefat .column-user_actions a.button,.widefat .column-wc_actions a.button{float:left;margin:0 4px 2px 0;cursor:pointer;padding:3px 4px;height:auto}.widefat .column-order_actions a.button img,.widefat .column-user_actions a.button img,.widefat .column-wc_actions a.button img{display:block;width:12px;height:auto}.widefat small.meta{display:block;color:#999;font-size:inherit;margin:3px 0}.widefat .column-order_date,.widefat .column-order_total{width:9%}.widefat .column-order_status{width:45px;text-align:center}.widefat .column-order_status mark{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;background:0 0;font-size:1.4em;margin:0 auto}.widefat .column-order_status mark.cancelled:after,.widefat .column-order_status mark.completed:after,.widefat .column-order_status mark.failed:after,.widefat .column-order_status mark.on-hold:after,.widefat .column-order_status mark.pending:after,.widefat .column-order_status mark.processing:after,.widefat .column-order_status mark.refunded:after{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center}.column-customer_message .note-on:after,.column-order_notes .note-on:after{speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;top:0;left:0;text-align:center;line-height:16px;font-family:WooCommerce}.widefat .column-order_status mark.pending:after{content:"\e012";color:#ffba00}.widefat .column-order_status mark.completed:after{content:"\e015";color:#2ea2cc}.widefat .column-order_status mark.on-hold:after{content:"\e033";color:#999}.widefat .column-order_status mark.failed:after{content:"\e016";color:#d0c21f}.widefat .column-order_status mark.cancelled:after{content:"\e013";color:#a00}.widefat .column-order_status mark.processing:after{content:"\e011";color:#73a724}.widefat .column-order_status mark.refunded:after{content:"\e014";color:#999}.widefat td.column-order_status{padding-top:9px}.column-customer_message .note-on{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;margin:0 auto;color:#999}.column-customer_message .note-on:after{margin:0;text-indent:0;position:absolute;width:100%;height:100%;content:""}.column-order_notes .note-on{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;margin:0 auto;color:#999}.column-order_notes .note-on:after{margin:0;text-indent:0;position:absolute;width:100%;height:100%;content:""}.order_actions .complete,.order_actions .processing,.order_actions .view{display:block;text-indent:-9999px;position:relative;padding:0!important;height:2em!important;width:2em}.order_actions .processing:after{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";line-height:1.85}.order_actions .complete:after,.order_actions .view:after{font-family:Dashicons;text-indent:0;position:absolute;width:100%;height:100%;left:0;line-height:1.85;margin:0;text-align:center;speak:none;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;top:0;font-weight:400}.order_actions .complete:after{content:""}.order_actions .view:after{content:""}.user_actions .edit,.user_actions .link,.user_actions .refresh,.user_actions .view{display:block;text-indent:-9999px;position:relative;padding:0!important;height:2em!important;width:2em}.user_actions .edit:after,.user_actions .link:after,.user_actions .refresh:after,.user_actions .view:after{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";line-height:1.85}.user_actions .edit:after{font-family:Dashicons;content:"\f464"}.user_actions .link:after{content:"\e00d"}.user_actions .view:after{content:"\e010"}.user_actions .refresh:after{content:"\e031"}.attributes-table td,.attributes-table th{width:15%;vertical-align:top}.attributes-table .attribute-terms{width:32%}.attributes-table .attribute-actions{width:2em}.attributes-table .attribute-actions .configure-terms{display:block;text-indent:-9999px;position:relative;padding:0!important;height:2em!important;width:2em}.attributes-table .attribute-actions .configure-terms:after{speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";font-family:Dashicons;line-height:1.85}ul.order_notes{padding:2px 0 0}ul.order_notes li .note_content{padding:10px;background:#efefef;position:relative}ul.order_notes li .note_content p{margin:0;padding:0;word-wrap:break-word}ul.order_notes li p.meta{padding:10px;color:#999;margin:0;font-size:11px}ul.order_notes li a.delete_note{color:#a00}table.wp-list-table .row-actions,table.wp-list-table span.na{color:#999}ul.order_notes li .note_content:after{content:"";display:block;position:absolute;bottom:-10px;left:20px;width:0;height:0;border-width:10px 10px 0 0;border-style:solid;border-color:#efefef transparent}ul.order_notes li.customer-note .note_content{background:#A7CEDC}ul.order_notes li.customer-note .note_content:after{border-color:#A7CEDC transparent}ul.order_notes li.system-note .note_content{background:#d7cad2}ul.order_notes li.system-note .note_content:after{border-color:#d7cad2 transparent}.add_note{border-top:1px solid #ddd;padding:10px 10px 0}.add_note h4{margin-top:5px!important}.add_note #add_order_note{width:100%;height:50px}table.wp-list-table .column-thumb{width:52px;text-align:center;white-space:nowrap}table.wp-list-table .column-name{width:22%}table.wp-list-table .column-product_cat,table.wp-list-table .column-product_tag{width:11%!important}table.wp-list-table .column-featured,table.wp-list-table .column-product_type{width:48px;text-align:left!important}table.wp-list-table .column-customer_message,table.wp-list-table .column-order_notes{width:48px;text-align:center}table.wp-list-table .column-customer_message img,table.wp-list-table .column-order_notes img{margin:0 auto;padding-top:0!important}table.wp-list-table .manage-column.column-featured img,table.wp-list-table .manage-column.column-product_type img{padding-left:2px}table.wp-list-table .column-price .woocommerce-price-suffix{display:none}table.wp-list-table img{margin:1px 2px}table.wp-list-table td.column-thumb img{margin:0;width:auto;height:auto;max-width:40px;max-height:40px;vertical-align:middle}table.wp-list-table .column-is_in_stock{text-align:left!important}table.wp-list-table span.wc-featured,table.wp-list-table span.wc-image,table.wp-list-table span.wc-type{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;margin:0 auto}table.wp-list-table span.wc-featured:before,table.wp-list-table span.wc-image:before,table.wp-list-table span.wc-type:before{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:""}table.wp-list-table span.wc-featured{margin:0;cursor:pointer}table.wp-list-table span.wc-featured:before{content:"\f155"}table.wp-list-table span.wc-featured.not-featured:before{content:"\f154"}table.wp-list-table td.column-featured span.wc-featured{font-size:1.6em}table.wp-list-table span.wc-type{margin:0}table.wp-list-table span.wc-type:before{font-family:WooCommerce;content:"\e006"}table.wp-list-table .notes_head:after,table.wp-list-table .order-notes_head:after,table.wp-list-table .status_head:after,table.wp-list-table span.product-type:before{font-family:WooCommerce;text-align:center;line-height:1;top:0;speak:none;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;left:0}table.wp-list-table span.product-type{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;font-size:1.6em}table.wp-list-table span.product-type:before{font-weight:400;margin:0;text-indent:0;position:absolute;width:100%;height:100%;content:""}table.wp-list-table span.product-type.grouped:before{content:"\e002"}table.wp-list-table span.product-type.external:before{content:"\e034"}table.wp-list-table span.product-type.variable:before{content:"\e003"}table.wp-list-table span.product-type.downloadable:before{content:"\e001"}table.wp-list-table span.product-type.virtual:before{content:"\e000"}table.wp-list-table mark.instock{font-weight:700;color:#7ad03a;background:0 0;line-height:1}table.wp-list-table mark.outofstock{font-weight:700;color:#a44;background:0 0;line-height:1}table.wp-list-table .notes_head,table.wp-list-table .order-notes_head,table.wp-list-table .status_head{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;margin:0 auto}table.wp-list-table .notes_head:after,table.wp-list-table .order-notes_head:after,table.wp-list-table .status_head:after{font-weight:400;margin:0;text-indent:0;position:absolute;width:100%;height:100%}table.wc_emails .wc-email-settings-table-name,table.wc_emails td.name,table.wc_gateways .wc-email-settings-table-name,table.wc_gateways td.name,table.wc_shipping .wc-email-settings-table-name,table.wc_shipping td.name{font-weight:700}table.wp-list-table .order-notes_head:after{content:"\e028"}table.wp-list-table .notes_head:after{content:"\e026"}table.wp-list-table .status_head:after{content:"\e011"}table.wp-list-table .column-order_items{width:12%}table.wp-list-table .column-order_items table.order_items{width:100%;margin:3px 0 0;padding:0;display:none}table.wp-list-table .column-order_items table.order_items td{border:0;margin:0;padding:0 0 3px}table.wp-list-table .column-order_items table.order_items td.qty{color:#999;padding-right:6px;text-align:left}mark.notice{background:#fff;color:#a00;margin:0 0 0 10px}a.export_rates,a.import_rates{float:right;margin-left:9px;margin-top:-2px;margin-bottom:0}#rates-search{float:right}#rates-search input.wc-tax-rates-search-field{padding:4px 8px;font-size:1.2em}#rates-pagination{float:right;margin-right:.5em}#rates-pagination .tablenav{margin:0}table.wc_input_table,table.wc_tax_rates{width:100%}table.wc_input_table span.tips,table.wc_tax_rates span.tips{color:#2ea2cc}table.wc_input_table td,table.wc_tax_rates td{padding:0;border-right:1px solid #DFDFDF;border-bottom:1px solid #DFDFDF;border-top:0;background:#fff}table.wc_input_table td input[type=text],table.wc_input_table td input[type=number],table.wc_tax_rates td input[type=text],table.wc_tax_rates td input[type=number]{width:100%;padding:5px 7px;margin:0;border:0;background:0 0}table.wc_input_table td.apply_to_shipping,table.wc_input_table td.compound,table.wc_tax_rates td.apply_to_shipping,table.wc_tax_rates td.compound{padding:5px 7px;vertical-align:middle}table.wc_input_table td.apply_to_shipping input,table.wc_input_table td.compound input,table.wc_tax_rates td.apply_to_shipping input,table.wc_tax_rates td.compound input{width:auto;padding:0}table.wc_input_table td:last-child,table.wc_tax_rates td:last-child{border-right:0}table.wc_input_table tr.current td,table.wc_tax_rates tr.current td{background-color:#fefbcc}table.wc_input_table .cost,table.wc_input_table .cost input,table.wc_input_table .item_cost,table.wc_input_table .item_cost input,table.wc_tax_rates .cost,table.wc_tax_rates .cost input,table.wc_tax_rates .item_cost,table.wc_tax_rates .item_cost input{text-align:right}table.wc_input_table th.sort,table.wc_tax_rates th.sort{width:17px;padding:0 4px}table.wc_input_table td.sort,table.wc_tax_rates td.sort{padding:0 4px}table.wc_input_table .ui-sortable:not(.ui-sortable-disabled) td.sort,table.wc_tax_rates .ui-sortable:not(.ui-sortable-disabled) td.sort{cursor:move;font-size:15px;background:#f9f9f9;text-align:center;vertical-align:middle}table.wc_input_table .ui-sortable:not(.ui-sortable-disabled) td.sort:before,table.wc_tax_rates .ui-sortable:not(.ui-sortable-disabled) td.sort:before{content:"\f333";font-family:Dashicons;text-align:center;line-height:1;color:#999;display:block;width:17px;float:left;height:100%}table.wc_input_table .ui-sortable:not(.ui-sortable-disabled) td.sort:hover:before,table.wc_tax_rates .ui-sortable:not(.ui-sortable-disabled) td.sort:hover:before{color:#333}table.wc_input_table .button,table.wc_tax_rates .button{float:left;margin-right:5px}table.wc_input_table .export,table.wc_input_table .import,table.wc_tax_rates .export,table.wc_tax_rates .import{float:right;margin-right:0;margin-left:5px}table.wc_input_table span.tips,table.wc_tax_rates span.tips{padding:0 3px}table.wc_input_table .pagination,table.wc_tax_rates .pagination{float:right}table.wc_input_table .pagination .button,table.wc_tax_rates .pagination .button{margin-left:5px;margin-right:0}table.wc_input_table .pagination .current,table.wc_tax_rates .pagination .current{background:#bbb;text-shadow:none}table.wc_input_table tfoot th,table.wc_tax_rates tfoot th{padding-left:20px;padding-right:20px}table.wc_input_table tr:last-child td,table.wc_tax_rates tr:last-child td{border-bottom:0}table.wc_emails,table.wc_gateways,table.wc_shipping{position:relative}table.wc_emails td,table.wc_gateways td,table.wc_shipping td{vertical-align:middle;padding:7px;line-height:2em}table.wc_emails tr:nth-child(odd) td,table.wc_gateways tr:nth-child(odd) td,table.wc_shipping tr:nth-child(odd) td{background:#f9f9f9}table.wc_emails th,table.wc_gateways th,table.wc_shipping th{padding:9px 7px!important;vertical-align:middle}table.wc_emails .settings,table.wc_gateways .settings,table.wc_shipping .settings{text-align:right}table.wc_emails .default,table.wc_emails .radio,table.wc_emails .status,table.wc_gateways .default,table.wc_gateways .radio,table.wc_gateways .status,table.wc_shipping .default,table.wc_shipping .radio,table.wc_shipping .status{text-align:center}table.wc_emails .default .tips,table.wc_emails .radio .tips,table.wc_emails .status .tips,table.wc_gateways .default .tips,table.wc_gateways .radio .tips,table.wc_gateways .status .tips,table.wc_shipping .default .tips,table.wc_shipping .radio .tips,table.wc_shipping .status .tips{margin:0 auto}table.wc_emails .default input,table.wc_emails .radio input,table.wc_emails .status input,table.wc_gateways .default input,table.wc_gateways .radio input,table.wc_gateways .status input,table.wc_shipping .default input,table.wc_shipping .radio input,table.wc_shipping .status input{margin:0}table.wc_emails th.sort,table.wc_gateways th.sort,table.wc_shipping th.sort{width:28px;padding:0}table.wc_emails td.sort,table.wc_gateways td.sort,table.wc_shipping td.sort{padding:0 7px;cursor:move;font-size:15px;text-align:center;vertical-align:middle}table.wc_emails td.sort:before,table.wc_gateways td.sort:before,table.wc_shipping td.sort:before{content:"\f333";font-family:Dashicons;text-align:center;line-height:1;color:#999;display:block;width:17px;float:left;height:100%}table.wc_emails .wc-email-settings-table-name span,table.wc_gateways .wc-email-settings-table-name span,table.wc_shipping .wc-email-settings-table-name span{font-weight:400;color:#999;margin:0 0 0 4px!important}table.wc_emails .wc-email-settings-table-status,table.wc_gateways .wc-email-settings-table-status,table.wc_shipping .wc-email-settings-table-status{text-align:center;width:1em}table.wc_emails .wc-email-settings-table-status .tips,table.wc_gateways .wc-email-settings-table-status .tips,table.wc_shipping .wc-email-settings-table-status .tips{margin:0 auto}table.wc_emails .wc-email-settings-table-actions a,table.wc_gateways .wc-email-settings-table-actions a,table.wc_shipping .wc-email-settings-table-actions a{display:block;text-indent:-9999px;position:relative;padding:0!important;height:2em!important;width:2em}table.wc_emails .wc-email-settings-table-actions a:after,table.wc_gateways .wc-email-settings-table-actions a:after,table.wc_shipping .wc-email-settings-table-actions a:after{speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";font-family:Dashicons;line-height:1.85}table.wc-shipping-classes td,table.wc-shipping-classes th,table.wc-shipping-zone-methods td,table.wc-shipping-zone-methods th,table.wc-shipping-zones td,table.wc-shipping-zones th{vertical-align:top;line-height:24px;padding:1em;font-size:14px;background:#fff}table.wc-shipping-classes td li,table.wc-shipping-classes th li,table.wc-shipping-zone-methods td li,table.wc-shipping-zone-methods th li,table.wc-shipping-zones td li,table.wc-shipping-zones th li{line-height:24px;font-size:14px}table.wc-shipping-classes td.wc-shipping-zone-method-blank-state,table.wc-shipping-classes td.wc-shipping-zones-blank-state,table.wc-shipping-zone-methods td.wc-shipping-zone-method-blank-state,table.wc-shipping-zone-methods td.wc-shipping-zones-blank-state,table.wc-shipping-zones td.wc-shipping-zone-method-blank-state,table.wc-shipping-zones td.wc-shipping-zones-blank-state{background:#F7F1F6!important;overflow:hidden;position:relative;padding:7.5em 7.5%;border-bottom:2px solid #EEE2EC}table.wc-shipping-classes td.wc-shipping-zone-method-blank-state li,table.wc-shipping-classes td.wc-shipping-zone-method-blank-state p,table.wc-shipping-classes td.wc-shipping-zones-blank-state li,table.wc-shipping-classes td.wc-shipping-zones-blank-state p,table.wc-shipping-zone-methods td.wc-shipping-zone-method-blank-state li,table.wc-shipping-zone-methods td.wc-shipping-zone-method-blank-state p,table.wc-shipping-zone-methods td.wc-shipping-zones-blank-state li,table.wc-shipping-zone-methods td.wc-shipping-zones-blank-state p,table.wc-shipping-zones td.wc-shipping-zone-method-blank-state li,table.wc-shipping-zones td.wc-shipping-zone-method-blank-state p,table.wc-shipping-zones td.wc-shipping-zones-blank-state li,table.wc-shipping-zones td.wc-shipping-zones-blank-state p{color:#a46497;font-size:1.5em;line-height:1.5em;margin:0 0 1em;position:relative;z-index:1;text-shadow:1px 1px 1px #fff}table.wc-shipping-classes td.wc-shipping-zone-method-blank-state li.main,table.wc-shipping-classes td.wc-shipping-zone-method-blank-state p.main,table.wc-shipping-classes td.wc-shipping-zones-blank-state li.main,table.wc-shipping-classes td.wc-shipping-zones-blank-state p.main,table.wc-shipping-zone-methods td.wc-shipping-zone-method-blank-state li.main,table.wc-shipping-zone-methods td.wc-shipping-zone-method-blank-state p.main,table.wc-shipping-zone-methods td.wc-shipping-zones-blank-state li.main,table.wc-shipping-zone-methods td.wc-shipping-zones-blank-state p.main,table.wc-shipping-zones td.wc-shipping-zone-method-blank-state li.main,table.wc-shipping-zones td.wc-shipping-zone-method-blank-state p.main,table.wc-shipping-zones td.wc-shipping-zones-blank-state li.main,table.wc-shipping-zones td.wc-shipping-zones-blank-state p.main{font-size:2em}table.wc-shipping-classes td.wc-shipping-zone-method-blank-state li,table.wc-shipping-classes td.wc-shipping-zones-blank-state li,table.wc-shipping-zone-methods td.wc-shipping-zone-method-blank-state li,table.wc-shipping-zone-methods td.wc-shipping-zones-blank-state li,table.wc-shipping-zones td.wc-shipping-zone-method-blank-state li,table.wc-shipping-zones td.wc-shipping-zones-blank-state li{margin-left:1em;list-style:circle inside}table.wc-shipping-classes td.wc-shipping-zone-method-blank-state:before,table.wc-shipping-classes td.wc-shipping-zones-blank-state:before,table.wc-shipping-zone-methods td.wc-shipping-zone-method-blank-state:before,table.wc-shipping-zone-methods td.wc-shipping-zones-blank-state:before,table.wc-shipping-zones td.wc-shipping-zone-method-blank-state:before,table.wc-shipping-zones td.wc-shipping-zones-blank-state:before{content:"\e01b";font-family:WooCommerce;text-align:center;line-height:1;color:#EEE2EC;display:block;width:1em;font-size:40em;top:50%;right:-3.75%;margin-top:-.1875em;position:absolute}table.wc-shipping-classes td.wc-shipping-zone-method-blank-state .button-primary,table.wc-shipping-classes td.wc-shipping-zones-blank-state .button-primary,table.wc-shipping-zone-methods td.wc-shipping-zone-method-blank-state .button-primary,table.wc-shipping-zone-methods td.wc-shipping-zones-blank-state .button-primary,table.wc-shipping-zones td.wc-shipping-zone-method-blank-state .button-primary,table.wc-shipping-zones td.wc-shipping-zones-blank-state .button-primary{background-color:#804877;border-color:#804877;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 0 rgba(0,0,0,.15);margin:0;opacity:1;text-shadow:0 -1px 1px #8a4f7f,1px 0 1px #8a4f7f,0 1px 1px #8a4f7f,-1px 0 1px #8a4f7f;font-size:1.5em;padding:.75em 1em;height:auto;position:relative;z-index:1}table.wc-shipping-classes .wc-shipping-class-rows tr:nth-child(odd) td,table.wc-shipping-classes .wc-shipping-zone-method-rows tr:nth-child(odd) td,table.wc-shipping-classes tbody.wc-shipping-zone-rows tr:nth-child(odd) td,table.wc-shipping-classes tr.odd td,table.wc-shipping-zone-methods .wc-shipping-class-rows tr:nth-child(odd) td,table.wc-shipping-zone-methods .wc-shipping-zone-method-rows tr:nth-child(odd) td,table.wc-shipping-zone-methods tbody.wc-shipping-zone-rows tr:nth-child(odd) td,table.wc-shipping-zone-methods tr.odd td,table.wc-shipping-zones .wc-shipping-class-rows tr:nth-child(odd) td,table.wc-shipping-zones .wc-shipping-zone-method-rows tr:nth-child(odd) td,table.wc-shipping-zones tbody.wc-shipping-zone-rows tr:nth-child(odd) td,table.wc-shipping-zones tr.odd td{background:#f9f9f9}table.wc-shipping-classes p,table.wc-shipping-classes ul,table.wc-shipping-zone-methods p,table.wc-shipping-zone-methods ul,table.wc-shipping-zones p,table.wc-shipping-zones ul{margin:0}table.wc-shipping-classes td.wc-shipping-zone-method-sort,table.wc-shipping-classes td.wc-shipping-zone-sort,table.wc-shipping-zone-methods td.wc-shipping-zone-method-sort,table.wc-shipping-zone-methods td.wc-shipping-zone-sort,table.wc-shipping-zones td.wc-shipping-zone-method-sort,table.wc-shipping-zones td.wc-shipping-zone-sort{cursor:move;font-size:15px;text-align:center}table.wc-shipping-classes td.wc-shipping-zone-method-sort:before,table.wc-shipping-classes td.wc-shipping-zone-sort:before,table.wc-shipping-zone-methods td.wc-shipping-zone-method-sort:before,table.wc-shipping-zone-methods td.wc-shipping-zone-sort:before,table.wc-shipping-zones td.wc-shipping-zone-method-sort:before,table.wc-shipping-zones td.wc-shipping-zone-sort:before{content:"\f333";font-family:Dashicons;text-align:center;color:#999;display:block;width:17px;float:left;height:100%;line-height:24px}table.wc-shipping-classes td.wc-shipping-zone-method-sort:hover:before,table.wc-shipping-classes td.wc-shipping-zone-sort:hover:before,table.wc-shipping-zone-methods td.wc-shipping-zone-method-sort:hover:before,table.wc-shipping-zone-methods td.wc-shipping-zone-sort:hover:before,table.wc-shipping-zones td.wc-shipping-zone-method-sort:hover:before,table.wc-shipping-zones td.wc-shipping-zone-sort:hover:before{color:#333}table.wc-shipping-classes td.wc-shipping-zone-worldwide,table.wc-shipping-zone-methods td.wc-shipping-zone-worldwide,table.wc-shipping-zones td.wc-shipping-zone-worldwide{text-align:center}table.wc-shipping-classes td.wc-shipping-zone-worldwide:before,table.wc-shipping-zone-methods td.wc-shipping-zone-worldwide:before,table.wc-shipping-zones td.wc-shipping-zone-worldwide:before{content:"\f319";font-family:dashicons;text-align:center;color:#999;display:block;width:17px;float:left;height:100%;line-height:24px}table.wc-shipping-classes .wc-shipping-zone-methods,table.wc-shipping-classes .wc-shipping-zone-name,table.wc-shipping-zone-methods .wc-shipping-zone-methods,table.wc-shipping-zone-methods .wc-shipping-zone-name,table.wc-shipping-zones .wc-shipping-zone-methods,table.wc-shipping-zones .wc-shipping-zone-name{width:25%}table.wc-shipping-classes .wc-shipping-class-description input,table.wc-shipping-classes .wc-shipping-class-description select,table.wc-shipping-classes .wc-shipping-class-description textarea,table.wc-shipping-classes .wc-shipping-class-name input,table.wc-shipping-classes .wc-shipping-class-name select,table.wc-shipping-classes .wc-shipping-class-name textarea,table.wc-shipping-classes .wc-shipping-class-slug input,table.wc-shipping-classes .wc-shipping-class-slug select,table.wc-shipping-classes .wc-shipping-class-slug textarea,table.wc-shipping-classes .wc-shipping-zone-name input,table.wc-shipping-classes .wc-shipping-zone-name select,table.wc-shipping-classes .wc-shipping-zone-name textarea,table.wc-shipping-classes .wc-shipping-zone-region input,table.wc-shipping-classes .wc-shipping-zone-region select,table.wc-shipping-classes .wc-shipping-zone-region textarea,table.wc-shipping-zone-methods .wc-shipping-class-description input,table.wc-shipping-zone-methods .wc-shipping-class-description select,table.wc-shipping-zone-methods .wc-shipping-class-description textarea,table.wc-shipping-zone-methods .wc-shipping-class-name input,table.wc-shipping-zone-methods .wc-shipping-class-name select,table.wc-shipping-zone-methods .wc-shipping-class-name textarea,table.wc-shipping-zone-methods .wc-shipping-class-slug input,table.wc-shipping-zone-methods .wc-shipping-class-slug select,table.wc-shipping-zone-methods .wc-shipping-class-slug textarea,table.wc-shipping-zone-methods .wc-shipping-zone-name input,table.wc-shipping-zone-methods .wc-shipping-zone-name select,table.wc-shipping-zone-methods .wc-shipping-zone-name textarea,table.wc-shipping-zone-methods .wc-shipping-zone-region input,table.wc-shipping-zone-methods .wc-shipping-zone-region select,table.wc-shipping-zone-methods .wc-shipping-zone-region textarea,table.wc-shipping-zones .wc-shipping-class-description input,table.wc-shipping-zones .wc-shipping-class-description select,table.wc-shipping-zones .wc-shipping-class-description textarea,table.wc-shipping-zones .wc-shipping-class-name input,table.wc-shipping-zones .wc-shipping-class-name select,table.wc-shipping-zones .wc-shipping-class-name textarea,table.wc-shipping-zones .wc-shipping-class-slug input,table.wc-shipping-zones .wc-shipping-class-slug select,table.wc-shipping-zones .wc-shipping-class-slug textarea,table.wc-shipping-zones .wc-shipping-zone-name input,table.wc-shipping-zones .wc-shipping-zone-name select,table.wc-shipping-zones .wc-shipping-zone-name textarea,table.wc-shipping-zones .wc-shipping-zone-region input,table.wc-shipping-zones .wc-shipping-zone-region select,table.wc-shipping-zones .wc-shipping-zone-region textarea{width:100%}table.wc-shipping-classes .wc-shipping-class-description a.wc-shipping-class-delete,table.wc-shipping-classes .wc-shipping-class-description a.wc-shipping-zone-delete,table.wc-shipping-classes .wc-shipping-class-name a.wc-shipping-class-delete,table.wc-shipping-classes .wc-shipping-class-name a.wc-shipping-zone-delete,table.wc-shipping-classes .wc-shipping-class-slug a.wc-shipping-class-delete,table.wc-shipping-classes .wc-shipping-class-slug a.wc-shipping-zone-delete,table.wc-shipping-classes .wc-shipping-zone-name a.wc-shipping-class-delete,table.wc-shipping-classes .wc-shipping-zone-name a.wc-shipping-zone-delete,table.wc-shipping-classes .wc-shipping-zone-region a.wc-shipping-class-delete,table.wc-shipping-classes .wc-shipping-zone-region a.wc-shipping-zone-delete,table.wc-shipping-zone-methods .wc-shipping-class-description a.wc-shipping-class-delete,table.wc-shipping-zone-methods .wc-shipping-class-description a.wc-shipping-zone-delete,table.wc-shipping-zone-methods .wc-shipping-class-name a.wc-shipping-class-delete,table.wc-shipping-zone-methods .wc-shipping-class-name a.wc-shipping-zone-delete,table.wc-shipping-zone-methods .wc-shipping-class-slug a.wc-shipping-class-delete,table.wc-shipping-zone-methods .wc-shipping-class-slug a.wc-shipping-zone-delete,table.wc-shipping-zone-methods .wc-shipping-zone-name a.wc-shipping-class-delete,table.wc-shipping-zone-methods .wc-shipping-zone-name a.wc-shipping-zone-delete,table.wc-shipping-zone-methods .wc-shipping-zone-region a.wc-shipping-class-delete,table.wc-shipping-zone-methods .wc-shipping-zone-region a.wc-shipping-zone-delete,table.wc-shipping-zones .wc-shipping-class-description a.wc-shipping-class-delete,table.wc-shipping-zones .wc-shipping-class-description a.wc-shipping-zone-delete,table.wc-shipping-zones .wc-shipping-class-name a.wc-shipping-class-delete,table.wc-shipping-zones .wc-shipping-class-name a.wc-shipping-zone-delete,table.wc-shipping-zones .wc-shipping-class-slug a.wc-shipping-class-delete,table.wc-shipping-zones .wc-shipping-class-slug a.wc-shipping-zone-delete,table.wc-shipping-zones .wc-shipping-zone-name a.wc-shipping-class-delete,table.wc-shipping-zones .wc-shipping-zone-name a.wc-shipping-zone-delete,table.wc-shipping-zones .wc-shipping-zone-region a.wc-shipping-class-delete,table.wc-shipping-zones .wc-shipping-zone-region a.wc-shipping-zone-delete{color:red}table.wc-shipping-classes .wc-shipping-class-description .wc-shipping-zone-postcodes-toggle,table.wc-shipping-classes .wc-shipping-class-name .wc-shipping-zone-postcodes-toggle,table.wc-shipping-classes .wc-shipping-class-slug .wc-shipping-zone-postcodes-toggle,table.wc-shipping-classes .wc-shipping-zone-name .wc-shipping-zone-postcodes-toggle,table.wc-shipping-classes .wc-shipping-zone-region .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zone-methods .wc-shipping-class-description .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zone-methods .wc-shipping-class-name .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zone-methods .wc-shipping-class-slug .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zone-methods .wc-shipping-zone-name .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zone-methods .wc-shipping-zone-region .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zones .wc-shipping-class-description .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zones .wc-shipping-class-name .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zones .wc-shipping-class-slug .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zones .wc-shipping-zone-name .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zones .wc-shipping-zone-region .wc-shipping-zone-postcodes-toggle{float:right;margin:0;font-size:.9em;text-decoration:underline}table.wc-shipping-classes .wc-shipping-class-description .wc-shipping-zone-postcodes,table.wc-shipping-classes .wc-shipping-class-name .wc-shipping-zone-postcodes,table.wc-shipping-classes .wc-shipping-class-slug .wc-shipping-zone-postcodes,table.wc-shipping-classes .wc-shipping-zone-name .wc-shipping-zone-postcodes,table.wc-shipping-classes .wc-shipping-zone-region .wc-shipping-zone-postcodes,table.wc-shipping-zone-methods .wc-shipping-class-description .wc-shipping-zone-postcodes,table.wc-shipping-zone-methods .wc-shipping-class-name .wc-shipping-zone-postcodes,table.wc-shipping-zone-methods .wc-shipping-class-slug .wc-shipping-zone-postcodes,table.wc-shipping-zone-methods .wc-shipping-zone-name .wc-shipping-zone-postcodes,table.wc-shipping-zone-methods .wc-shipping-zone-region .wc-shipping-zone-postcodes,table.wc-shipping-zones .wc-shipping-class-description .wc-shipping-zone-postcodes,table.wc-shipping-zones .wc-shipping-class-name .wc-shipping-zone-postcodes,table.wc-shipping-zones .wc-shipping-class-slug .wc-shipping-zone-postcodes,table.wc-shipping-zones .wc-shipping-zone-name .wc-shipping-zone-postcodes,table.wc-shipping-zones .wc-shipping-zone-region .wc-shipping-zone-postcodes{display:none}table.wc-shipping-classes .wc-shipping-class-description .wc-shipping-zone-postcodes textarea,table.wc-shipping-classes .wc-shipping-class-name .wc-shipping-zone-postcodes textarea,table.wc-shipping-classes .wc-shipping-class-slug .wc-shipping-zone-postcodes textarea,table.wc-shipping-classes .wc-shipping-zone-name .wc-shipping-zone-postcodes textarea,table.wc-shipping-classes .wc-shipping-zone-region .wc-shipping-zone-postcodes textarea,table.wc-shipping-zone-methods .wc-shipping-class-description .wc-shipping-zone-postcodes textarea,table.wc-shipping-zone-methods .wc-shipping-class-name .wc-shipping-zone-postcodes textarea,table.wc-shipping-zone-methods .wc-shipping-class-slug .wc-shipping-zone-postcodes textarea,table.wc-shipping-zone-methods .wc-shipping-zone-name .wc-shipping-zone-postcodes textarea,table.wc-shipping-zone-methods .wc-shipping-zone-region .wc-shipping-zone-postcodes textarea,table.wc-shipping-zones .wc-shipping-class-description .wc-shipping-zone-postcodes textarea,table.wc-shipping-zones .wc-shipping-class-name .wc-shipping-zone-postcodes textarea,table.wc-shipping-zones .wc-shipping-class-slug .wc-shipping-zone-postcodes textarea,table.wc-shipping-zones .wc-shipping-zone-name .wc-shipping-zone-postcodes textarea,table.wc-shipping-zones .wc-shipping-zone-region .wc-shipping-zone-postcodes textarea{margin-top:1em}table.wc-shipping-classes .wc-shipping-class-description .wc-shipping-zone-postcodes .description,table.wc-shipping-classes .wc-shipping-class-name .wc-shipping-zone-postcodes .description,table.wc-shipping-classes .wc-shipping-class-slug .wc-shipping-zone-postcodes .description,table.wc-shipping-classes .wc-shipping-zone-name .wc-shipping-zone-postcodes .description,table.wc-shipping-classes .wc-shipping-zone-region .wc-shipping-zone-postcodes .description,table.wc-shipping-zone-methods .wc-shipping-class-description .wc-shipping-zone-postcodes .description,table.wc-shipping-zone-methods .wc-shipping-class-name .wc-shipping-zone-postcodes .description,table.wc-shipping-zone-methods .wc-shipping-class-slug .wc-shipping-zone-postcodes .description,table.wc-shipping-zone-methods .wc-shipping-zone-name .wc-shipping-zone-postcodes .description,table.wc-shipping-zone-methods .wc-shipping-zone-region .wc-shipping-zone-postcodes .description,table.wc-shipping-zones .wc-shipping-class-description .wc-shipping-zone-postcodes .description,table.wc-shipping-zones .wc-shipping-class-name .wc-shipping-zone-postcodes .description,table.wc-shipping-zones .wc-shipping-class-slug .wc-shipping-zone-postcodes .description,table.wc-shipping-zones .wc-shipping-zone-name .wc-shipping-zone-postcodes .description,table.wc-shipping-zones .wc-shipping-zone-region .wc-shipping-zone-postcodes .description{font-size:.9em;color:#999}table.wc-shipping-classes .wc-shipping-class-count,table.wc-shipping-zone-methods .wc-shipping-class-count,table.wc-shipping-zones .wc-shipping-class-count{text-align:center}table.wc-shipping-classes td.wc-shipping-zone-methods,table.wc-shipping-zone-methods td.wc-shipping-zone-methods,table.wc-shipping-zones td.wc-shipping-zone-methods{color:#999}table.wc-shipping-classes td.wc-shipping-zone-methods .method_disabled,table.wc-shipping-zone-methods td.wc-shipping-zone-methods .method_disabled,table.wc-shipping-zones td.wc-shipping-zone-methods .method_disabled{text-decoration:line-through}table.wc-shipping-classes td.wc-shipping-zone-methods ul,table.wc-shipping-zone-methods td.wc-shipping-zone-methods ul,table.wc-shipping-zones td.wc-shipping-zone-methods ul{color:#999;position:relative;padding-right:32px}table.wc-shipping-classes td.wc-shipping-zone-methods ul li,table.wc-shipping-zone-methods td.wc-shipping-zone-methods ul li,table.wc-shipping-zones td.wc-shipping-zone-methods ul li{display:inline;margin:0}table.wc-shipping-classes td.wc-shipping-zone-methods ul li:before,table.wc-shipping-zone-methods td.wc-shipping-zone-methods ul li:before,table.wc-shipping-zones td.wc-shipping-zone-methods ul li:before{content:", "}table.wc-shipping-classes td.wc-shipping-zone-methods ul li:first-child:before,table.wc-shipping-classes td.wc-shipping-zone-methods ul li:nth-child(2):before,table.wc-shipping-zone-methods td.wc-shipping-zone-methods ul li:first-child:before,table.wc-shipping-zone-methods td.wc-shipping-zone-methods ul li:nth-child(2):before,table.wc-shipping-zones td.wc-shipping-zone-methods ul li:first-child:before,table.wc-shipping-zones td.wc-shipping-zone-methods ul li:nth-child(2):before{content:""}table.wc-shipping-classes td.wc-shipping-zone-methods ul li:first-child,table.wc-shipping-zone-methods td.wc-shipping-zone-methods ul li:first-child,table.wc-shipping-zones td.wc-shipping-zone-methods ul li:first-child{display:block}table.wc-shipping-classes td.wc-shipping-zone-methods ul li.wc-shipping-zone-methods-add-row,table.wc-shipping-zone-methods td.wc-shipping-zone-methods ul li.wc-shipping-zone-methods-add-row,table.wc-shipping-zones td.wc-shipping-zone-methods ul li.wc-shipping-zone-methods-add-row{position:absolute;right:0;top:0}table.wc-shipping-classes td.wc-shipping-zone-methods .add_shipping_method,table.wc-shipping-zone-methods td.wc-shipping-zone-methods .add_shipping_method,table.wc-shipping-zones td.wc-shipping-zone-methods .add_shipping_method{display:block;width:24px;padding:24px 0 0;height:0;overflow:hidden;cursor:pointer}table.wc-shipping-classes td.wc-shipping-zone-methods .add_shipping_method:before,table.wc-shipping-zone-methods td.wc-shipping-zone-methods .add_shipping_method:before,table.wc-shipping-zones td.wc-shipping-zone-methods .add_shipping_method:before{speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;font-family:Dashicons;content:"\f502";color:#999;vertical-align:middle;line-height:24px;font-size:16px;margin:0}table.wc-shipping-classes .wc-shipping-zone-method-enabled .status-disabled:before,table.wc-shipping-classes .wc-shipping-zone-method-enabled .status-enabled:before,table.wc-shipping-zone-methods .wc-shipping-zone-method-enabled .status-disabled:before,table.wc-shipping-zone-methods .wc-shipping-zone-method-enabled .status-enabled:before,table.wc-shipping-zones .wc-shipping-zone-method-enabled .status-disabled:before,table.wc-shipping-zones .wc-shipping-zone-method-enabled .status-enabled:before{line-height:inherit}table.wc-shipping-classes .wc-shipping-zone-method-enabled .status-disabled,table.wc-shipping-classes .wc-shipping-zone-method-enabled .status-enabled,table.wc-shipping-zone-methods .wc-shipping-zone-method-enabled .status-disabled,table.wc-shipping-zone-methods .wc-shipping-zone-method-enabled .status-enabled,table.wc-shipping-zones .wc-shipping-zone-method-enabled .status-disabled,table.wc-shipping-zones .wc-shipping-zone-method-enabled .status-enabled{margin-top:1px;display:inline-block}table.wc-shipping-classes td.wc-shipping-zone-methods .add_shipping_method.disabled,table.wc-shipping-zone-methods td.wc-shipping-zone-methods .add_shipping_method.disabled,table.wc-shipping-zones td.wc-shipping-zone-methods .add_shipping_method.disabled{cursor:not-allowed}table.wc-shipping-classes td.wc-shipping-zone-methods .add_shipping_method.disabled:before,table.wc-shipping-zone-methods td.wc-shipping-zone-methods .add_shipping_method.disabled:before,table.wc-shipping-zones td.wc-shipping-zone-methods .add_shipping_method.disabled:before{color:#ccc}table.wc-shipping-classes .wc-shipping-zone-method-title,table.wc-shipping-zone-methods .wc-shipping-zone-method-title,table.wc-shipping-zones .wc-shipping-zone-method-title{width:33%}table.wc-shipping-classes .wc-shipping-zone-method-title .wc-shipping-zone-method-delete,table.wc-shipping-zone-methods .wc-shipping-zone-method-title .wc-shipping-zone-method-delete,table.wc-shipping-zones .wc-shipping-zone-method-title .wc-shipping-zone-method-delete{color:red}table.wc-shipping-classes .wc-shipping-zone-method-enabled,table.wc-shipping-zone-methods .wc-shipping-zone-method-enabled,table.wc-shipping-zones .wc-shipping-zone-method-enabled{text-align:center}table.wc-shipping-classes tfoot input,table.wc-shipping-classes tfoot select,table.wc-shipping-zone-methods tfoot input,table.wc-shipping-zone-methods tfoot select,table.wc-shipping-zones tfoot input,table.wc-shipping-zones tfoot select{vertical-align:middle!important}table.wc-shipping-classes tfoot .button-secondary,table.wc-shipping-zone-methods tfoot .button-secondary,table.wc-shipping-zones tfoot .button-secondary{float:right}table.wc-shipping-classes .editing .wc-shipping-zone-edit,table.wc-shipping-classes .editing .wc-shipping-zone-view,table.wc-shipping-zone-methods .editing .wc-shipping-zone-edit,table.wc-shipping-zone-methods .editing .wc-shipping-zone-view,table.wc-shipping-zones .editing .wc-shipping-zone-edit,table.wc-shipping-zones .editing .wc-shipping-zone-view{display:none}.wc-modal-shipping-method-settings{background:#f8f8f8;padding:1em!important}.wc-modal-shipping-method-settings form .form-table{width:100%;background:#fff;margin:0 0 1.5em}.wc-modal-shipping-method-settings form .form-table tr th{width:30%;position:relative}.wc-modal-shipping-method-settings form .form-table tr th .woocommerce-help-tip{float:right;margin:-8px -.5em 0 0;vertical-align:middle;right:0;top:50%;position:absolute}.wc-modal-shipping-method-settings form .form-table tr td input,.wc-modal-shipping-method-settings form .form-table tr td select,.wc-modal-shipping-method-settings form .form-table tr td textarea{width:50%;min-width:250px}.wc-modal-shipping-method-settings form .form-table tr td input[type=checkbox]{width:auto;min-width:16px}.wc-modal-shipping-method-settings form .form-table tr td,.wc-modal-shipping-method-settings form .form-table tr th{vertical-align:middle;margin:0;line-height:24px;padding:1em;border-bottom:1px solid #f8f8f8}.wc-modal-shipping-method-settings form .form-table:last-of-type{margin-bottom:0}.wc-backbone-modal .wc-shipping-zone-method-selector p{margin-top:0}.wc-backbone-modal .wc-shipping-zone-method-selector .wc-shipping-zone-method-description{margin:.75em 1px 0;line-height:1.5em;color:#999;font-style:italic}.wc-backbone-modal .wc-shipping-zone-method-selector select{width:100%;cursor:pointer}img.help_tip{margin:0 0 0 9px;vertical-align:middle}.postbox img.help_tip{margin-top:0}.postbox .woocommerce-help-tip{margin:0 0 0 9px}.status-disabled,.status-enabled,.status-manual{font-size:1.4em;display:block;text-indent:-9999px;position:relative;height:1em;width:1em}.status-disabled:before,.status-enabled:before,.status-manual:before{font-family:WooCommerce;line-height:1;margin:0;position:absolute;width:100%;height:100%;text-indent:0;top:0;font-variant:normal;-webkit-font-smoothing:antialiased;font-weight:400;text-align:center;left:0;speak:none;text-transform:none}.status-manual:before{content:"";color:#999}.status-enabled:before{content:"";color:#a46497}.status-disabled:before{content:"";color:#ccc}.woocommerce h2.woo-nav-tab-wrapper{margin-bottom:1em}.woocommerce nav.woo-nav-tab-wrapper{margin:1.5em 0 1em;border-bottom:1px solid #ccc}.woocommerce .subsubsub{margin:-8px 0 0}.woocommerce .wc-admin-breadcrumb{margin-left:.5em}.woocommerce .wc-admin-breadcrumb a{color:#a46497}.woocommerce #template div{margin:0}.woocommerce #template div p .button{float:right;margin-left:10px;margin-top:-4px}.woocommerce #template div .editor textarea{margin-bottom:8px}.woocommerce textarea[disabled=disabled]{background:#DFDFDF!important}.woocommerce table.form-table{margin:0;position:relative}.woocommerce table.form-table .forminp-radio ul{margin:0}.woocommerce table.form-table .forminp-radio ul li{line-height:1.4em}.woocommerce table.form-table textarea.input-text{height:100%;min-width:150px;display:block}.woocommerce table.form-table input.regular-input{width:25em}.woocommerce table.form-table textarea.wide-input{width:100%}.woocommerce table.form-table .woocommerce-help-tip,.woocommerce table.form-table img.help_tip{padding:0;margin:-4px 0 0 5px;vertical-align:middle;cursor:help;line-height:1}.woocommerce table.form-table span.help_tip{cursor:help;color:#2ea2cc}.woocommerce table.form-table th{position:relative;padding-right:24px}.woocommerce table.form-table .select2-container{display:block;max-width:350px;vertical-align:top;margin-bottom:3px}.woocommerce table.form-table table.widefat th{padding-right:inherit}.woocommerce table.form-table th .woocommerce-help-tip,.woocommerce table.form-table th img.help_tip{margin:0 -24px 0 0;float:right}.woocommerce table.form-table .wp-list-table .woocommerce-help-tip{float:none}.woocommerce table.form-table fieldset{margin-top:4px}.woocommerce table.form-table fieldset .woocommerce-help-tip,.woocommerce table.form-table fieldset img.help_tip{margin:-3px 0 0 5px}.woocommerce table.form-table fieldset p.description{margin-bottom:8px}.woocommerce table.form-table fieldset:first-child{margin-top:0}.woocommerce table.form-table .iris-picker{z-index:100;display:none;position:absolute;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.2)}.woocommerce table.form-table .iris-picker .ui-slider{border:0!important;margin:0!important;width:auto!important;height:auto!important;background:none!important}.woocommerce table.form-table .iris-picker .ui-slider .ui-slider-handle{margin-bottom:0!important}.woocommerce table.form-table .colorpickpreview{padding:3px 3px 3px 20px;border:1px solid #ddd;border-right:0}.woocommerce table.form-table .colorpick{border-left:0}.woocommerce table.form-table .image_width_settings{vertical-align:middle}.woocommerce table.form-table .image_width_settings label{margin-left:10px}.woocommerce table.form-table .wc_emails_wrapper{padding:0 15px 10px 0}.woocommerce #tabs-wrap table a.remove{margin-left:4px}.woocommerce #tabs-wrap table p{margin:0 0 4px!important;overflow:hidden;zoom:1}.woocommerce #tabs-wrap table p a.add{float:left}#wp-excerpt-editor-container{background:#fff}#product_variation-parent #parent_id{width:100%}#postimagediv img{border:1px solid #d5d5d5;max-width:100%}#woocommerce-product-images .inside{margin:0;padding:0}#woocommerce-product-images .inside .add_product_images{padding:0 12px 12px}#woocommerce-product-images .inside #product_images_container{padding:0 0 0 9px}#woocommerce-product-images .inside #product_images_container ul{margin:0;padding:0}#woocommerce-product-images .inside #product_images_container ul:after,#woocommerce-product-images .inside #product_images_container ul:before{content:" ";display:table}#woocommerce-product-images .inside #product_images_container ul:after{clear:both}#woocommerce-product-images .inside #product_images_container ul li.add,#woocommerce-product-images .inside #product_images_container ul li.image,#woocommerce-product-images .inside #product_images_container ul li.wc-metabox-sortable-placeholder{width:80px;float:left;cursor:move;border:1px solid #d5d5d5;margin:9px 9px 0 0;background:#f7f7f7;border-radius:2px;position:relative;box-sizing:border-box}#woocommerce-product-images .inside #product_images_container ul li.add img,#woocommerce-product-images .inside #product_images_container ul li.image img,#woocommerce-product-images .inside #product_images_container ul li.wc-metabox-sortable-placeholder img{width:100%;height:auto;display:block}#woocommerce-product-images .inside #product_images_container ul li.wc-metabox-sortable-placeholder{border:3px dashed #ddd;position:relative}#woocommerce-product-images .inside #product_images_container ul li.wc-metabox-sortable-placeholder:after{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";font-size:2.618em;line-height:72px;color:#ddd}#woocommerce-product-images .inside #product_images_container ul ul.actions{position:absolute;top:-8px;right:-8px;padding:2px;display:none}#woocommerce-product-images .inside #product_images_container ul ul.actions li{float:right;margin:0 0 0 2px}#woocommerce-product-images .inside #product_images_container ul ul.actions li a{width:1em;margin:0;height:0;display:block;overflow:hidden}#woocommerce-product-images .inside #product_images_container ul ul.actions li a.tips{cursor:pointer}#woocommerce-product-images .inside #product_images_container ul ul.actions li a.delete{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;font-size:1.4em}#woocommerce-product-images .inside #product_images_container ul ul.actions li a.delete:before{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";color:#999}#woocommerce-product-images .inside #product_images_container ul ul.actions li a.delete:hover:before{color:#a00}#woocommerce-product-images .inside #product_images_container ul li:hover ul.actions{display:block}#woocommerce-product-data .hndle{padding:10px}#woocommerce-product-data .hndle span{display:block;vertical-align:middle;line-height:24px}#woocommerce-product-data .hndle span span{display:inline;line-height:inherit;vertical-align:baseline}#woocommerce-product-data .hndle label{padding-right:1em;font-size:12px;vertical-align:baseline}#woocommerce-product-data .hndle label:first-child{margin-right:1em;border-right:1px solid #dfdfdf}#woocommerce-product-data .hndle input,#woocommerce-product-data .hndle select{margin:-3px 0 0 .5em;vertical-align:middle}#woocommerce-product-data>.handlediv{margin-top:4px}#woocommerce-product-data .wrap{margin:0}#woocommerce-coupon-description{padding:3px 8px;font-size:1.7em;line-height:1.42em;height:auto;width:100%;outline:0;margin:10px 0;display:block}#woocommerce-coupon-description::-webkit-input-placeholder{line-height:1.42em;color:#bbb}#woocommerce-coupon-description::-moz-placeholder{line-height:1.42em;color:#bbb}#woocommerce-coupon-description:-ms-input-placeholder{line-height:1.42em;color:#bbb}#woocommerce-coupon-description:-moz-placeholder{line-height:1.42em;color:#bbb}#woocommerce-coupon-data .panel-wrap,#woocommerce-product-data .panel-wrap{background:#fff}#woocommerce-coupon-data .wc-metaboxes-wrapper,#woocommerce-coupon-data .woocommerce_options_panel,#woocommerce-product-data .wc-metaboxes-wrapper,#woocommerce-product-data .woocommerce_options_panel{float:left;width:80%}#woocommerce-coupon-data .wc-metaboxes-wrapper .wc-radios,#woocommerce-coupon-data .woocommerce_options_panel .wc-radios,#woocommerce-product-data .wc-metaboxes-wrapper .wc-radios,#woocommerce-product-data .woocommerce_options_panel .wc-radios{display:block;float:left;margin:0}#woocommerce-coupon-data .wc-metaboxes-wrapper .wc-radios li,#woocommerce-coupon-data .woocommerce_options_panel .wc-radios li,#woocommerce-product-data .wc-metaboxes-wrapper .wc-radios li,#woocommerce-product-data .woocommerce_options_panel .wc-radios li{display:block;padding:0 0 10px}#woocommerce-coupon-data .wc-metaboxes-wrapper .wc-radios li input,#woocommerce-coupon-data .woocommerce_options_panel .wc-radios li input,#woocommerce-product-data .wc-metaboxes-wrapper .wc-radios li input,#woocommerce-product-data .woocommerce_options_panel .wc-radios li input{width:auto}#woocommerce-coupon-data .panel-wrap,#woocommerce-product-data .panel-wrap,.woocommerce .panel-wrap{overflow:hidden}#woocommerce-coupon-data ul.wc-tabs,#woocommerce-product-data ul.wc-tabs,.woocommerce ul.wc-tabs{margin:0;width:20%;float:left;line-height:1em;padding:0 0 10px;position:relative;background-color:#fafafa;border-right:1px solid #eee;box-sizing:border-box}#woocommerce-coupon-data ul.wc-tabs:after,#woocommerce-product-data ul.wc-tabs:after,.woocommerce ul.wc-tabs:after{content:"";display:block;width:100%;height:9999em;position:absolute;bottom:-9999em;left:0;background-color:#fafafa;border-right:1px solid #eee}#woocommerce-coupon-data ul.wc-tabs li,#woocommerce-product-data ul.wc-tabs li,.woocommerce ul.wc-tabs li{margin:0;padding:0;display:block;position:relative}#woocommerce-coupon-data ul.wc-tabs li a,#woocommerce-product-data ul.wc-tabs li a,.woocommerce ul.wc-tabs li a{margin:0;padding:10px;display:block;box-shadow:none;text-decoration:none;line-height:20px!important;border-bottom:1px solid #eee}#woocommerce-coupon-data ul.wc-tabs li a:before,#woocommerce-product-data ul.wc-tabs li a:before,.woocommerce ul.wc-tabs li a:before{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-right:.618em;content:"";text-decoration:none}#woocommerce-coupon-data ul.wc-tabs li.general_options a:before,#woocommerce-product-data ul.wc-tabs li.general_options a:before,.woocommerce ul.wc-tabs li.general_options a:before{content:"\f107"}#woocommerce-coupon-data ul.wc-tabs li.inventory_options a:before,#woocommerce-product-data ul.wc-tabs li.inventory_options a:before,.woocommerce ul.wc-tabs li.inventory_options a:before{content:"\f481"}#woocommerce-coupon-data ul.wc-tabs li.shipping_options a:before,#woocommerce-product-data ul.wc-tabs li.shipping_options a:before,.woocommerce ul.wc-tabs li.shipping_options a:before{font-family:WooCommerce;content:"\e01a"}#woocommerce-coupon-data ul.wc-tabs li.linked_product_options a:before,#woocommerce-product-data ul.wc-tabs li.linked_product_options a:before,.woocommerce ul.wc-tabs li.linked_product_options a:before{content:"\f103"}#woocommerce-coupon-data ul.wc-tabs li.attribute_options a:before,#woocommerce-product-data ul.wc-tabs li.attribute_options a:before,.woocommerce ul.wc-tabs li.attribute_options a:before{content:"\f175"}#woocommerce-coupon-data ul.wc-tabs li.advanced_options a:before,#woocommerce-product-data ul.wc-tabs li.advanced_options a:before,.woocommerce ul.wc-tabs li.advanced_options a:before{font-family:Dashicons;content:"\f111"}#woocommerce-coupon-data ul.wc-tabs li.variations_options a:before,#woocommerce-product-data ul.wc-tabs li.variations_options a:before,.woocommerce ul.wc-tabs li.variations_options a:before{content:"\f509"}#woocommerce-coupon-data ul.wc-tabs li.usage_restriction_options a:before,#woocommerce-product-data ul.wc-tabs li.usage_restriction_options a:before,.woocommerce ul.wc-tabs li.usage_restriction_options a:before{font-family:WooCommerce;content:"\e602"}#woocommerce-coupon-data ul.wc-tabs li.usage_limit_options a:before,#woocommerce-product-data ul.wc-tabs li.usage_limit_options a:before,.woocommerce ul.wc-tabs li.usage_limit_options a:before{font-family:WooCommerce;content:"\e601"}#woocommerce-coupon-data ul.wc-tabs li.general_coupon_data a:before,#woocommerce-product-data ul.wc-tabs li.general_coupon_data a:before,.woocommerce ul.wc-tabs li.general_coupon_data a:before{font-family:WooCommerce;content:"\e600"}#woocommerce-coupon-data ul.wc-tabs li.active a,#woocommerce-product-data ul.wc-tabs li.active a,.woocommerce ul.wc-tabs li.active a{color:#555;position:relative;background-color:#eee}.woocommerce_page_wc-settings .shippingrows th.check-column{padding-top:20px}.woocommerce_page_wc-settings .shippingrows tfoot th{padding-left:10px}.woocommerce_page_wc-settings .shippingrows .add.button:before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-right:.618em;content:"";text-decoration:none}.woocommerce_page_wc-settings h3.wc-settings-sub-title{font-size:1.2em}#woocommerce-coupon-data .inside,#woocommerce-order-data .inside,#woocommerce-order-downloads .inside,#woocommerce-product-data .inside,#woocommerce-product-type-options .inside{margin:0;padding:0}.panel,.woocommerce_options_panel{padding:9px;color:#555}.panel .form-field .woocommerce-help-tip,.woocommerce_options_panel .form-field .woocommerce-help-tip{font-size:1.4em}.panel,.woocommerce_page_settings .woocommerce_options_panel{padding:0}#woocommerce-product-specs .inside,#woocommerce-product-type-options .panel{margin:0;padding:9px}#woocommerce-product-type-options .panel p,.woocommerce_options_panel fieldset.form-field,.woocommerce_options_panel p{margin:0 0 9px;font-size:12px;padding:5px 9px;line-height:24px}#woocommerce-product-type-options .panel p:after,.woocommerce_options_panel fieldset.form-field:after,.woocommerce_options_panel p:after{content:".";display:block;height:0;clear:both;visibility:hidden}.woocommerce_options_panel .checkbox,.woocommerce_variable_attributes .checkbox{width:auto;margin:3px 0;vertical-align:middle}.woocommerce_options_panel .downloadable_files table,.woocommerce_variations .downloadable_files table{width:100%;padding:0!important}.woocommerce_options_panel .downloadable_files table th,.woocommerce_variations .downloadable_files table th{padding:7px 0 7px 7px!important}.woocommerce_options_panel .downloadable_files table th.sort,.woocommerce_variations .downloadable_files table th.sort{width:17px;padding:7px!important}.woocommerce_options_panel .downloadable_files table th .woocommerce-help-tip,.woocommerce_variations .downloadable_files table th .woocommerce-help-tip{font-size:1.1em;margin-left:0}.woocommerce_options_panel .downloadable_files table td,.woocommerce_variations .downloadable_files table td{vertical-align:middle!important;padding:4px 0 4px 7px!important;position:relative}.woocommerce_options_panel .downloadable_files table td:last-child,.woocommerce_variations .downloadable_files table td:last-child{padding-right:7px!important}.woocommerce_options_panel .downloadable_files table td input.input_text,.woocommerce_variations .downloadable_files table td input.input_text{width:100%;float:none;min-width:0;margin:1px 0}.woocommerce_options_panel .downloadable_files table td .upload_file_button,.woocommerce_variations .downloadable_files table td .upload_file_button{width:auto;float:right;cursor:pointer}.woocommerce_options_panel .downloadable_files table td .delete,.woocommerce_variations .downloadable_files table td .delete{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;font-size:1.2em}.woocommerce_options_panel .downloadable_files table td .delete:before,.woocommerce_variations .downloadable_files table td .delete:before{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";color:#999}.woocommerce_options_panel .downloadable_files table td .delete:hover:before,.woocommerce_variations .downloadable_files table td .delete:hover:before{color:#a00}.woocommerce_options_panel .downloadable_files table td.sort,.woocommerce_variations .downloadable_files table td.sort{width:17px;cursor:move;font-size:15px;text-align:center;background:#f9f9f9;padding-right:7px!important}.woocommerce_options_panel .downloadable_files table td.sort:before,.woocommerce_variations .downloadable_files table td.sort:before{content:"\f333";font-family:Dashicons;text-align:center;line-height:1;color:#999;display:block;width:17px;float:left;height:100%}.woocommerce_options_panel .downloadable_files table td.sort:hover:before,.woocommerce_variations .downloadable_files table td.sort:hover:before{color:#333}.woocommerce_variation h3 .sort{width:17px;height:26px;cursor:move;float:right;font-size:15px;font-weight:400;margin-right:.5em;visibility:hidden;text-align:center;vertical-align:middle}.woocommerce_variation h3 .sort:before{content:"\f333";font-family:Dashicons;text-align:center;line-height:28px;color:#999;display:block;width:17px;float:left;height:100%}.woocommerce_variation h3 .sort:hover:before{color:#777}.woocommerce_variation h3:hover .sort,.woocommerce_variation.ui-sortable-helper .sort{visibility:visible}.woocommerce_options_panel{min-height:175px;box-sizing:border-box}.woocommerce_options_panel .downloadable_files{padding:0 9px 0 162px;position:relative;margin:9px 0}.woocommerce_options_panel .downloadable_files label{position:absolute;left:0;margin:0 0 0 12px;line-height:24px}.woocommerce_options_panel p{margin:9px 0}.woocommerce_options_panel fieldset.form-field,.woocommerce_options_panel p.form-field{padding:5px 20px 5px 162px!important}.woocommerce_options_panel .sale_price_dates_fields .short:first-of-type{margin-bottom:1em}.woocommerce_options_panel .sale_price_dates_fields .short:nth-of-type(2){clear:left}.woocommerce_options_panel label,.woocommerce_options_panel legend{float:left;width:150px;padding:0;margin:0 0 0 -150px}.woocommerce_options_panel label .req,.woocommerce_options_panel legend .req{font-weight:700;font-style:normal;color:#a00}.woocommerce_options_panel .description{padding:0;margin:0 0 0 7px;clear:none;display:inline}.woocommerce_options_panel .description-block{margin-left:0;display:block}.woocommerce_options_panel input,.woocommerce_options_panel select,.woocommerce_options_panel textarea{margin:0}.woocommerce_options_panel textarea{height:3.5em;line-height:1.5em;vertical-align:top}.woocommerce_options_panel input[type=text],.woocommerce_options_panel input[type=number],.woocommerce_options_panel input[type=email],.woocommerce_options_panel input[type=password]{width:50%;float:left}.woocommerce_options_panel input.button{width:auto;margin-left:8px}.woocommerce_options_panel select{float:left}.woocommerce_options_panel .short,.woocommerce_options_panel input[type=text].short,.woocommerce_options_panel input[type=number].short,.woocommerce_options_panel input[type=email].short,.woocommerce_options_panel input[type=password].short{width:50%}.woocommerce_options_panel .sized{width:auto!important;margin-right:6px}.woocommerce_options_panel .options_group{border-top:1px solid #fff;border-bottom:1px solid #eee}.woocommerce_options_panel .options_group:first-child{border-top:0}.woocommerce_options_panel .options_group:last-child{border-bottom:0}.woocommerce_options_panel .options_group fieldset{margin:9px 0;font-size:12px;padding:5px 9px;line-height:24px}.woocommerce_options_panel .options_group fieldset label{width:auto;float:none}.woocommerce_options_panel .options_group fieldset ul{float:left;width:50%;margin:0;padding:0}.woocommerce_options_panel .options_group fieldset ul li{margin:0;width:auto}.woocommerce_options_panel .options_group fieldset ul li input{width:auto;float:none;margin-right:4px}.woocommerce_options_panel .options_group fieldset ul.wc-radios label{margin-left:0}.woocommerce_options_panel .dimensions_field .wrap{display:block;width:50%}.woocommerce_options_panel .dimensions_field .wrap input{width:30.75%;margin-right:3.8%}.woocommerce_options_panel .dimensions_field .wrap .last{margin-right:0}.woocommerce_options_panel.padded{padding:1em}#woocommerce-product-data input.dp-applied,.woocommerce_options_panel .select2-container{float:left}#grouped_product_options,#simple_product_options,#virtual_product_options{padding:12px;font-style:italic;color:#666}.wc-metaboxes-wrapper .toolbar{margin:0!important;border-top:1px solid #fff;border-bottom:1px solid #eee;padding:9px 12px!important}.wc-metaboxes-wrapper .toolbar:first-child{border-top:0}.wc-metaboxes-wrapper .toolbar:last-child{border-bottom:0}.wc-metaboxes-wrapper .toolbar .add_variation{float:right;margin-left:5px}.wc-metaboxes-wrapper .toolbar .cancel-variation-changes,.wc-metaboxes-wrapper .toolbar .save-variation-changes{float:left;margin-right:5px}.wc-metaboxes-wrapper p.toolbar{overflow:hidden;zoom:1}.wc-metaboxes-wrapper .expand-close{margin-right:2px;color:#777;font-size:12px;font-style:italic}.wc-metaboxes-wrapper .expand-close a{background:0 0;padding:0;font-size:12px;text-decoration:none}.wc-metaboxes-wrapper#product_attributes .expand-close{float:right;line-height:28px}.wc-metaboxes-wrapper .fr,.wc-metaboxes-wrapper button.add_variable_attribute{float:right;margin:0 0 0 6px}.wc-metaboxes-wrapper .wc-metaboxes{border-bottom:1px solid #eee}.wc-metaboxes-wrapper .wc-metabox-sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;margin-bottom:9px;border-width:1px;border-style:dashed}.wc-metaboxes-wrapper .wc-metabox{background:#fff;border-bottom:1px solid #eee;margin:0!important}.wc-metaboxes-wrapper .wc-metabox select{font-weight:400}.wc-metaboxes-wrapper .wc-metabox:last-of-type{border-bottom:0}.wc-metaboxes-wrapper .wc-metabox .handlediv{width:27px}.wc-metaboxes-wrapper .wc-metabox .handlediv:before{content:"\f142"!important;cursor:pointer;display:inline-block;font:400 20px/1 Dashicons;line-height:.5!important;padding:8px 10px;position:relative;right:12px;top:0}.wc-metaboxes-wrapper .wc-metabox.closed{border-radius:3px}.wc-metaboxes-wrapper .wc-metabox.closed .handlediv:before{content:"\f140"!important}.wc-metaboxes-wrapper .wc-metabox.closed h3{border:0}.wc-metaboxes-wrapper .wc-metabox h3{margin:0!important;padding:.75em .75em .75em 1em!important;font-size:1em!important;overflow:hidden;zoom:1;cursor:move}.wc-metaboxes-wrapper .wc-metabox h3 a.delete,.wc-metaboxes-wrapper .wc-metabox h3 button{float:right}.wc-metaboxes-wrapper .wc-metabox h3 a.delete{color:red;font-weight:400;line-height:26px;text-decoration:none;position:relative;visibility:hidden}.wc-metaboxes-wrapper .wc-metabox h3 strong{line-height:26px;font-weight:700}.wc-metaboxes-wrapper .wc-metabox h3 select{font-family:sans-serif;max-width:20%;margin:.25em .25em .25em 0}.wc-metaboxes-wrapper .wc-metabox h3 .handlediv{background-position:6px 5px!important;visibility:hidden;height:26px}.wc-metaboxes-wrapper .wc-metabox h3.fixed{cursor:pointer!important}.wc-metaboxes-wrapper .wc-metabox.woocommerce_variation h3{cursor:pointer;padding:.5em .75em .5em 1em!important}.wc-metaboxes-wrapper .wc-metabox.woocommerce_variation h3 .handlediv,.wc-metaboxes-wrapper .wc-metabox.woocommerce_variation h3 .sort,.wc-metaboxes-wrapper .wc-metabox.woocommerce_variation h3 a.delete{margin-top:.25em}.wc-metaboxes-wrapper .wc-metabox h3:hover .handlediv,.wc-metaboxes-wrapper .wc-metabox h3:hover a.delete,.wc-metaboxes-wrapper .wc-metabox.ui-sortable-helper .handlediv,.wc-metaboxes-wrapper .wc-metabox.ui-sortable-helper a.delete{visibility:visible}.wc-metaboxes-wrapper .wc-metabox table{width:100%;position:relative;background-color:#fdfdfd;padding:1em;border-top:1px solid #eee}.wc-metaboxes-wrapper .wc-metabox table td{text-align:left;padding:0 6px 1em 0;vertical-align:top;border:0}.wc-metaboxes-wrapper .wc-metabox table td label{text-align:left;display:block;line-height:21px}.wc-metaboxes-wrapper .wc-metabox table td input{float:left;min-width:200px}.wc-metaboxes-wrapper .wc-metabox table td input,.wc-metaboxes-wrapper .wc-metabox table td textarea{width:100%;margin:0;display:block;font-size:14px;padding:4px;color:#555}.wc-metaboxes-wrapper .wc-metabox table td .select2-container,.wc-metaboxes-wrapper .wc-metabox table td select{width:100%!important}.wc-metaboxes-wrapper .wc-metabox table td input.short{width:200px}.wc-metaboxes-wrapper .wc-metabox table td input.checkbox{width:16px;min-width:inherit;vertical-align:text-bottom;display:inline-block;float:none}.wc-metaboxes-wrapper .wc-metabox table td.attribute_name{width:200px}.wc-metaboxes-wrapper .wc-metabox table .minus,.wc-metaboxes-wrapper .wc-metabox table .plus{margin-top:6px}.wc-metaboxes-wrapper .wc-metabox table .fl{float:left}.wc-metaboxes-wrapper .wc-metabox table .fr{float:right}.variations-pagenav{float:right;line-height:24px}.variations-pagenav .displaying-num{color:#777;font-size:12px;font-style:italic}.variations-pagenav a{padding:0 10px 3px;background:rgba(0,0,0,.05);font-size:16px;font-weight:400;text-decoration:none}.variations-pagenav a.disabled,.variations-pagenav a.disabled:active,.variations-pagenav a.disabled:focus,.variations-pagenav a.disabled:hover{color:#A0A5AA;background:rgba(0,0,0,.05)}.variations-defaults{float:left}.variations-defaults select{margin:.25em .25em .25em 0}.woocommerce_variable_attributes{background-color:#fdfdfd;border-top:1px solid #eee}.woocommerce_variable_attributes .data{padding:1em 2em}.woocommerce_variable_attributes .data:after,.woocommerce_variable_attributes .data:before{content:" ";display:table}.woocommerce_variable_attributes .data:after{clear:both}.woocommerce_variable_attributes .upload_image_button{display:block;width:48px;height:48px;float:left;margin-right:20px;position:relative;cursor:pointer}.woocommerce_variable_attributes .upload_image_button img{width:100%;height:auto;display:none}.woocommerce_variable_attributes .upload_image_button:before{content:"\f128";font-family:Dashicons;position:absolute;top:0;left:0;right:0;bottom:0;text-align:center;line-height:48px;font-size:48px;font-weight:400;-webkit-font-smoothing:antialiased}.woocommerce_variable_attributes .upload_image_button.remove img{display:block}.woocommerce_variable_attributes .upload_image_button.remove:before{content:"\f335";display:none}.woocommerce_variable_attributes .upload_image_button.remove:hover:before{display:block}.woocommerce_variable_attributes .options{border:1px solid #eee;border-width:1px 0;padding:.25em 0}.woocommerce_variable_attributes .options label{display:inline-block;padding:4px 1em 2px 0}.woocommerce_variable_attributes .options input[type=checkbox]{margin-top:5px;margin-right:3px}.form-row label{display:block}.form-row input[type=number],.form-row input[type=text],.form-row select{width:100%}.form-row.dimensions_field input{width:25%;float:left;margin-right:1%}.form-row.dimensions_field input:last-of-type{margin-right:0}.form-row-first,.form-row-last{width:48%;float:right}.form-row-first{clear:both;float:left}.form-row-full{clear:both}.tips{cursor:help;text-decoration:none}img.tips{padding:5px 0 0}#tiptip_holder{display:none;position:absolute;top:0;left:0;z-index:9999999}#tiptip_holder.tip_top{padding-bottom:5px}#tiptip_holder.tip_top #tiptip_arrow_inner{margin-top:-7px;margin-left:-6px;border-top-color:#333}#tiptip_holder.tip_bottom{padding-top:5px}#tiptip_holder.tip_bottom #tiptip_arrow_inner{margin-top:-5px;margin-left:-6px;border-bottom-color:#333}#tiptip_holder.tip_right{padding-left:5px}#tiptip_holder.tip_right #tiptip_arrow_inner{margin-top:-6px;margin-left:-5px;border-right-color:#333}#tiptip_holder.tip_left{padding-right:5px}#tiptip_holder.tip_left #tiptip_arrow_inner{margin-top:-6px;margin-left:-7px;border-left-color:#333}#tiptip_content,.chart-tooltip,.wc_error_tip{color:#fff;font-size:.8em;max-width:150px;background:#333;text-align:center;border-radius:3px;padding:.618em 1em;box-shadow:0 1px 3px rgba(0,0,0,.2)}#tiptip_content code,.chart-tooltip code,.wc_error_tip code{padding:1px;background:#888}#tiptip_arrow,#tiptip_arrow_inner{position:absolute;border-color:transparent;border-style:solid;border-width:6px;height:0;width:0}.wc_error_tip{max-width:20em;line-height:1.8em;position:absolute;white-space:normal;background:#d82223;margin:1.5em 1px 0 -1em;z-index:9999999}.wc_error_tip:after{content:"";display:block;border:8px solid #d82223;border-right-color:transparent;border-left-color:transparent;border-top-color:transparent;position:absolute;top:-3px;left:50%;margin:-1em 0 0 -3px}img.ui-datepicker-trigger{vertical-align:middle;margin-top:-1px;cursor:pointer}.wc-metabox-content img.ui-datepicker-trigger,.woocommerce_options_panel img.ui-datepicker-trigger{float:left;margin-right:8px;margin-top:4px;margin-left:4px}#ui-datepicker-div{display:none}.woocommerce-reports-wide.woocommerce-reports-wrap,.woocommerce-reports-wrap.woocommerce-reports-wrap{margin-left:300px;padding-top:18px}.woocommerce-reports-wide.halved,.woocommerce-reports-wrap.halved{margin:0;overflow:hidden;zoom:1}.woocommerce-reports-wide .widefat td,.woocommerce-reports-wrap .widefat td{vertical-align:top;padding:7px}.woocommerce-reports-wide .widefat td .description,.woocommerce-reports-wrap .widefat td .description{margin:4px 0 0}.woocommerce-reports-wide .postbox:after,.woocommerce-reports-wrap .postbox:after{content:".";display:block;height:0;clear:both;visibility:hidden}.woocommerce-reports-wide .postbox h3,.woocommerce-reports-wrap .postbox h3{cursor:default!important}.woocommerce-reports-wide .postbox .inside,.woocommerce-reports-wrap .postbox .inside{padding:10px;margin:0!important}.woocommerce-reports-wide .postbox div.stats_range,.woocommerce-reports-wide .postbox h3.stats_range,.woocommerce-reports-wrap .postbox div.stats_range,.woocommerce-reports-wrap .postbox h3.stats_range{border-bottom-color:#dfdfdf;margin:0;padding:0!important}.woocommerce-reports-wide .postbox div.stats_range .export_csv,.woocommerce-reports-wide .postbox h3.stats_range .export_csv,.woocommerce-reports-wrap .postbox div.stats_range .export_csv,.woocommerce-reports-wrap .postbox h3.stats_range .export_csv{float:right;line-height:26px;border-left:1px solid #dfdfdf;padding:10px;display:block;text-decoration:none}.woocommerce-reports-wide .postbox div.stats_range .export_csv:before,.woocommerce-reports-wide .postbox h3.stats_range .export_csv:before,.woocommerce-reports-wrap .postbox div.stats_range .export_csv:before,.woocommerce-reports-wrap .postbox h3.stats_range .export_csv:before{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;content:"";text-decoration:none;margin-right:4px}.woocommerce-reports-wide .postbox div.stats_range ul,.woocommerce-reports-wide .postbox h3.stats_range ul,.woocommerce-reports-wrap .postbox div.stats_range ul,.woocommerce-reports-wrap .postbox h3.stats_range ul{list-style:none;margin:0;padding:0;zoom:1;background:#f5f5f5;border-bottom:1px solid #ccc}.woocommerce-reports-wide .postbox div.stats_range ul:after,.woocommerce-reports-wide .postbox div.stats_range ul:before,.woocommerce-reports-wide .postbox h3.stats_range ul:after,.woocommerce-reports-wide .postbox h3.stats_range ul:before,.woocommerce-reports-wrap .postbox div.stats_range ul:after,.woocommerce-reports-wrap .postbox div.stats_range ul:before,.woocommerce-reports-wrap .postbox h3.stats_range ul:after,.woocommerce-reports-wrap .postbox h3.stats_range ul:before{content:" ";display:table}.woocommerce-reports-wide .postbox div.stats_range ul:after,.woocommerce-reports-wide .postbox h3.stats_range ul:after,.woocommerce-reports-wrap .postbox div.stats_range ul:after,.woocommerce-reports-wrap .postbox h3.stats_range ul:after{clear:both}.woocommerce-reports-wide .postbox div.stats_range ul li,.woocommerce-reports-wide .postbox h3.stats_range ul li,.woocommerce-reports-wrap .postbox div.stats_range ul li,.woocommerce-reports-wrap .postbox h3.stats_range ul li{float:left;margin:0;padding:0;line-height:26px;font-weight:700;font-size:14px}.woocommerce-reports-wide .postbox div.stats_range ul li a,.woocommerce-reports-wide .postbox h3.stats_range ul li a,.woocommerce-reports-wrap .postbox div.stats_range ul li a,.woocommerce-reports-wrap .postbox h3.stats_range ul li a{border-right:1px solid #dfdfdf;padding:10px;display:block;text-decoration:none}.woocommerce-reports-wide .postbox div.stats_range ul li.active,.woocommerce-reports-wide .postbox h3.stats_range ul li.active,.woocommerce-reports-wrap .postbox div.stats_range ul li.active,.woocommerce-reports-wrap .postbox h3.stats_range ul li.active{background:#fff;-webkit-box-shadow:0 4px 0 0 #fff;box-shadow:0 4px 0 0 #fff}.woocommerce-reports-wide .postbox div.stats_range ul li.active a,.woocommerce-reports-wide .postbox h3.stats_range ul li.active a,.woocommerce-reports-wrap .postbox div.stats_range ul li.active a,.woocommerce-reports-wrap .postbox h3.stats_range ul li.active a{color:#777}.woocommerce-reports-wide .postbox div.stats_range ul li.custom,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom,.woocommerce-reports-wrap .postbox div.stats_range ul li.custom,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom{padding:9px 10px;vertical-align:middle}.woocommerce-reports-wide .postbox div.stats_range ul li.custom div,.woocommerce-reports-wide .postbox div.stats_range ul li.custom form,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom div,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom form,.woocommerce-reports-wrap .postbox div.stats_range ul li.custom div,.woocommerce-reports-wrap .postbox div.stats_range ul li.custom form,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom div,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom form{display:inline;margin:0}.woocommerce-reports-wide .postbox div.stats_range ul li.custom div input.range_datepicker,.woocommerce-reports-wide .postbox div.stats_range ul li.custom form input.range_datepicker,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom div input.range_datepicker,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom form input.range_datepicker,.woocommerce-reports-wrap .postbox div.stats_range ul li.custom div input.range_datepicker,.woocommerce-reports-wrap .postbox div.stats_range ul li.custom form input.range_datepicker,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom div input.range_datepicker,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom form input.range_datepicker{padding:0;margin:0 10px 0 0;background:0 0;border:0;color:#777;text-align:center;-webkit-box-shadow:none;box-shadow:none}.woocommerce-reports-wide .postbox .chart-with-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar{padding:12px 12px 12px 249px;margin:0!important}.woocommerce-reports-wide .postbox .chart-with-sidebar .chart-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar .chart-sidebar{width:225px;margin-left:-237px;float:left}.woocommerce-reports-wide .postbox .chart-widgets,.woocommerce-reports-wrap .postbox .chart-widgets{margin:0;padding:0}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget{margin:0 0 1em;background:#fafafa;border:1px solid #dfdfdf}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget:after,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget:after{content:".";display:block;height:0;clear:both;visibility:hidden}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget h4,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget h4{background:#fff;border:1px solid #dfdfdf;border-left-width:0;border-right-width:0;padding:10px;margin:0;color:#2ea2cc;border-top-width:0;background-image:-webkit-gradient(linear,left bottom,left top,from(#ececec),to(#f9f9f9));background-image:-webkit-linear-gradient(bottom,#ececec,#f9f9f9);background-image:-moz-linear-gradient(bottom,#ececec,#f9f9f9);background-image:-o-linear-gradient(bottom,#ececec,#f9f9f9);background-image:linear-gradient(to top,#ececec,#f9f9f9)}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget table td.count,.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget table tr.active td,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget table td.count,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget table tr.active td{background:#f5f5f5}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget h4.section_title:hover,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget h4.section_title:hover{color:#a00}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .section_title,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .section_title{cursor:pointer}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .section_title span,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .section_title span{display:block}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .section_title span:after,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .section_title span:after{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin-left:.618em;content:"";text-decoration:none;float:right;font-size:.9em;line-height:1.618}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .section_title.open,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .section_title.open{color:#333}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .section_title.open span:after,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .section_title.open span:after{display:none}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .section,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .section{border-bottom:1px solid #dfdfdf}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .section .select2-container,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .section .select2-container{width:100%!important}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .section:last-of-type,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .section:last-of-type{border-radius:0 0 3px 3px}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget table,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget table{width:100%}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget table td,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget table td{padding:7px 10px;vertical-align:top;border-top:1px solid #e5e5e5;line-height:1.4em}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget table td.sparkline,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget table td.sparkline,form.report_filters div,form.report_filters input,form.report_filters label,form.report_filters p{vertical-align:middle}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget table tr:first-child td,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget table tr:first-child td{border-top:0}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget table td.name,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget table td.name{max-width:175px}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget table td.name a,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget table td.name a{word-wrap:break-word}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget table .wc_sparkline,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget table .wc_sparkline{width:32px;height:1em;display:block;float:right}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget form,.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget p,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget form,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget p{margin:0;padding:10px}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget form .submit,.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget p .submit,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget form .submit,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget p .submit{margin-top:10px}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget #product_ids,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget #product_ids{width:100%}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .select_all,.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .select_none,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .select_all,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .select_none{float:right;color:#999;margin-left:4px;margin-top:10px}.woocommerce-reports-wide .postbox .chart-legend,.woocommerce-reports-wrap .postbox .chart-legend{list-style:none;margin:0 0 1em;padding:0;border:1px solid #dfdfdf;border-right-width:0;border-bottom-width:0;background:#fff}.woocommerce-reports-wide .postbox .chart-legend li,.woocommerce-reports-wrap .postbox .chart-legend li{border-right:5px solid #aaa;color:#aaa;padding:1em;display:block;margin:0;-webkit-transition:all ease .5s;box-shadow:inset 0 -1px 0 0 #dfdfdf}.woocommerce-reports-wide .postbox .chart-legend li strong,.woocommerce-reports-wrap .postbox .chart-legend li strong{font-size:1.618em;line-height:1.2em;color:#464646;font-weight:400;display:block;font-family:HelveticaNeue-Light,"Helvetica Neue Light","Helvetica Neue",sans-serif}.woocommerce-reports-wide .postbox .chart-legend li strong del,.woocommerce-reports-wrap .postbox .chart-legend li strong del{color:#e74c3c;font-weight:400}.woocommerce-reports-wide .postbox .chart-legend li:hover,.woocommerce-reports-wrap .postbox .chart-legend li:hover{box-shadow:inset 0 -1px 0 0 #dfdfdf,inset 300px 0 0 rgba(156,93,144,.1);border-right:5px solid #9c5d90!important;padding-left:1.5em;color:#9c5d90}.woocommerce-reports-wide .postbox .pie-chart-legend,.woocommerce-reports-wrap .postbox .pie-chart-legend{margin:12px 0 0;overflow:hidden}.woocommerce-reports-wide .postbox .pie-chart-legend li,.woocommerce-reports-wrap .postbox .pie-chart-legend li{float:left;margin:0;padding:6px 0 0;border-top:4px solid #999;text-align:center;box-sizing:border-box;width:50%}.woocommerce-reports-wide .postbox .stat,.woocommerce-reports-wrap .postbox .stat{font-size:1.5em!important;font-weight:700;text-align:center}.woocommerce-reports-wide .postbox .chart-placeholder,.woocommerce-reports-wrap .postbox .chart-placeholder{width:100%;height:650px;overflow:hidden;position:relative}.woocommerce-reports-wide .postbox .chart-prompt,.woocommerce-reports-wrap .postbox .chart-prompt{line-height:650px;margin:0;color:#999;font-size:1.2em;font-style:italic;text-align:center}.woocommerce-reports-wide .postbox .chart-container,.woocommerce-reports-wrap .postbox .chart-container{background:#fff;padding:12px;position:relative;border:1px solid #dfdfdf;border-radius:3px}.woocommerce-reports-wide .postbox .main .chart-legend,.woocommerce-reports-wrap .postbox .main .chart-legend{margin-top:12px}.woocommerce-reports-wide .postbox .main .chart-legend li,.woocommerce-reports-wrap .postbox .main .chart-legend li{border-right:0;margin:0 8px 0 0;float:left;border-top:4px solid #aaa}.woocommerce-reports-wide .woocommerce-reports-main,.woocommerce-reports-wrap .woocommerce-reports-main{float:left;min-width:100%}.woocommerce-reports-wide .woocommerce-reports-main table td,.woocommerce-reports-wrap .woocommerce-reports-main table td{padding:9px}.woocommerce-reports-wide .woocommerce-reports-sidebar,.woocommerce-reports-wrap .woocommerce-reports-sidebar{display:inline;width:281px;margin-left:-300px;clear:both;float:left}.woocommerce-reports-wide .woocommerce-reports-left,.woocommerce-reports-wrap .woocommerce-reports-left{width:49.5%;float:left}.woocommerce-reports-wide .woocommerce-reports-right,.woocommerce-reports-wrap .woocommerce-reports-right{width:49.5%;float:right}.woocommerce-reports-wide .column-wc_actions a.edit,.woocommerce-reports-wide .column-wc_actions a.view,.woocommerce-reports-wrap .column-wc_actions a.edit,.woocommerce-reports-wrap .column-wc_actions a.view{display:block;text-indent:-9999px;position:relative;padding:0!important;height:2em!important;width:2em}.woocommerce-reports-wide .column-wc_actions a.edit:after,.woocommerce-reports-wide .column-wc_actions a.view:after,.woocommerce-reports-wrap .column-wc_actions a.edit:after,.woocommerce-reports-wrap .column-wc_actions a.view:after{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;line-height:1.85}.woocommerce-reports-wide .column-wc_actions a.edit:after,.woocommerce-reports-wrap .column-wc_actions a.edit:after{content:"\f464"}.woocommerce-reports-wide .column-wc_actions a.view:after,.woocommerce-reports-wrap .column-wc_actions a.view:after{content:"\f177"}.woocommerce-wide-reports-wrap{padding-bottom:11px}.woocommerce-wide-reports-wrap .widefat .export-data{float:right}.woocommerce-wide-reports-wrap .widefat td,.woocommerce-wide-reports-wrap .widefat th{vertical-align:middle;padding:7px}.chart-tooltip{position:absolute;display:none;line-height:1}table.bar_chart{width:100%}table.bar_chart thead th{text-align:left;color:#ccc;padding:6px 0}table.bar_chart tbody th{padding:6px 0;width:25%;text-align:left!important;font-weight:400!important;border-bottom:1px solid #fee}table.bar_chart tbody td{text-align:right;line-height:24px;padding:6px 6px 6px 0;border-bottom:1px solid #fee}table.bar_chart tbody td span{color:#8a4b75;display:block}table.bar_chart tbody td span.alt{color:#47a03e;margin-top:6px}table.bar_chart tbody td.bars{position:relative;text-align:left;padding:6px 6px 6px 0;border-bottom:1px solid #fee}table.bar_chart tbody td.bars a,table.bar_chart tbody td.bars span{text-decoration:none;clear:both;background:#8a4b75;float:left;display:block;line-height:24px;height:24px;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;border-radius:3px}.post-type-product .woocommerce-BlankState-message:before,.post-type-shop_coupon .woocommerce-BlankState-message:before,.post-type-shop_order .woocommerce-BlankState-message:before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center}table.bar_chart tbody td.bars span.alt{clear:both;background:#47a03e}table.bar_chart tbody td.bars span.alt span{margin:0;color:#c5dec2!important;text-shadow:0 1px 0 #47a03e;background:0 0}.post-type-shop_order .woocommerce-BlankState-message:before{content:""}.post-type-shop_coupon .woocommerce-BlankState-message:before{content:""}.post-type-product .woocommerce-BlankState-message:before{content:""}.woocommerce-BlankState{text-align:center;padding:5em 0 0}.woocommerce-BlankState .woocommerce-BlankState-message{color:#aaa;margin:0 auto 1.5em;line-height:1.5em;font-size:1.2em;max-width:500px}.woocommerce-BlankState .woocommerce-BlankState-message:before{color:#ddd;text-shadow:0 -1px 1px rgba(0,0,0,.2),0 1px 0 rgba(255,255,255,.8);font-size:8em;display:block;position:relative!important;top:auto;left:auto;line-height:1em;margin:0 0 .1875em}.woocommerce-BlankState .woocommerce-BlankState-cta{font-size:1.2em;padding:.75em 1.5em;height:auto}@media only screen and (max-width:1280px){#order_data .order_data_column{width:48%}#order_data .order_data_column:first-child{width:100%}.woocommerce_options_panel .description{display:block;clear:both;margin-left:0}.woocommerce_options_panel .dimensions_field .wrap,.woocommerce_options_panel .short,.woocommerce_options_panel input[type=text].short,.woocommerce_options_panel input[type=number].short,.woocommerce_options_panel input[type=email].short,.woocommerce_options_panel input[type=password].short{width:80%}.woocommerce_options_panel .downloadable_files,.woocommerce_variations .downloadable_files{padding:0;clear:both}.woocommerce_options_panel .downloadable_files label,.woocommerce_variations .downloadable_files label{position:static}.woocommerce_options_panel .downloadable_files table,.woocommerce_variations .downloadable_files table{margin:0 12px 24px;width:94%}.woocommerce_options_panel .downloadable_files table .sort,.woocommerce_variations .downloadable_files table .sort{visibility:hidden}.woocommerce_options_panel .woocommerce_variable_attributes .downloadable_files table,.woocommerce_variations .woocommerce_variable_attributes .downloadable_files table{margin:0 0 1em;width:100%}}@media only screen and (max-width:900px){#woocommerce-coupon-data ul.coupon_data_tabs,#woocommerce-product-data .wc-tabs-back,#woocommerce-product-data ul.product_data_tabs{width:10%}#woocommerce-coupon-data .wc-metaboxes-wrapper,#woocommerce-coupon-data .woocommerce_options_panel,#woocommerce-product-data .wc-metaboxes-wrapper,#woocommerce-product-data .woocommerce_options_panel{width:90%}#woocommerce-coupon-data ul.coupon_data_tabs li a,#woocommerce-product-data ul.product_data_tabs li a{position:relative;text-indent:-999px;padding:10px}#woocommerce-coupon-data ul.coupon_data_tabs li a:before,#woocommerce-product-data ul.product_data_tabs li a:before{position:absolute;top:0;right:0;bottom:0;left:0;text-indent:0;text-align:center;line-height:40px;width:100%;height:40px}}@media only screen and (max-width:782px){#wp-excerpt-media-buttons a{font-size:16px;line-height:37px;height:39px;padding:0 20px 0 15px}#wp-excerpt-editor-tools{padding-top:20px;padding-right:15px;overflow:hidden;margin-bottom:-1px}.post-type-product .wp-list-table .is-expanded td:not(.hidden),.post-type-shop_order .wp-list-table .is-expanded td:not(.hidden){overflow:visible}#woocommerce-product-data .checkbox{width:25px}.variations-pagenav{float:none;text-align:center;font-size:18px}.variations-pagenav .displaying-num{font-size:16px}.variations-pagenav a{padding:8px 20px 11px;font-size:18px}.variations-pagenav select{padding:0 20px}.variations-defaults{float:none;text-align:center;margin-top:10px}.post-type-product .wp-list-table .column-thumb{display:none;text-align:left;padding-bottom:0}.post-type-product .wp-list-table .column-thumb:before{display:none!important}.post-type-product .wp-list-table .column-thumb img{max-width:32px}.post-type-product .wp-list-table .toggle-row{top:-28px}.post-type-shop_order .wp-list-table .column-order_status{display:none;text-align:left;padding-bottom:0}.post-type-shop_order .wp-list-table .column-order_status mark{margin:0}.post-type-shop_order .wp-list-table .column-order_status:before{display:none!important}.post-type-shop_order .wp-list-table .column-customer_message,.post-type-shop_order .wp-list-table .column-order_notes{text-align:inherit}.post-type-shop_order .wp-list-table .column-order_notes .note-on{font-size:1.3em;margin:0}.post-type-shop_order .wp-list-table .toggle-row{top:-15px}}@media only screen and (max-width:500px){.woocommerce_options_panel label,.woocommerce_options_panel legend{float:none;width:auto;display:block;margin:0}.woocommerce_options_panel fieldset.form-field,.woocommerce_options_panel p.form-field{padding:5px 20px!important}}.wc-backbone-modal *{box-sizing:border-box}.wc-backbone-modal .wc-backbone-modal-content{position:fixed;background:#fff;z-index:100000;left:50%;top:50%;transform:translate(-50%,-50%);width:500px}.wc-backbone-modal .wc-backbone-modal-content article{overflow:auto}.wc-backbone-modal.wc-backbone-modal-shipping-method-settings .wc-backbone-modal-content{width:75%;min-width:500px}.wc-backbone-modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;min-height:360px;background:#000;opacity:.7;z-index:99900}.wc-backbone-modal-main{padding-bottom:55px}.wc-backbone-modal-main article,.wc-backbone-modal-main header{display:block;position:relative}.wc-backbone-modal-main .wc-backbone-modal-header{height:auto;background:#fcfcfc;padding:1em 1.5em;border-bottom:1px solid #ddd}.wc-backbone-modal-main .wc-backbone-modal-header h1{margin:0;font-size:18px;font-weight:700;line-height:1.5em}.wc-backbone-modal-main .wc-backbone-modal-header .modal-close-link{cursor:pointer;color:#777;height:54px;width:54px;padding:0;position:absolute;top:0;right:0;text-align:center;border:0;border-left:1px solid #ddd;background-color:transparent;-webkit-transition:color .1s ease-in-out,background .1s ease-in-out;transition:color .1s ease-in-out,background .1s ease-in-out}.wc-backbone-modal-main .wc-backbone-modal-header .modal-close-link:before{font:400 22px/50px dashicons!important;color:#666;display:block;content:'\f335';font-weight:300}.wc-backbone-modal-main .wc-backbone-modal-header .modal-close-link:focus,.wc-backbone-modal-main .wc-backbone-modal-header .modal-close-link:hover{background:#ddd;border-color:#ccc;color:#000}.wc-backbone-modal-main .wc-backbone-modal-header .modal-close-link:focus{outline:0}.wc-backbone-modal-main article{padding:1.5em}.wc-backbone-modal-main article p{margin:1.5em 0}.wc-backbone-modal-main article p:last-child,.wc-backbone-modal-main footer .inner .button{margin-bottom:0}.wc-backbone-modal-main article p:first-child{margin-top:0}.wc-backbone-modal-main article .pagination{padding:10px 0 0;text-align:center}.wc-backbone-modal-main footer{position:absolute;left:0;right:0;bottom:0;z-index:100;padding:1em 1.5em;background:#fcfcfc;border-top:1px solid #dfdfdf;box-shadow:0 -4px 4px -4px rgba(0,0,0,.1)}.wc-backbone-modal-main footer .inner{float:right;line-height:23px}.select2-drop{z-index:999999!important}.select2-container-multi .select2-choices .select2-search-field input{font-family:inherit;font-size:inherit;font-weight:inherit;padding:3px 5px}.select2-container{line-height:1.85em;font-size:14px} \ No newline at end of file +@charset "UTF-8";.select2-container .select2-choice,.select2-results .select2-result-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-touch-callout:none}.button.wc-reload:after,.woocommerce-help-tip:after{font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased}@-webkit-keyframes spin{100%{-webkit-transform:rotate(360deg)}}@-moz-keyframes spin{100%{-moz-transform:rotate(360deg)}}@keyframes spin{100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-ms-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}.select2-container{margin:0;position:relative;display:block!important;zoom:1;vertical-align:middle}.select2-container,.select2-drop,.select2-search,.select2-search input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.select2-container .select2-choice{display:block;padding:0 0 0 8px;overflow:hidden;position:relative;border:1px solid #ccc;white-space:nowrap;color:#444;text-decoration:none;border-radius:3px;background-clip:padding-box;user-select:none;background-color:#fff;font-weight:400}html[dir=rtl] .select2-container .select2-choice{padding:0 8px 0 0}.select2-container.select2-drop-above .select2-choice{border-bottom-color:#ccc;border-radius:0 0 4px 4px}.select2-container.select2-allowclear .select2-choice .select2-chosen{margin-right:42px}.select2-container .select2-choice>.select2-chosen{margin-right:26px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;float:none;width:auto}html[dir=rtl] .select2-container .select2-choice>.select2-chosen{margin-left:26px;margin-right:0}.select2-container .select2-choice abbr{display:none;width:12px;height:12px;position:absolute;right:24px;top:5px;font-size:1px;text-decoration:none;border:0;background:url(../images/select2.png) right top no-repeat;cursor:pointer;outline:0}.select2-container.select2-allowclear .select2-choice abbr{display:inline-block}.select2-container .select2-choice abbr:hover{background-position:right -11px;cursor:pointer}.select2-drop-mask{border:0;margin:0;padding:0;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:9998;background-color:#fff;filter:alpha(opacity=0)}.select2-drop{width:100%;margin-top:-1px;position:absolute;top:100%;background:#fff;color:#000;border:1px solid #ccc;border-top:0;border-radius:0 0 3px 3px}.select2-drop.select2-drop-above{margin-top:1px;border-top:1px solid #ccc;border-bottom:0;border-radius:3px 3px 0 0}.select2-drop-active{border:1px solid #666;border-top:none}.select2-drop.select2-drop-above.select2-drop-active{border-top:1px solid #666}.select2-drop-auto-width{border-top:1px solid #ccc;width:auto}.select2-drop-auto-width .select2-search{padding-top:4px}.select2-container .select2-choice .select2-arrow{display:inline-block;width:18px;height:100%;position:absolute;right:0;top:0;border-radius:0 3px 3px 0;background-clip:padding-box}html[dir=rtl] .select2-container .select2-choice .select2-arrow{left:0;right:auto;border-radius:3px 0 0 3px}.select2-container .select2-choice .select2-arrow b{display:block;width:100%;height:100%;position:relative}.select2-container .select2-choice .select2-arrow b:after{position:absolute;display:block;content:"";top:50%;left:50%;border:4px solid transparent;border-top-color:#666;margin-left:-7px;margin-top:-2px}.select2-search{display:inline-block;width:100%;margin:0;padding-left:4px;padding-right:4px;position:relative;z-index:10000;white-space:nowrap;padding-bottom:4px}.select2-search input{width:100%;height:auto!important;padding:4px 20px 4px 5px!important;margin:0;outline:0;font-family:sans-serif;font-size:1em;border:1px solid #ccc;-webkit-box-shadow:none;box-shadow:none;background:url(../images/select2.png) 100% -22px no-repeat #fff}html[dir=rtl] .select2-search input{padding:4px 5px 4px 20px;background:url(../images/select2.png) -37px -22px no-repeat #fff}.select2-drop.select2-drop-above .select2-search input{margin-top:4px}.select2-search input.select2-active{background:url(../images/select2-spinner.gif) 100% no-repeat #fff}.select2-container-active .select2-choice,.select2-container-active .select2-choices{border:1px solid #666;outline:0}.select2-dropdown-open .select2-choice{border-bottom-color:transparent;-webkit-box-shadow:0 1px 0 #fff inset;box-shadow:0 1px 0 #fff inset;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-dropdown-open .select2-choice .select2-arrow b:after{border-top-color:transparent;border-bottom-color:#666;margin-top:-6px}.select2-dropdown-open.select2-drop-above .select2-choice,.select2-dropdown-open.select2-drop-above .select2-choices{border:1px solid #666;border-top-color:transparent}.select2-dropdown-open .select2-choice .select2-arrow{background:0 0;border-left:none;filter:none}html[dir=rtl] .select2-dropdown-open .select2-choice .select2-arrow{border-right:none}.select2-dropdown-open .select2-choice .select2-arrow b{background-position:-18px 1px}html[dir=rtl] .select2-dropdown-open .select2-choice .select2-arrow b{background-position:-16px 1px}.select2-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.select2-results{max-height:200px;padding:4px;margin:0;position:relative;overflow-x:hidden;overflow-y:auto;-webkit-tap-highlight-color:transparent;background:#fafafa}html[dir=rtl] .select2-results{padding:0 4px 0 0;margin:4px 0 4px 4px}.select2-results ul.select2-result-sub{margin:0;padding-left:0}.select2-results li{list-style:none;display:list-item;background-image:none;margin:3px 0}.select2-results li.select2-result-with-children>.select2-result-label{font-weight:700}.select2-results .select2-result-label{padding:5px 7px;margin:0;cursor:pointer;min-height:1em;user-select:none}.select2-results-dept-1 .select2-result-label{padding-left:20px}.select2-results-dept-2 .select2-result-label{padding-left:40px}.select2-results-dept-3 .select2-result-label{padding-left:60px}.select2-results-dept-4 .select2-result-label{padding-left:80px}.select2-results-dept-5 .select2-result-label{padding-left:100px}.select2-results-dept-6 .select2-result-label{padding-left:110px}.select2-results-dept-7 .select2-result-label{padding-left:120px}.select2-results .select2-highlighted{background:#f1f1f1;color:#000;border-radius:3px}.select2-results li em{background:#feffde;font-style:normal}.select2-results .select2-highlighted em{background:0 0}.select2-results .select2-highlighted ul{background:#fff;color:#000}.select2-results .select2-ajax-error,.select2-results .select2-no-results,.select2-results .select2-searching,.select2-results .select2-selection-limit{background:#f4f4f4;display:list-item;padding-left:5px}.select2-results .select2-disabled.select2-highlighted{color:#666;background:#f4f4f4;display:list-item;cursor:default}.select2-results .select2-disabled{background:#f4f4f4;display:list-item;cursor:default}.select2-results .select2-selected{display:none}.select2-more-results.select2-active{background:url(../images/select2-spinner.gif) 100% no-repeat #f4f4f4}.select2-results .select2-ajax-error{background:rgba(255,50,50,.2)}.select2-more-results{background:#f4f4f4;display:list-item}.select2-container.select2-container-disabled .select2-choice{background-color:#f4f4f4;background-image:none;border:1px solid #ddd;cursor:default}.select2-container.select2-container-disabled .select2-choice .select2-arrow{background-color:#f4f4f4;background-image:none;border-left:0}.select2-container.select2-container-disabled .select2-choice abbr{display:none}.select2-container-multi .select2-choices{height:auto!important;height:1%;margin:0;padding:0 5px 0 0;position:relative;border:1px solid #ccc;cursor:text;overflow:hidden;background-color:#fff;min-height:26px}html[dir=rtl] .select2-container-multi .select2-choices{padding:0 0 0 5px}.select2-locked{padding:3px 5px!important}.select2-container-multi.select2-container-active .select2-choices{border:1px solid #666;outline:0}.select2-container-multi .select2-choices li{float:left;list-style:none}html[dir=rtl] .select2-container-multi .select2-choices li{float:right}.select2-container-multi .select2-choices .select2-search-field{margin:0;padding:0;white-space:nowrap}.select2-container-multi .select2-choices .select2-search-field:first-child{width:100%}.select2-container-multi .select2-choices .select2-search-field input{margin:1px 0;outline:0;border:0;-webkit-box-shadow:none;box-shadow:none;background:0 0!important}.select2-container-multi .select2-choices .select2-search-field input.select2-active{background:url(../images/select2-spinner.gif) 100% no-repeat #fff!important}.select2-default{color:#999!important}.select2-container-multi .select2-choices .select2-search-choice{padding:5px 8px 5px 24px;margin:3px 0 3px 5px;position:relative;line-height:15px;color:#333;cursor:default;border-radius:2px;background-clip:padding-box;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#e4e4e4}.select2-container-multi .ui-sortable .select2-search-choice{cursor:move}html[dir=rtl] .select2-container-multi .select2-choices .select2-search-choice{margin:3px 5px 3px 0;padding:5px 24px 5px 8px}.select2-container-multi .select2-choices .select2-search-choice .select2-chosen{cursor:default}.select2-container-multi .select2-choices .select2-search-choice-focus{background:#d4d4d4}.select2-search-choice-close{display:block;width:12px;height:13px;position:absolute;right:7px;top:6px;font-size:1px;outline:0;background:url(../images/select2.png) right top no-repeat}html[dir=rtl] .select2-search-choice-close{right:auto;left:7px}.select2-container-multi .select2-search-choice-close{left:7px}html[dir=rtl] .select2-container-multi .select2-search-choice-close{left:auto;right:7px}.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover,.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close{background-position:right -11px}.select2-container-multi.select2-container-disabled .select2-choices{background-color:#f4f4f4;background-image:none;border:1px solid #ddd;cursor:default}.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice{padding:3px 5px;border:1px solid #ddd;background-image:none;background-color:#f4f4f4}.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close{display:none;background:0 0}.select2-result-selectable .select2-match,.select2-result-unselectable .select2-match{text-decoration:underline}.select2-offscreen,.select2-offscreen:focus{clip:rect(0 0 0 0)!important;width:1px!important;height:1px!important;border:0!important;margin:0!important;padding:0!important;overflow:hidden!important;position:absolute!important;outline:0!important;left:0!important;top:0!important}.select2-display-none{display:none}.select2-measure-scrollbar{position:absolute;top:-10000px;left:-10000px;width:100px;height:100px;overflow:scroll}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-resolution:2dppx){.select2-search input{background-image:url(../images/select2x2.png)!important;background-repeat:no-repeat!important;background-size:60px 40px!important;background-position:100% -21px!important}}@font-face{font-family:star;src:url(../fonts/star.eot);src:url(../fonts/star.eot?#iefix) format("embedded-opentype"),url(../fonts/star.woff) format("woff"),url(../fonts/star.ttf) format("truetype"),url(../fonts/star.svg#star) format("svg");font-weight:400;font-style:normal}@font-face{font-family:WooCommerce;src:url(../fonts/WooCommerce.eot);src:url(../fonts/WooCommerce.eot?#iefix) format("embedded-opentype"),url(../fonts/WooCommerce.woff) format("woff"),url(../fonts/WooCommerce.ttf) format("truetype"),url(../fonts/WooCommerce.svg#WooCommerce) format("svg");font-weight:400;font-style:normal}.blockUI.blockOverlay:before{height:1em;width:1em;position:absolute;top:50%;left:50%;margin-left:-.5em;margin-top:-.5em;display:block;content:"";-webkit-animation:spin 1s ease-in-out infinite;-moz-animation:spin 1s ease-in-out infinite;animation:spin 1s ease-in-out infinite;background:url(../images/icons/loader.svg) center center;background-size:cover;line-height:1;text-align:center;font-size:2em;color:rgba(0,0,0,.75)}.wc_addons_wrap .products{overflow:hidden}.wc_addons_wrap .products li{float:left;margin:0 1em 1em 0!important;padding:0;vertical-align:top;width:300px}.wc_addons_wrap .products li a{text-decoration:none;color:inherit;border:1px solid #ddd;display:block;min-height:220px;overflow:hidden;background:#f5f5f5;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),inset 0 -1px 0 rgba(0,0,0,.1)}.wc_addons_wrap .products li a img{max-width:258px;max-height:24px;padding:17px 20px;display:block;margin:0;background:#fff;border-right:260px solid #fff}.wc_addons_wrap .products li a .price,.wc_addons_wrap .products li a img.extension-thumb+h3{display:none}.wc_addons_wrap .products li a h2,.wc_addons_wrap .products li a h3{margin:0!important;padding:20px!important;background:#fff}.wc_addons_wrap .products li a p{padding:20px!important;margin:0!important;border-top:1px solid #f1f1f1}.wc_addons_wrap .products li a:focus,.wc_addons_wrap .products li a:hover{background-color:#fff}.wc_addons_wrap .storefront{background:url(../images/storefront-bg.jpg) bottom right #f6f6f6;border:1px solid #ddd;padding:20px;overflow:hidden;zoom:1}.wc_addons_wrap .storefront img{width:278px;height:auto;float:left;margin:0 20px 0 0;box-shadow:0 1px 6px rgba(0,0,0,.1)}.wc_addons_wrap .storefront p{max-width:750px}.woocommerce-BlankState a.button-primary,.woocommerce-BlankState button.button-primary,.woocommerce-message a.button-primary,.woocommerce-message button.button-primary{background:#bb77ae;border-color:#A36597;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #A36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #A36597;color:#fff;text-shadow:0 -1px 1px #A36597,1px 0 1px #A36597,0 1px 1px #A36597,-1px 0 1px #A36597}.woocommerce-BlankState a.button-primary:active,.woocommerce-BlankState a.button-primary:focus,.woocommerce-BlankState a.button-primary:hover,.woocommerce-BlankState button.button-primary:active,.woocommerce-BlankState button.button-primary:focus,.woocommerce-BlankState button.button-primary:hover,.woocommerce-message a.button-primary:active,.woocommerce-message a.button-primary:focus,.woocommerce-message a.button-primary:hover,.woocommerce-message button.button-primary:active,.woocommerce-message button.button-primary:focus,.woocommerce-message button.button-primary:hover{background:#A36597;border-color:#A36597;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #A36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #A36597}.woocommerce-message{position:relative;border-left-color:#cc99c2!important;overflow:hidden}.woocommerce-message a.docs,.woocommerce-message a.skip{text-decoration:none!important}.woocommerce-message a.woocommerce-message-close{position:absolute;top:10px;right:10px;padding:10px 15px 10px 21px;font-size:13px;line-height:1.23076923;text-decoration:none}.woocommerce-message a.woocommerce-message-close:before{position:absolute;top:8px;left:0;-webkit-transition:all .1s ease-in-out;transition:all .1s ease-in-out}.woocommerce-message .twitter-share-button{margin-top:-3px;margin-left:3px;vertical-align:middle}#variable_product_options #message,#variable_product_options .notice{margin:10px}.clear{clear:both}#woocommerce-fields-bulk.inline-edit-col label,#woocommerce-fields.inline-edit-col{clear:left}.wrap.woocommerce div.error,.wrap.woocommerce div.updated{margin-top:10px}mark.amount{background:0 0;color:inherit}.postbox,.woocommerce{input:invalid;input-border:1px solid #cc010b;input-background:#ffebe8}.simplify-commerce-banner{overflow:hidden}.simplify-commerce-banner img{float:right;padding:15px 0;margin-left:1em;width:200px}.woocommerce-help-tip{color:#666;display:inline-block;font-size:1.1em;font-style:normal;height:16px;line-height:16px;position:relative;vertical-align:middle;width:16px}.woocommerce-help-tip:after{font-family:Dashicons;speak:none;font-weight:400;line-height:1;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";cursor:help}h2 .woocommerce-help-tip{margin-top:-5px;margin-left:.25em}table.wc_status_table{margin-bottom:1em}table.wc_status_table h2{font-size:14px;margin:0}table.wc_status_table tr:nth-child(2n) td,table.wc_status_table tr:nth-child(2n) th{background:#fcfcfc}table.wc_status_table th{font-weight:700;padding:9px}table.wc_status_table td:first-child{width:33%}table.wc_status_table td.help{width:1em}table.wc_status_table td{padding:9px;font-size:1.1em}table.wc_status_table td mark{background:0 0}table.wc_status_table td mark.yes{color:#7ad03a}table.wc_status_table td mark.no{color:#999}table.wc_status_table td mark.error{color:#a00}table.wc_status_table td ul{margin:0}table.wc_status_table .help_tip{cursor:help}#debug-report{display:none;margin:10px 0;padding:0;position:relative}#debug-report textarea{font-family:monospace;width:100%;margin:0;height:300px;padding:20px;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;resize:none;font-size:12px;line-height:20px;outline:0}#log-viewer-select{padding:10px 0 8px;line-height:28px}#log-viewer-select h2 a{vertical-align:middle}#log-viewer textarea{width:100%;resize:vertical}.inline-edit-product.quick-edit-row .inline-edit-col-center,.inline-edit-product.quick-edit-row .inline-edit-col-right{float:right!important}#woocommerce-fields.inline-edit-col label.featured,#woocommerce-fields.inline-edit-col label.manage_stock{margin-left:10px}#woocommerce-fields.inline-edit-col .dimensions div{display:block;margin:.2em 0}#woocommerce-fields.inline-edit-col .dimensions div span.title{display:block;float:left;width:5em}#woocommerce-fields.inline-edit-col .dimensions div span.input-text-wrap{display:block;margin-left:5em}#woocommerce-fields.inline-edit-col .text{box-sizing:border-box;width:99%;float:left;margin:1px 1% 1px 1px}#woocommerce-fields.inline-edit-col .height,#woocommerce-fields.inline-edit-col .length,#woocommerce-fields.inline-edit-col .width{width:32.33%}#woocommerce-fields.inline-edit-col .height{margin-right:0}#woocommerce-fields-bulk.inline-edit-col .inline-edit-group label{clear:none;width:49%;margin:.2em 0}#woocommerce-fields-bulk.inline-edit-col .inline-edit-group.dimensions label{width:75%;max-width:75%}#woocommerce-fields-bulk.inline-edit-col .length,#woocommerce-fields-bulk.inline-edit-col .regular_price,#woocommerce-fields-bulk.inline-edit-col .sale_price,#woocommerce-fields-bulk.inline-edit-col .stock,#woocommerce-fields-bulk.inline-edit-col .weight{box-sizing:border-box;width:100%;margin-left:4.4em}#woocommerce-fields-bulk.inline-edit-col .height,#woocommerce-fields-bulk.inline-edit-col .length,#woocommerce-fields-bulk.inline-edit-col .width{box-sizing:border-box;width:25%}.column-coupon_code{line-height:2.25em}.column-coupon_code,ul.wc_coupon_list{margin:0;overflow:hidden;zoom:1;clear:both}ul.wc_coupon_list li{margin:0}ul.wc_coupon_list li.code{display:inline-block}ul.wc_coupon_list li.code:after{content:", "}ul.wc_coupon_list li.code:last-of-type:after{display:none}ul.wc_coupon_list li.code .tips{cursor:pointer}ul.wc_coupon_list_block{margin:0;padding-bottom:2px}ul.wc_coupon_list_block li{border-top:1px solid #fff;border-bottom:1px solid #ccc;line-height:2.5em;margin:0;padding:.5em 0}ul.wc_coupon_list_block li:first-child{border-top:0;padding-top:0}ul.wc_coupon_list_block li:last-child{border-bottom:0;padding-bottom:0}.button.wc-reload{text-indent:-9999px;position:relative;padding:0;height:28px;width:28px!important;display:inline-block}.button.wc-reload:after{font-family:Dashicons;speak:none;font-weight:400;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";line-height:28px}#order_data h2,#order_data p.order_number{font-family:HelveticaNeue-Light,"Helvetica Neue Light","Helvetica Neue",sans-serif;font-weight:400}.tablenav .actions{overflow:visible}.tablenav .select2-container{float:left;max-width:200px;font-size:14px;vertical-align:middle;margin:1px 6px 1px 1px}#woocommerce-order-data .handlediv,#woocommerce-order-data .hndle{display:none}#woocommerce-order-data .inside{display:block!important}#order_data{padding:23px 24px 12px}#order_data h2{margin:0;font-size:21px;line-height:1.2;text-shadow:1px 1px 1px #fff;padding:0}#order_data h3{font-size:14px}#order_data h3,#order_data h4{color:#333;margin:1.33em 0 0}#order_data p{color:#777}#order_data p.order_number{margin:0;line-height:1.6em;font-size:16px}#order_data .order_data_column_container{clear:both}#order_data .order_data_column{width:32%;padding:0 2% 0 0;float:left}#order_data .order_data_column:last-child{padding-right:0}#order_data .order_data_column p{padding:0!important}#order_data .order_data_column .address strong{display:block}#order_data .order_data_column .form-field{float:left;width:48%;padding:0;margin:9px 0 0}#order_data .order_data_column .form-field label{display:block;padding:0 0 3px}#order_data .order_data_column .form-field input,#order_data .order_data_column .form-field select,#order_data .order_data_column .form-field textarea{width:100%}#order_data .order_data_column .form-field .select2-container{width:100%!important}#order_data .order_data_column .form-field .date-picker{width:50%}#order_data .order_data_column .form-field .hour,#order_data .order_data_column .form-field .minute{width:3.5em}#order_data .order_data_column .form-field small{display:block;margin:5px 0 0;color:#999}#order_data .order_data_column .form-field.last{float:right}#order_data .order_data_column .form-field-wide{width:100%;clear:both}#order_data .order_data_column .form-field-wide .wc-customer-search,#order_data .order_data_column .form-field-wide .wc-enhanced-select,#order_data .order_data_column .form-field-wide input,#order_data .order_data_column .form-field-wide select,#order_data .order_data_column .form-field-wide textarea{width:100%}#order_data .order_data_column p.none_set{color:#999}#order_data .order_data_column ._billing_address_1_field,#order_data .order_data_column ._billing_city_field,#order_data .order_data_column ._billing_country_field,#order_data .order_data_column ._billing_email_field,#order_data .order_data_column ._billing_first_name_field,#order_data .order_data_column ._shipping_address_1_field,#order_data .order_data_column ._shipping_city_field,#order_data .order_data_column ._shipping_country_field,#order_data .order_data_column ._shipping_first_name_field{float:left}#order_data .order_data_column ._billing_address_2_field,#order_data .order_data_column ._billing_last_name_field,#order_data .order_data_column ._billing_phone_field,#order_data .order_data_column ._billing_postcode_field,#order_data .order_data_column ._billing_state_field,#order_data .order_data_column ._shipping_address_2_field,#order_data .order_data_column ._shipping_last_name_field,#order_data .order_data_column ._shipping_postcode_field,#order_data .order_data_column ._shipping_state_field,#order_data .order_data_column .wc-customer-user label a,#order_data .order_data_column .wc-order-status label a{float:right}#order_data .order_data_column ._billing_company_field,#order_data .order_data_column ._shipping_company_field,#order_data .order_data_column ._transaction_id_field{clear:both;width:100%}#order_data .order_data_column ._billing_email_field{clear:left}#order_data .order_data_column div.edit_address{display:none;zoom:1;padding-right:1px}#order_data .order_data_column .billing-same-as-shipping,#order_data .order_data_column .load_customer_billing,#order_data .order_data_column .load_customer_shipping,#order_data .order_data_column a.edit_address{width:14px;height:0;padding:14px 0 0;margin:0 0 0 6px;overflow:hidden;position:relative;color:#999;border:0;float:right}#order_data .order_data_column .billing-same-as-shipping:focus,#order_data .order_data_column .billing-same-as-shipping:hover,#order_data .order_data_column .load_customer_billing:focus,#order_data .order_data_column .load_customer_billing:hover,#order_data .order_data_column .load_customer_shipping:focus,#order_data .order_data_column .load_customer_shipping:hover,#order_data .order_data_column a.edit_address:focus,#order_data .order_data_column a.edit_address:hover{color:#000}#order_data .order_data_column .billing-same-as-shipping:after,#order_data .order_data_column .load_customer_billing:after,#order_data .order_data_column .load_customer_shipping:after,#order_data .order_data_column a.edit_address:after{font-family:WooCommerce;position:absolute;top:0;left:0;text-align:center;vertical-align:top;line-height:14px;font-size:14px;font-weight:400;-webkit-font-smoothing:antialiased}#order_data .order_data_column .billing-same-as-shipping:after{content:"\e008"}#order_data .order_data_column .load_customer_billing:after,#order_data .order_data_column .load_customer_shipping:after{content:"\e03a"}#order_data .order_data_column a.edit_address:after{font-family:Dashicons;content:"\f464"}.order_actions{margin:0;overflow:hidden;zoom:1}.order_actions li{border-top:1px solid #fff;border-bottom:1px solid #ddd;padding:6px 0;margin:0;line-height:1.6em;float:left;width:50%;text-align:center}.order_actions li a{float:none;text-align:center;text-decoration:underline}.order_actions li.wide{width:auto;float:none;clear:both;padding:6px;text-align:left;overflow:hidden}.order_actions li #delete-action{line-height:25px;vertical-align:middle;text-align:left;float:left}.order_actions li .save_order{float:right}.order_actions li#actions{overflow:hidden}.order_actions li#actions .button{width:24px;box-sizing:border-box;float:right}.order_actions li#actions select{width:225px;box-sizing:border-box;float:left}#woocommerce-order-items .inside{margin:0;padding:0;background:#fefefe}#woocommerce-order-items .wc-order-data-row{border-bottom:1px solid #DFDFDF;padding:1.5em 2em;background:#f8f8f8;line-height:2em;text-align:right}#woocommerce-order-items .wc-order-data-row:after,#woocommerce-order-items .wc-order-data-row:before{content:" ";display:table}#woocommerce-order-items .wc-order-data-row:after{clear:both}#woocommerce-order-items .wc-order-data-row p{margin:0;line-height:2em}#woocommerce-order-items .wc-order-data-row .wc-used-coupons{text-align:left}#woocommerce-order-items .wc-order-data-row .wc-used-coupons .tips{display:inline-block}#woocommerce-order-items .wc-order-add-item{background:#fff;vertical-align:top;border-top:none}#woocommerce-order-items .wc-order-add-item .add_item_id,#woocommerce-order-items .wc-order-add-item .select2-container{vertical-align:top}#woocommerce-order-items .wc-order-add-item .add_item_id .search-field input,#woocommerce-order-items .wc-order-add-item .select2-container .search-field input{min-width:100px}#woocommerce-order-items .wc-order-add-item .select2-container{width:400px!important;text-align:left}#woocommerce-order-items .wc-order-add-item .calculate-action,#woocommerce-order-items .wc-order-add-item .cancel-action,#woocommerce-order-items .wc-order-add-item .save-action{float:left;margin-right:2px}#woocommerce-order-items .wc-used-coupons{float:left;width:50%}#woocommerce-order-items .wc-order-totals{float:right;width:50%;margin:0;padding:0;text-align:right}#woocommerce-order-items .wc-order-totals .amount{font-weight:700}#woocommerce-order-items .wc-order-totals .label{vertical-align:top}#woocommerce-order-items .wc-order-totals .total{font-size:1em!important;width:10em;margin:0 0 0 .5em;box-sizing:border-box}#woocommerce-order-items .wc-order-totals .total input[type=text]{width:96%;float:right}#woocommerce-order-items .wc-order-totals .refunded-total{color:#a00}#woocommerce-order-items .refund-actions{margin-top:5px;padding-top:12px;border-top:1px solid #DFDFDF}#woocommerce-order-items .refund-actions .button{float:right;margin-left:4px}#woocommerce-order-items .refund-actions .cancel-action,#woocommerce-order-items .wc-order-item-bulk-edit .cancel-action{float:left;margin-left:0}#woocommerce-order-items .add_meta{margin-left:0!important}#woocommerce-order-items h3 small{color:#999}#woocommerce-order-items .amount{white-space:nowrap}#woocommerce-order-items .add-items .description{margin-right:10px}#woocommerce-order-items .add-items .button{float:left;margin-right:.25em}#woocommerce-order-items .add-items .button-primary{float:none;margin-right:0}#woocommerce-order-items .inside{display:block!important}#woocommerce-order-items .handlediv,#woocommerce-order-items .hndle{display:none}#woocommerce-order-items .woocommerce_order_items_wrapper{margin:0}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items{width:100%;background:#fff}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items thead th{text-align:left;padding:1em;font-weight:400;color:#999;background:#f8f8f8;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items thead th.sortable{cursor:pointer}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items thead th:last-child{padding-right:2em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items thead th:first-child{padding-left:2em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items thead th .wc-arrow{float:right;position:relative;margin-right:-1em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody th,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td{padding:1.5em 1em 1em;text-align:left;line-height:1.5em;vertical-align:top;border-bottom:1px solid #f8f8f8}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody th textarea,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td textarea{width:100%}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody th select,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td select{width:50%}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody th input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody th textarea,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td textarea{font-size:14px;padding:4px;color:#555}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody th:last-child,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td:last-child{padding-right:2em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody th:first-child,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td:first-child{padding-left:2em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody tr td{cursor:pointer}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody tr.selected{background:#F5EBF3}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody tr.selected td{border-color:#E6CCE1;opacity:.8}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody tr:last-child td{border-bottom:1px solid #dfdfdf}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody tr:first-child td{border-top:8px solid #f8f8f8}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody#order_line_items tr:first-child td{border-top:none}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.thumb{text-align:left;width:38px;padding-bottom:1.5em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.thumb .wc-order-item-thumbnail{width:38px;height:38px;border:2px solid #e8e8e8;background:#f8f8f8;color:#ccc;position:relative;font-size:21px;display:block;text-align:center}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.thumb .wc-order-item-thumbnail:before{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;height:100%;text-align:center;content:"";width:38px;line-height:38px;display:block}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.thumb .wc-order-item-thumbnail img{width:100%;height:100%;margin:0;padding:0;position:relative}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.name .wc-order-item-sku,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.name .wc-order-item-variation{display:block;margin-top:.5em;font-size:.92em!important;color:#888}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item{min-width:200px}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .center,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .variation-id{text-align:center}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class{text-align:right}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class label{white-space:nowrap;color:#999;font-size:.833em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost label input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost label input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost label input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax label input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity label input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax label input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class label input{display:inline}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class input{width:70px;vertical-align:middle;text-align:right}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost select,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost select,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost select,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax select,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity select,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax select,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class select{width:85px;height:26px;vertical-align:middle;font-size:1em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .split-input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .split-input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .split-input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .split-input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .split-input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .split-input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .split-input{display:inline-block;background:#fff;border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);margin:1px 0;min-width:80px;overflow:hidden;line-height:1em;text-align:right}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .split-input div.input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .split-input div.input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .split-input div.input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .split-input div.input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .split-input div.input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .split-input div.input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .split-input div.input{width:100%;box-sizing:border-box}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .split-input div.input label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .split-input div.input label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .split-input div.input label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .split-input div.input label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .split-input div.input label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .split-input div.input label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .split-input div.input label{font-size:.75em;padding:4px 6px 0;color:#555;display:block}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .split-input div.input input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .split-input div.input input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .split-input div.input input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .split-input div.input input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .split-input div.input input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .split-input div.input input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .split-input div.input input{width:100%;box-sizing:border-box;border:0;box-shadow:none;margin:0;padding:0 6px 4px;color:#555;background:0 0}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .split-input div.input input::-webkit-input-placeholder,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .split-input div.input input::-webkit-input-placeholder,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .split-input div.input input::-webkit-input-placeholder,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .split-input div.input input::-webkit-input-placeholder,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .split-input div.input input::-webkit-input-placeholder,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .split-input div.input input::-webkit-input-placeholder,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .split-input div.input input::-webkit-input-placeholder{color:#ddd}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .split-input div.input:first-child,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .split-input div.input:first-child,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .split-input div.input:first-child,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .split-input div.input:first-child,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .split-input div.input:first-child,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .split-input div.input:first-child,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .split-input div.input:first-child{border-bottom:1px dashed #ddd;background:#fff}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .split-input div.input:first-child input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .split-input div.input:first-child label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .split-input div.input:first-child input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .split-input div.input:first-child label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .split-input div.input:first-child input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .split-input div.input:first-child label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .split-input div.input:first-child input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .split-input div.input:first-child label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .split-input div.input:first-child input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .split-input div.input:first-child label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .split-input div.input:first-child input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .split-input div.input:first-child label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .split-input div.input:first-child input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .split-input div.input:first-child label{color:#ccc}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .view,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .view,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .view,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .view,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .view,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .view,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .view{white-space:nowrap}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .edit,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .edit,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .edit,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .edit,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .edit,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .edit,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .edit{text-align:left}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost del,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost del,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost del,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax del,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity del,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax del,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class del,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class small.times{font-size:.92em!important;color:#888}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .wc-order-item-taxes,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .wc-order-item-refund-fields,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .wc-order-item-taxes{margin:0}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .wc-order-item-refund-fields label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .wc-order-item-taxes label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .wc-order-item-refund-fields label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .wc-order-item-taxes label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .wc-order-item-refund-fields label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .wc-order-item-taxes label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .wc-order-item-refund-fields label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .wc-order-item-taxes label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .wc-order-item-refund-fields label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .wc-order-item-taxes label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .wc-order-item-refund-fields label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .wc-order-item-taxes label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .wc-order-item-refund-fields label,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .wc-order-item-taxes label{display:block}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax .wc-order-item-discount,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class .wc-order-item-discount{display:block;margin-top:.5em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .cost small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .item_cost small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_cost small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .line_tax small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax small.times,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .tax_class small.times{margin-right:.25em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity{text-align:center}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity input{text-align:center;width:50px}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items span.subtotal{opacity:.5}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.tax_class,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items th.tax_class{text-align:left}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .calculated{border-color:#ae8ca2;border-style:dotted}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.meta{width:100%}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.display_meta,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.meta{margin:.5em 0 0;font-size:.92em!important;color:#888}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.fee .thumb div:before,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.refund .thumb div:before,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.shipping .thumb div:before{color:#ccc;top:0;left:0;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;text-align:center;font-family:WooCommerce}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.display_meta tr th,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.meta tr th{border:0;padding:0 4px .5em 0;line-height:1.5em;width:20%}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.display_meta tr td,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.meta tr td{padding:0 4px .5em 0;border:0;line-height:1.5em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.display_meta tr td input,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.meta tr td input{width:100%;margin:0;position:relative;border-bottom:0;box-shadow:none}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .refund_by,ul.order_notes li p.meta .exact-date{border-bottom:1px dotted #999}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.display_meta tr td textarea,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.meta tr td textarea{width:100%;height:4em;margin:0;box-shadow:none}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.display_meta tr td input:focus+textarea,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.meta tr td input:focus+textarea{border-top-color:#999}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.display_meta tr td p,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.meta tr td p{margin:0 0 .5em;line-height:1.5em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.display_meta tr td p:last-child,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items table.meta tr td p:last-child{margin:0}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.fee .thumb div{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;font-size:1.5em;line-height:1em;vertical-align:middle;margin:0}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.fee .thumb div:before{line-height:1;margin:0;text-indent:0;position:absolute;width:100%;height:100%;content:""}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.refund .thumb div{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;font-size:1.5em;line-height:1em;vertical-align:middle;margin:0}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.refund .thumb div:before{line-height:1;margin:0;text-indent:0;position:absolute;width:100%;height:100%;content:""}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.shipping .thumb div{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;font-size:1.5em;line-height:1em;vertical-align:middle;margin:0}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.shipping .thumb div:before{line-height:1;margin:0;text-indent:0;position:absolute;width:100%;height:100%;content:""}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.shipping .shipping_method,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tr.shipping .shipping_method_name{width:100%;margin:0 0 .5em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items th.line_tax{white-space:nowrap}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.line_tax .delete-order-tax,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items th.line_tax .delete-order-tax{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;float:right;font-size:14px;visibility:hidden;margin:3px -18px 0 0}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.line_tax .delete-order-tax:before,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items th.line_tax .delete-order-tax:before{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";color:#999}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.line_tax .delete-order-tax:hover:before,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items th.line_tax .delete-order-tax:hover:before{color:#a00}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.line_tax:hover .delete-order-tax,#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items th.line_tax:hover .delete-order-tax{visibility:visible}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items small.refunded{display:block;color:#a00;white-space:nowrap;margin-top:.5em}#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items small.refunded:before{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;text-indent:0;width:100%;height:100%;text-align:center;content:"";position:relative;top:auto;left:auto;margin:-1px 4px 0 0;vertical-align:middle;line-height:1em}#woocommerce-order-items .wc-order-edit-line-item{padding-left:0}#woocommerce-order-items .wc-order-edit-line-item-actions{width:44px;text-align:right;padding-left:0;vertical-align:middle}#woocommerce-order-items .wc-order-edit-line-item-actions a{color:#ccc;display:inline-block;cursor:pointer;padding:0 0 .5em;margin:0 0 0 12px;vertical-align:middle;text-decoration:none;line-height:16px;width:16px;overflow:hidden}#woocommerce-order-items .wc-order-edit-line-item-actions a:before{margin:0;padding:0;font-size:16px;width:16px;height:16px}#woocommerce-order-items .wc-order-edit-line-item-actions .delete-order-item:before,#woocommerce-order-items .wc-order-edit-line-item-actions .delete_refund:before,#woocommerce-order-items .wc-order-edit-line-item-actions .edit-order-item:before{font-family:Dashicons;-webkit-font-smoothing:antialiased;text-indent:0;top:0;left:0;width:100%;height:100%;margin:0;text-align:center;position:relative;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1}#woocommerce-order-items .wc-order-edit-line-item-actions a:hover:before{color:#999}#woocommerce-order-items .wc-order-edit-line-item-actions a:first-child{margin-left:0}#woocommerce-order-items .wc-order-edit-line-item-actions .edit-order-item:before{content:""}#woocommerce-order-items .wc-order-edit-line-item-actions .delete-order-item:before,#woocommerce-order-items .wc-order-edit-line-item-actions .delete_refund:before{content:""}#woocommerce-order-items .wc-order-edit-line-item-actions .delete-order-item:hover:before,#woocommerce-order-items .wc-order-edit-line-item-actions .delete_refund:hover:before{color:#a00}#woocommerce-order-items tbody tr .wc-order-edit-line-item-actions{visibility:hidden}#woocommerce-order-items tbody tr:hover .wc-order-edit-line-item-actions{visibility:visible}#woocommerce-order-items .wc-order-totals .wc-order-edit-line-item-actions{width:1.5em;visibility:visible!important}#woocommerce-order-items .wc-order-totals .wc-order-edit-line-item-actions a{padding:0}#woocommerce-order-downloads .buttons{float:left;padding:0;margin:0;vertical-align:top}#woocommerce-order-downloads .buttons .add_item_id,#woocommerce-order-downloads .buttons .select2-container{width:400px!important;margin-right:9px;vertical-align:top;float:left}#woocommerce-order-downloads .buttons button{margin:2px 0 0}#woocommerce-order-downloads h3 small{color:#999}#poststuff #woocommerce-order-actions .inside{margin:0;padding:0}#poststuff #woocommerce-order-actions .inside ul.order_actions li{padding:6px 10px;box-sizing:border-box}#poststuff #woocommerce-order-actions .inside ul.order_actions li:last-child{border-bottom:0}#poststuff #woocommerce-order-notes .inside{margin:0;padding:0}#poststuff #woocommerce-order-notes .inside ul.order_notes li{padding:0 10px}#woocommerce_customers p.search-box{margin:6px 0 4px;float:left}#woocommerce_customers .tablenav{float:right;clear:none}.widefat.customers td{vertical-align:middle;padding:4px 7px}.widefat .column-order_title{width:15%}.widefat .column-order_title time{display:block;color:#999;margin:3px 0}.widefat .column-orders,.widefat .column-paying,.widefat .column-spent{text-align:center;width:8%}.widefat .column-last_order{width:11%}.widefat .column-order_actions,.widefat .column-user_actions,.widefat .column-wc_actions{width:110px}.widefat .column-order_actions a.button,.widefat .column-user_actions a.button,.widefat .column-wc_actions a.button{float:left;margin:0 4px 2px 0;cursor:pointer;padding:3px 4px;height:auto}.widefat .column-order_actions a.button img,.widefat .column-user_actions a.button img,.widefat .column-wc_actions a.button img{display:block;width:12px;height:auto}.widefat small.meta{display:block;color:#999;font-size:inherit;margin:3px 0}.widefat .column-order_date,.widefat .column-order_total{width:9%}.widefat .column-order_status{width:45px;text-align:center}.widefat .column-order_status mark{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;background:0 0;font-size:1.4em;margin:0 auto}.widefat .column-order_status mark.cancelled:after,.widefat .column-order_status mark.completed:after,.widefat .column-order_status mark.failed:after,.widefat .column-order_status mark.on-hold:after,.widefat .column-order_status mark.pending:after,.widefat .column-order_status mark.processing:after,.widefat .column-order_status mark.refunded:after{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center}.column-customer_message .note-on:after,.column-order_notes .note-on:after{speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;top:0;left:0;text-align:center;line-height:16px;font-family:WooCommerce}.widefat .column-order_status mark.pending:after{content:"\e012";color:#ffba00}.widefat .column-order_status mark.completed:after{content:"\e015";color:#2ea2cc}.widefat .column-order_status mark.on-hold:after{content:"\e033";color:#999}.widefat .column-order_status mark.failed:after{content:"\e016";color:#d0c21f}.widefat .column-order_status mark.cancelled:after{content:"\e013";color:#a00}.widefat .column-order_status mark.processing:after{content:"\e011";color:#73a724}.widefat .column-order_status mark.refunded:after{content:"\e014";color:#999}.widefat td.column-order_status{padding-top:9px}.column-customer_message .note-on{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;margin:0 auto;color:#999}.column-customer_message .note-on:after{margin:0;text-indent:0;position:absolute;width:100%;height:100%;content:""}.column-order_notes .note-on{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;margin:0 auto;color:#999}.column-order_notes .note-on:after{margin:0;text-indent:0;position:absolute;width:100%;height:100%;content:""}.order_actions .complete,.order_actions .processing,.order_actions .view{display:block;text-indent:-9999px;position:relative;padding:0!important;height:2em!important;width:2em}.order_actions .processing:after{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";line-height:1.85}.order_actions .complete:after,.order_actions .view:after{font-family:Dashicons;text-indent:0;position:absolute;width:100%;height:100%;left:0;line-height:1.85;margin:0;text-align:center;speak:none;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;top:0;font-weight:400}.order_actions .complete:after{content:""}.order_actions .view:after{content:""}.user_actions .edit,.user_actions .link,.user_actions .refresh,.user_actions .view{display:block;text-indent:-9999px;position:relative;padding:0!important;height:2em!important;width:2em}.user_actions .edit:after,.user_actions .link:after,.user_actions .refresh:after,.user_actions .view:after{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";line-height:1.85}.user_actions .edit:after{font-family:Dashicons;content:"\f464"}.user_actions .link:after{content:"\e00d"}.user_actions .view:after{content:"\e010"}.user_actions .refresh:after{content:"\e031"}.attributes-table td,.attributes-table th{width:15%;vertical-align:top}.attributes-table .attribute-terms{width:32%}.attributes-table .attribute-actions{width:2em}.attributes-table .attribute-actions .configure-terms{display:block;text-indent:-9999px;position:relative;padding:0!important;height:2em!important;width:2em}.attributes-table .attribute-actions .configure-terms:after{speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";font-family:Dashicons;line-height:1.85}ul.order_notes{padding:2px 0 0}ul.order_notes li .note_content{padding:10px;background:#efefef;position:relative}ul.order_notes li .note_content p{margin:0;padding:0;word-wrap:break-word}ul.order_notes li p.meta{padding:10px;color:#999;margin:0;font-size:11px}ul.order_notes li a.delete_note{color:#a00}table.wp-list-table .row-actions,table.wp-list-table span.na{color:#999}ul.order_notes li .note_content:after{content:"";display:block;position:absolute;bottom:-10px;left:20px;width:0;height:0;border-width:10px 10px 0 0;border-style:solid;border-color:#efefef transparent}ul.order_notes li.customer-note .note_content{background:#A7CEDC}ul.order_notes li.customer-note .note_content:after{border-color:#A7CEDC transparent}ul.order_notes li.system-note .note_content{background:#d7cad2}ul.order_notes li.system-note .note_content:after{border-color:#d7cad2 transparent}.add_note{border-top:1px solid #ddd;padding:10px 10px 0}.add_note h4{margin-top:5px!important}.add_note #add_order_note{width:100%;height:50px}table.wp-list-table .column-thumb{width:52px;text-align:center;white-space:nowrap}table.wp-list-table .column-name{width:22%}table.wp-list-table .column-product_cat,table.wp-list-table .column-product_tag{width:11%!important}table.wp-list-table .column-featured,table.wp-list-table .column-product_type{width:48px;text-align:left!important}table.wp-list-table .column-customer_message,table.wp-list-table .column-order_notes{width:48px;text-align:center}table.wp-list-table .column-customer_message img,table.wp-list-table .column-order_notes img{margin:0 auto;padding-top:0!important}table.wp-list-table .manage-column.column-featured img,table.wp-list-table .manage-column.column-product_type img{padding-left:2px}table.wp-list-table .column-price .woocommerce-price-suffix{display:none}table.wp-list-table img{margin:1px 2px}table.wp-list-table td.column-thumb img{margin:0;width:auto;height:auto;max-width:40px;max-height:40px;vertical-align:middle}table.wp-list-table .column-is_in_stock{text-align:left!important}table.wp-list-table span.wc-featured,table.wp-list-table span.wc-image,table.wp-list-table span.wc-type{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;margin:0 auto}table.wp-list-table span.wc-featured:before,table.wp-list-table span.wc-image:before,table.wp-list-table span.wc-type:before{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:""}table.wp-list-table span.wc-featured{margin:0;cursor:pointer}table.wp-list-table span.wc-featured:before{content:"\f155"}table.wp-list-table span.wc-featured.not-featured:before{content:"\f154"}table.wp-list-table td.column-featured span.wc-featured{font-size:1.6em}table.wp-list-table span.wc-type{margin:0}table.wp-list-table span.wc-type:before{font-family:WooCommerce;content:"\e006"}table.wp-list-table .notes_head:after,table.wp-list-table .order-notes_head:after,table.wp-list-table .status_head:after,table.wp-list-table span.product-type:before{font-family:WooCommerce;text-align:center;line-height:1;top:0;speak:none;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;left:0}table.wp-list-table span.product-type{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;font-size:1.6em}table.wp-list-table span.product-type:before{font-weight:400;margin:0;text-indent:0;position:absolute;width:100%;height:100%;content:""}table.wp-list-table span.product-type.grouped:before{content:"\e002"}table.wp-list-table span.product-type.external:before{content:"\e034"}table.wp-list-table span.product-type.variable:before{content:"\e003"}table.wp-list-table span.product-type.downloadable:before{content:"\e001"}table.wp-list-table span.product-type.virtual:before{content:"\e000"}table.wp-list-table mark.instock{font-weight:700;color:#7ad03a;background:0 0;line-height:1}table.wp-list-table mark.outofstock{font-weight:700;color:#a44;background:0 0;line-height:1}table.wp-list-table .notes_head,table.wp-list-table .order-notes_head,table.wp-list-table .status_head{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;margin:0 auto}table.wp-list-table .notes_head:after,table.wp-list-table .order-notes_head:after,table.wp-list-table .status_head:after{font-weight:400;margin:0;text-indent:0;position:absolute;width:100%;height:100%}table.wc_emails .wc-email-settings-table-name,table.wc_emails td.name,table.wc_gateways .wc-email-settings-table-name,table.wc_gateways td.name,table.wc_shipping .wc-email-settings-table-name,table.wc_shipping td.name{font-weight:700}table.wp-list-table .order-notes_head:after{content:"\e028"}table.wp-list-table .notes_head:after{content:"\e026"}table.wp-list-table .status_head:after{content:"\e011"}table.wp-list-table .column-order_items{width:12%}table.wp-list-table .column-order_items table.order_items{width:100%;margin:3px 0 0;padding:0;display:none}table.wp-list-table .column-order_items table.order_items td{border:0;margin:0;padding:0 0 3px}table.wp-list-table .column-order_items table.order_items td.qty{color:#999;padding-right:6px;text-align:left}mark.notice{background:#fff;color:#a00;margin:0 0 0 10px}a.export_rates,a.import_rates{float:right;margin-left:9px;margin-top:-2px;margin-bottom:0}#rates-search{float:right}#rates-search input.wc-tax-rates-search-field{padding:4px 8px;font-size:1.2em}#rates-pagination{float:right;margin-right:.5em}#rates-pagination .tablenav{margin:0}table.wc_input_table,table.wc_tax_rates{width:100%}table.wc_input_table span.tips,table.wc_tax_rates span.tips{color:#2ea2cc}table.wc_input_table th,table.wc_tax_rates th{white-space:nowrap;padding:10px}table.wc_input_table td,table.wc_tax_rates td{padding:0;border-right:1px solid #DFDFDF;border-bottom:1px solid #DFDFDF;border-top:0;background:#fff;cursor:default}table.wc_input_table td input[type=text],table.wc_input_table td input[type=number],table.wc_tax_rates td input[type=text],table.wc_tax_rates td input[type=number]{width:100%;padding:8px 10px;margin:0;border:0;outline:0;background:0 0}table.wc_input_table td input[type=text]:focus,table.wc_input_table td input[type=number]:focus,table.wc_tax_rates td input[type=text]:focus,table.wc_tax_rates td input[type=number]:focus{outline:0;box-shadow:none}table.wc_input_table td.apply_to_shipping,table.wc_input_table td.compound,table.wc_tax_rates td.apply_to_shipping,table.wc_tax_rates td.compound{padding:5px 7px;vertical-align:middle}table.wc_input_table td.apply_to_shipping input,table.wc_input_table td.compound input,table.wc_tax_rates td.apply_to_shipping input,table.wc_tax_rates td.compound input{width:auto;padding:0}table.wc_input_table td:last-child,table.wc_tax_rates td:last-child{border-right:0}table.wc_input_table tr.current td,table.wc_tax_rates tr.current td{background-color:#fefbcc}table.wc_input_table .cost,table.wc_input_table .cost input,table.wc_input_table .item_cost,table.wc_input_table .item_cost input,table.wc_tax_rates .cost,table.wc_tax_rates .cost input,table.wc_tax_rates .item_cost,table.wc_tax_rates .item_cost input{text-align:right}table.wc_input_table th.sort,table.wc_tax_rates th.sort{width:17px;padding:0 4px}table.wc_input_table td.sort,table.wc_tax_rates td.sort{padding:0 4px}table.wc_input_table .ui-sortable:not(.ui-sortable-disabled) td.sort,table.wc_tax_rates .ui-sortable:not(.ui-sortable-disabled) td.sort{cursor:move;font-size:15px;background:#f9f9f9;text-align:center;vertical-align:middle}table.wc_input_table .ui-sortable:not(.ui-sortable-disabled) td.sort:before,table.wc_tax_rates .ui-sortable:not(.ui-sortable-disabled) td.sort:before{content:"\f333";font-family:Dashicons;text-align:center;line-height:1;color:#999;display:block;width:17px;float:left;height:100%}table.wc_input_table .ui-sortable:not(.ui-sortable-disabled) td.sort:hover:before,table.wc_tax_rates .ui-sortable:not(.ui-sortable-disabled) td.sort:hover:before{color:#333}table.wc_input_table .button,table.wc_tax_rates .button{float:left;margin-right:5px}table.wc_input_table .export,table.wc_input_table .import,table.wc_tax_rates .export,table.wc_tax_rates .import{float:right;margin-right:0;margin-left:5px}table.wc_input_table span.tips,table.wc_tax_rates span.tips{padding:0 3px}table.wc_input_table .pagination,table.wc_tax_rates .pagination{float:right}table.wc_input_table .pagination .button,table.wc_tax_rates .pagination .button{margin-left:5px;margin-right:0}table.wc_input_table .pagination .current,table.wc_tax_rates .pagination .current{background:#bbb;text-shadow:none}table.wc_input_table tr:last-child td,table.wc_tax_rates tr:last-child td{border-bottom:0}table.wc_emails,table.wc_gateways,table.wc_shipping{position:relative}table.wc_emails td,table.wc_gateways td,table.wc_shipping td{vertical-align:middle;padding:7px;line-height:2em}table.wc_emails tr:nth-child(odd) td,table.wc_gateways tr:nth-child(odd) td,table.wc_shipping tr:nth-child(odd) td{background:#f9f9f9}table.wc_emails th,table.wc_gateways th,table.wc_shipping th{padding:9px 7px!important;vertical-align:middle}table.wc_emails .settings,table.wc_gateways .settings,table.wc_shipping .settings{text-align:right}table.wc_emails .default,table.wc_emails .radio,table.wc_emails .status,table.wc_gateways .default,table.wc_gateways .radio,table.wc_gateways .status,table.wc_shipping .default,table.wc_shipping .radio,table.wc_shipping .status{text-align:center}table.wc_emails .default .tips,table.wc_emails .radio .tips,table.wc_emails .status .tips,table.wc_gateways .default .tips,table.wc_gateways .radio .tips,table.wc_gateways .status .tips,table.wc_shipping .default .tips,table.wc_shipping .radio .tips,table.wc_shipping .status .tips{margin:0 auto}table.wc_emails .default input,table.wc_emails .radio input,table.wc_emails .status input,table.wc_gateways .default input,table.wc_gateways .radio input,table.wc_gateways .status input,table.wc_shipping .default input,table.wc_shipping .radio input,table.wc_shipping .status input{margin:0}table.wc_emails th.sort,table.wc_gateways th.sort,table.wc_shipping th.sort{width:28px;padding:0}table.wc_emails td.sort,table.wc_gateways td.sort,table.wc_shipping td.sort{padding:0 7px;cursor:move;font-size:15px;text-align:center;vertical-align:middle}table.wc_emails td.sort:before,table.wc_gateways td.sort:before,table.wc_shipping td.sort:before{content:"\f333";font-family:Dashicons;text-align:center;line-height:1;color:#999;display:block;width:17px;float:left;height:100%}table.wc_emails .wc-email-settings-table-name span,table.wc_gateways .wc-email-settings-table-name span,table.wc_shipping .wc-email-settings-table-name span{font-weight:400;color:#999;margin:0 0 0 4px!important}table.wc_emails .wc-email-settings-table-status,table.wc_gateways .wc-email-settings-table-status,table.wc_shipping .wc-email-settings-table-status{text-align:center;width:1em}table.wc_emails .wc-email-settings-table-status .tips,table.wc_gateways .wc-email-settings-table-status .tips,table.wc_shipping .wc-email-settings-table-status .tips{margin:0 auto}table.wc_emails .wc-email-settings-table-actions a,table.wc_gateways .wc-email-settings-table-actions a,table.wc_shipping .wc-email-settings-table-actions a{display:block;text-indent:-9999px;position:relative;padding:0!important;height:2em!important;width:2em}table.wc_emails .wc-email-settings-table-actions a:after,table.wc_gateways .wc-email-settings-table-actions a:after,table.wc_shipping .wc-email-settings-table-actions a:after{speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";font-family:Dashicons;line-height:1.85}table.wc-shipping-classes td,table.wc-shipping-classes th,table.wc-shipping-zone-methods td,table.wc-shipping-zone-methods th,table.wc-shipping-zones td,table.wc-shipping-zones th{vertical-align:top;line-height:24px;padding:1em;font-size:14px;background:#fff}table.wc-shipping-classes td li,table.wc-shipping-classes th li,table.wc-shipping-zone-methods td li,table.wc-shipping-zone-methods th li,table.wc-shipping-zones td li,table.wc-shipping-zones th li{line-height:24px;font-size:14px}table.wc-shipping-classes td.wc-shipping-zone-method-blank-state,table.wc-shipping-classes td.wc-shipping-zones-blank-state,table.wc-shipping-zone-methods td.wc-shipping-zone-method-blank-state,table.wc-shipping-zone-methods td.wc-shipping-zones-blank-state,table.wc-shipping-zones td.wc-shipping-zone-method-blank-state,table.wc-shipping-zones td.wc-shipping-zones-blank-state{background:#F7F1F6!important;overflow:hidden;position:relative;padding:7.5em 7.5%;border-bottom:2px solid #EEE2EC}table.wc-shipping-classes td.wc-shipping-zone-method-blank-state li,table.wc-shipping-classes td.wc-shipping-zone-method-blank-state p,table.wc-shipping-classes td.wc-shipping-zones-blank-state li,table.wc-shipping-classes td.wc-shipping-zones-blank-state p,table.wc-shipping-zone-methods td.wc-shipping-zone-method-blank-state li,table.wc-shipping-zone-methods td.wc-shipping-zone-method-blank-state p,table.wc-shipping-zone-methods td.wc-shipping-zones-blank-state li,table.wc-shipping-zone-methods td.wc-shipping-zones-blank-state p,table.wc-shipping-zones td.wc-shipping-zone-method-blank-state li,table.wc-shipping-zones td.wc-shipping-zone-method-blank-state p,table.wc-shipping-zones td.wc-shipping-zones-blank-state li,table.wc-shipping-zones td.wc-shipping-zones-blank-state p{color:#a46497;font-size:1.5em;line-height:1.5em;margin:0 0 1em;position:relative;z-index:1;text-shadow:1px 1px 1px #fff}table.wc-shipping-classes td.wc-shipping-zone-method-blank-state li.main,table.wc-shipping-classes td.wc-shipping-zone-method-blank-state p.main,table.wc-shipping-classes td.wc-shipping-zones-blank-state li.main,table.wc-shipping-classes td.wc-shipping-zones-blank-state p.main,table.wc-shipping-zone-methods td.wc-shipping-zone-method-blank-state li.main,table.wc-shipping-zone-methods td.wc-shipping-zone-method-blank-state p.main,table.wc-shipping-zone-methods td.wc-shipping-zones-blank-state li.main,table.wc-shipping-zone-methods td.wc-shipping-zones-blank-state p.main,table.wc-shipping-zones td.wc-shipping-zone-method-blank-state li.main,table.wc-shipping-zones td.wc-shipping-zone-method-blank-state p.main,table.wc-shipping-zones td.wc-shipping-zones-blank-state li.main,table.wc-shipping-zones td.wc-shipping-zones-blank-state p.main{font-size:2em}table.wc-shipping-classes td.wc-shipping-zone-method-blank-state li,table.wc-shipping-classes td.wc-shipping-zones-blank-state li,table.wc-shipping-zone-methods td.wc-shipping-zone-method-blank-state li,table.wc-shipping-zone-methods td.wc-shipping-zones-blank-state li,table.wc-shipping-zones td.wc-shipping-zone-method-blank-state li,table.wc-shipping-zones td.wc-shipping-zones-blank-state li{margin-left:1em;list-style:circle inside}table.wc-shipping-classes td.wc-shipping-zone-method-blank-state:before,table.wc-shipping-classes td.wc-shipping-zones-blank-state:before,table.wc-shipping-zone-methods td.wc-shipping-zone-method-blank-state:before,table.wc-shipping-zone-methods td.wc-shipping-zones-blank-state:before,table.wc-shipping-zones td.wc-shipping-zone-method-blank-state:before,table.wc-shipping-zones td.wc-shipping-zones-blank-state:before{content:"\e01b";font-family:WooCommerce;text-align:center;line-height:1;color:#EEE2EC;display:block;width:1em;font-size:40em;top:50%;right:-3.75%;margin-top:-.1875em;position:absolute}table.wc-shipping-classes td.wc-shipping-zone-method-blank-state .button-primary,table.wc-shipping-classes td.wc-shipping-zones-blank-state .button-primary,table.wc-shipping-zone-methods td.wc-shipping-zone-method-blank-state .button-primary,table.wc-shipping-zone-methods td.wc-shipping-zones-blank-state .button-primary,table.wc-shipping-zones td.wc-shipping-zone-method-blank-state .button-primary,table.wc-shipping-zones td.wc-shipping-zones-blank-state .button-primary{background-color:#804877;border-color:#804877;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 0 rgba(0,0,0,.15);margin:0;opacity:1;text-shadow:0 -1px 1px #8a4f7f,1px 0 1px #8a4f7f,0 1px 1px #8a4f7f,-1px 0 1px #8a4f7f;font-size:1.5em;padding:.75em 1em;height:auto;position:relative;z-index:1}table.wc-shipping-classes .wc-shipping-class-rows tr:nth-child(odd) td,table.wc-shipping-classes .wc-shipping-zone-method-rows tr:nth-child(odd) td,table.wc-shipping-classes tbody.wc-shipping-zone-rows tr:nth-child(odd) td,table.wc-shipping-classes tr.odd td,table.wc-shipping-zone-methods .wc-shipping-class-rows tr:nth-child(odd) td,table.wc-shipping-zone-methods .wc-shipping-zone-method-rows tr:nth-child(odd) td,table.wc-shipping-zone-methods tbody.wc-shipping-zone-rows tr:nth-child(odd) td,table.wc-shipping-zone-methods tr.odd td,table.wc-shipping-zones .wc-shipping-class-rows tr:nth-child(odd) td,table.wc-shipping-zones .wc-shipping-zone-method-rows tr:nth-child(odd) td,table.wc-shipping-zones tbody.wc-shipping-zone-rows tr:nth-child(odd) td,table.wc-shipping-zones tr.odd td{background:#f9f9f9}table.wc-shipping-classes p,table.wc-shipping-classes ul,table.wc-shipping-zone-methods p,table.wc-shipping-zone-methods ul,table.wc-shipping-zones p,table.wc-shipping-zones ul{margin:0}table.wc-shipping-classes td.wc-shipping-zone-method-sort,table.wc-shipping-classes td.wc-shipping-zone-sort,table.wc-shipping-zone-methods td.wc-shipping-zone-method-sort,table.wc-shipping-zone-methods td.wc-shipping-zone-sort,table.wc-shipping-zones td.wc-shipping-zone-method-sort,table.wc-shipping-zones td.wc-shipping-zone-sort{cursor:move;font-size:15px;text-align:center}table.wc-shipping-classes td.wc-shipping-zone-method-sort:before,table.wc-shipping-classes td.wc-shipping-zone-sort:before,table.wc-shipping-zone-methods td.wc-shipping-zone-method-sort:before,table.wc-shipping-zone-methods td.wc-shipping-zone-sort:before,table.wc-shipping-zones td.wc-shipping-zone-method-sort:before,table.wc-shipping-zones td.wc-shipping-zone-sort:before{content:"\f333";font-family:Dashicons;text-align:center;color:#999;display:block;width:17px;float:left;height:100%;line-height:24px}table.wc-shipping-classes td.wc-shipping-zone-method-sort:hover:before,table.wc-shipping-classes td.wc-shipping-zone-sort:hover:before,table.wc-shipping-zone-methods td.wc-shipping-zone-method-sort:hover:before,table.wc-shipping-zone-methods td.wc-shipping-zone-sort:hover:before,table.wc-shipping-zones td.wc-shipping-zone-method-sort:hover:before,table.wc-shipping-zones td.wc-shipping-zone-sort:hover:before{color:#333}table.wc-shipping-classes td.wc-shipping-zone-worldwide,table.wc-shipping-zone-methods td.wc-shipping-zone-worldwide,table.wc-shipping-zones td.wc-shipping-zone-worldwide{text-align:center}table.wc-shipping-classes td.wc-shipping-zone-worldwide:before,table.wc-shipping-zone-methods td.wc-shipping-zone-worldwide:before,table.wc-shipping-zones td.wc-shipping-zone-worldwide:before{content:"\f319";font-family:dashicons;text-align:center;color:#999;display:block;width:17px;float:left;height:100%;line-height:24px}table.wc-shipping-classes .wc-shipping-zone-methods,table.wc-shipping-classes .wc-shipping-zone-name,table.wc-shipping-zone-methods .wc-shipping-zone-methods,table.wc-shipping-zone-methods .wc-shipping-zone-name,table.wc-shipping-zones .wc-shipping-zone-methods,table.wc-shipping-zones .wc-shipping-zone-name{width:25%}table.wc-shipping-classes .wc-shipping-class-description input,table.wc-shipping-classes .wc-shipping-class-description select,table.wc-shipping-classes .wc-shipping-class-description textarea,table.wc-shipping-classes .wc-shipping-class-name input,table.wc-shipping-classes .wc-shipping-class-name select,table.wc-shipping-classes .wc-shipping-class-name textarea,table.wc-shipping-classes .wc-shipping-class-slug input,table.wc-shipping-classes .wc-shipping-class-slug select,table.wc-shipping-classes .wc-shipping-class-slug textarea,table.wc-shipping-classes .wc-shipping-zone-name input,table.wc-shipping-classes .wc-shipping-zone-name select,table.wc-shipping-classes .wc-shipping-zone-name textarea,table.wc-shipping-classes .wc-shipping-zone-region input,table.wc-shipping-classes .wc-shipping-zone-region select,table.wc-shipping-classes .wc-shipping-zone-region textarea,table.wc-shipping-zone-methods .wc-shipping-class-description input,table.wc-shipping-zone-methods .wc-shipping-class-description select,table.wc-shipping-zone-methods .wc-shipping-class-description textarea,table.wc-shipping-zone-methods .wc-shipping-class-name input,table.wc-shipping-zone-methods .wc-shipping-class-name select,table.wc-shipping-zone-methods .wc-shipping-class-name textarea,table.wc-shipping-zone-methods .wc-shipping-class-slug input,table.wc-shipping-zone-methods .wc-shipping-class-slug select,table.wc-shipping-zone-methods .wc-shipping-class-slug textarea,table.wc-shipping-zone-methods .wc-shipping-zone-name input,table.wc-shipping-zone-methods .wc-shipping-zone-name select,table.wc-shipping-zone-methods .wc-shipping-zone-name textarea,table.wc-shipping-zone-methods .wc-shipping-zone-region input,table.wc-shipping-zone-methods .wc-shipping-zone-region select,table.wc-shipping-zone-methods .wc-shipping-zone-region textarea,table.wc-shipping-zones .wc-shipping-class-description input,table.wc-shipping-zones .wc-shipping-class-description select,table.wc-shipping-zones .wc-shipping-class-description textarea,table.wc-shipping-zones .wc-shipping-class-name input,table.wc-shipping-zones .wc-shipping-class-name select,table.wc-shipping-zones .wc-shipping-class-name textarea,table.wc-shipping-zones .wc-shipping-class-slug input,table.wc-shipping-zones .wc-shipping-class-slug select,table.wc-shipping-zones .wc-shipping-class-slug textarea,table.wc-shipping-zones .wc-shipping-zone-name input,table.wc-shipping-zones .wc-shipping-zone-name select,table.wc-shipping-zones .wc-shipping-zone-name textarea,table.wc-shipping-zones .wc-shipping-zone-region input,table.wc-shipping-zones .wc-shipping-zone-region select,table.wc-shipping-zones .wc-shipping-zone-region textarea{width:100%}table.wc-shipping-classes .wc-shipping-class-description a.wc-shipping-class-delete,table.wc-shipping-classes .wc-shipping-class-description a.wc-shipping-zone-delete,table.wc-shipping-classes .wc-shipping-class-name a.wc-shipping-class-delete,table.wc-shipping-classes .wc-shipping-class-name a.wc-shipping-zone-delete,table.wc-shipping-classes .wc-shipping-class-slug a.wc-shipping-class-delete,table.wc-shipping-classes .wc-shipping-class-slug a.wc-shipping-zone-delete,table.wc-shipping-classes .wc-shipping-zone-name a.wc-shipping-class-delete,table.wc-shipping-classes .wc-shipping-zone-name a.wc-shipping-zone-delete,table.wc-shipping-classes .wc-shipping-zone-region a.wc-shipping-class-delete,table.wc-shipping-classes .wc-shipping-zone-region a.wc-shipping-zone-delete,table.wc-shipping-zone-methods .wc-shipping-class-description a.wc-shipping-class-delete,table.wc-shipping-zone-methods .wc-shipping-class-description a.wc-shipping-zone-delete,table.wc-shipping-zone-methods .wc-shipping-class-name a.wc-shipping-class-delete,table.wc-shipping-zone-methods .wc-shipping-class-name a.wc-shipping-zone-delete,table.wc-shipping-zone-methods .wc-shipping-class-slug a.wc-shipping-class-delete,table.wc-shipping-zone-methods .wc-shipping-class-slug a.wc-shipping-zone-delete,table.wc-shipping-zone-methods .wc-shipping-zone-name a.wc-shipping-class-delete,table.wc-shipping-zone-methods .wc-shipping-zone-name a.wc-shipping-zone-delete,table.wc-shipping-zone-methods .wc-shipping-zone-region a.wc-shipping-class-delete,table.wc-shipping-zone-methods .wc-shipping-zone-region a.wc-shipping-zone-delete,table.wc-shipping-zones .wc-shipping-class-description a.wc-shipping-class-delete,table.wc-shipping-zones .wc-shipping-class-description a.wc-shipping-zone-delete,table.wc-shipping-zones .wc-shipping-class-name a.wc-shipping-class-delete,table.wc-shipping-zones .wc-shipping-class-name a.wc-shipping-zone-delete,table.wc-shipping-zones .wc-shipping-class-slug a.wc-shipping-class-delete,table.wc-shipping-zones .wc-shipping-class-slug a.wc-shipping-zone-delete,table.wc-shipping-zones .wc-shipping-zone-name a.wc-shipping-class-delete,table.wc-shipping-zones .wc-shipping-zone-name a.wc-shipping-zone-delete,table.wc-shipping-zones .wc-shipping-zone-region a.wc-shipping-class-delete,table.wc-shipping-zones .wc-shipping-zone-region a.wc-shipping-zone-delete{color:red}table.wc-shipping-classes .wc-shipping-class-description .wc-shipping-zone-postcodes-toggle,table.wc-shipping-classes .wc-shipping-class-name .wc-shipping-zone-postcodes-toggle,table.wc-shipping-classes .wc-shipping-class-slug .wc-shipping-zone-postcodes-toggle,table.wc-shipping-classes .wc-shipping-zone-name .wc-shipping-zone-postcodes-toggle,table.wc-shipping-classes .wc-shipping-zone-region .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zone-methods .wc-shipping-class-description .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zone-methods .wc-shipping-class-name .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zone-methods .wc-shipping-class-slug .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zone-methods .wc-shipping-zone-name .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zone-methods .wc-shipping-zone-region .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zones .wc-shipping-class-description .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zones .wc-shipping-class-name .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zones .wc-shipping-class-slug .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zones .wc-shipping-zone-name .wc-shipping-zone-postcodes-toggle,table.wc-shipping-zones .wc-shipping-zone-region .wc-shipping-zone-postcodes-toggle{float:right;margin:0;font-size:.9em;text-decoration:underline}table.wc-shipping-classes .wc-shipping-class-description .wc-shipping-zone-postcodes,table.wc-shipping-classes .wc-shipping-class-name .wc-shipping-zone-postcodes,table.wc-shipping-classes .wc-shipping-class-slug .wc-shipping-zone-postcodes,table.wc-shipping-classes .wc-shipping-zone-name .wc-shipping-zone-postcodes,table.wc-shipping-classes .wc-shipping-zone-region .wc-shipping-zone-postcodes,table.wc-shipping-zone-methods .wc-shipping-class-description .wc-shipping-zone-postcodes,table.wc-shipping-zone-methods .wc-shipping-class-name .wc-shipping-zone-postcodes,table.wc-shipping-zone-methods .wc-shipping-class-slug .wc-shipping-zone-postcodes,table.wc-shipping-zone-methods .wc-shipping-zone-name .wc-shipping-zone-postcodes,table.wc-shipping-zone-methods .wc-shipping-zone-region .wc-shipping-zone-postcodes,table.wc-shipping-zones .wc-shipping-class-description .wc-shipping-zone-postcodes,table.wc-shipping-zones .wc-shipping-class-name .wc-shipping-zone-postcodes,table.wc-shipping-zones .wc-shipping-class-slug .wc-shipping-zone-postcodes,table.wc-shipping-zones .wc-shipping-zone-name .wc-shipping-zone-postcodes,table.wc-shipping-zones .wc-shipping-zone-region .wc-shipping-zone-postcodes{display:none}table.wc-shipping-classes .wc-shipping-class-description .wc-shipping-zone-postcodes textarea,table.wc-shipping-classes .wc-shipping-class-name .wc-shipping-zone-postcodes textarea,table.wc-shipping-classes .wc-shipping-class-slug .wc-shipping-zone-postcodes textarea,table.wc-shipping-classes .wc-shipping-zone-name .wc-shipping-zone-postcodes textarea,table.wc-shipping-classes .wc-shipping-zone-region .wc-shipping-zone-postcodes textarea,table.wc-shipping-zone-methods .wc-shipping-class-description .wc-shipping-zone-postcodes textarea,table.wc-shipping-zone-methods .wc-shipping-class-name .wc-shipping-zone-postcodes textarea,table.wc-shipping-zone-methods .wc-shipping-class-slug .wc-shipping-zone-postcodes textarea,table.wc-shipping-zone-methods .wc-shipping-zone-name .wc-shipping-zone-postcodes textarea,table.wc-shipping-zone-methods .wc-shipping-zone-region .wc-shipping-zone-postcodes textarea,table.wc-shipping-zones .wc-shipping-class-description .wc-shipping-zone-postcodes textarea,table.wc-shipping-zones .wc-shipping-class-name .wc-shipping-zone-postcodes textarea,table.wc-shipping-zones .wc-shipping-class-slug .wc-shipping-zone-postcodes textarea,table.wc-shipping-zones .wc-shipping-zone-name .wc-shipping-zone-postcodes textarea,table.wc-shipping-zones .wc-shipping-zone-region .wc-shipping-zone-postcodes textarea{margin-top:1em}table.wc-shipping-classes .wc-shipping-class-description .wc-shipping-zone-postcodes .description,table.wc-shipping-classes .wc-shipping-class-name .wc-shipping-zone-postcodes .description,table.wc-shipping-classes .wc-shipping-class-slug .wc-shipping-zone-postcodes .description,table.wc-shipping-classes .wc-shipping-zone-name .wc-shipping-zone-postcodes .description,table.wc-shipping-classes .wc-shipping-zone-region .wc-shipping-zone-postcodes .description,table.wc-shipping-zone-methods .wc-shipping-class-description .wc-shipping-zone-postcodes .description,table.wc-shipping-zone-methods .wc-shipping-class-name .wc-shipping-zone-postcodes .description,table.wc-shipping-zone-methods .wc-shipping-class-slug .wc-shipping-zone-postcodes .description,table.wc-shipping-zone-methods .wc-shipping-zone-name .wc-shipping-zone-postcodes .description,table.wc-shipping-zone-methods .wc-shipping-zone-region .wc-shipping-zone-postcodes .description,table.wc-shipping-zones .wc-shipping-class-description .wc-shipping-zone-postcodes .description,table.wc-shipping-zones .wc-shipping-class-name .wc-shipping-zone-postcodes .description,table.wc-shipping-zones .wc-shipping-class-slug .wc-shipping-zone-postcodes .description,table.wc-shipping-zones .wc-shipping-zone-name .wc-shipping-zone-postcodes .description,table.wc-shipping-zones .wc-shipping-zone-region .wc-shipping-zone-postcodes .description{font-size:.9em;color:#999}table.wc-shipping-classes .wc-shipping-class-count,table.wc-shipping-zone-methods .wc-shipping-class-count,table.wc-shipping-zones .wc-shipping-class-count{text-align:center}table.wc-shipping-classes td.wc-shipping-zone-methods,table.wc-shipping-zone-methods td.wc-shipping-zone-methods,table.wc-shipping-zones td.wc-shipping-zone-methods{color:#999}table.wc-shipping-classes td.wc-shipping-zone-methods .method_disabled,table.wc-shipping-zone-methods td.wc-shipping-zone-methods .method_disabled,table.wc-shipping-zones td.wc-shipping-zone-methods .method_disabled{text-decoration:line-through}table.wc-shipping-classes td.wc-shipping-zone-methods ul,table.wc-shipping-zone-methods td.wc-shipping-zone-methods ul,table.wc-shipping-zones td.wc-shipping-zone-methods ul{color:#999;position:relative;padding-right:32px}table.wc-shipping-classes td.wc-shipping-zone-methods ul li,table.wc-shipping-zone-methods td.wc-shipping-zone-methods ul li,table.wc-shipping-zones td.wc-shipping-zone-methods ul li{display:inline;margin:0}table.wc-shipping-classes td.wc-shipping-zone-methods ul li:before,table.wc-shipping-zone-methods td.wc-shipping-zone-methods ul li:before,table.wc-shipping-zones td.wc-shipping-zone-methods ul li:before{content:", "}table.wc-shipping-classes td.wc-shipping-zone-methods ul li:first-child:before,table.wc-shipping-classes td.wc-shipping-zone-methods ul li:nth-child(2):before,table.wc-shipping-zone-methods td.wc-shipping-zone-methods ul li:first-child:before,table.wc-shipping-zone-methods td.wc-shipping-zone-methods ul li:nth-child(2):before,table.wc-shipping-zones td.wc-shipping-zone-methods ul li:first-child:before,table.wc-shipping-zones td.wc-shipping-zone-methods ul li:nth-child(2):before{content:""}table.wc-shipping-classes td.wc-shipping-zone-methods ul li:first-child,table.wc-shipping-zone-methods td.wc-shipping-zone-methods ul li:first-child,table.wc-shipping-zones td.wc-shipping-zone-methods ul li:first-child{display:block}table.wc-shipping-classes td.wc-shipping-zone-methods ul li.wc-shipping-zone-methods-add-row,table.wc-shipping-zone-methods td.wc-shipping-zone-methods ul li.wc-shipping-zone-methods-add-row,table.wc-shipping-zones td.wc-shipping-zone-methods ul li.wc-shipping-zone-methods-add-row{position:absolute;right:0;top:0}table.wc-shipping-classes td.wc-shipping-zone-methods .add_shipping_method,table.wc-shipping-zone-methods td.wc-shipping-zone-methods .add_shipping_method,table.wc-shipping-zones td.wc-shipping-zone-methods .add_shipping_method{display:block;width:24px;padding:24px 0 0;height:0;overflow:hidden;cursor:pointer}table.wc-shipping-classes td.wc-shipping-zone-methods .add_shipping_method:before,table.wc-shipping-zone-methods td.wc-shipping-zone-methods .add_shipping_method:before,table.wc-shipping-zones td.wc-shipping-zone-methods .add_shipping_method:before{speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;font-family:Dashicons;content:"\f502";color:#999;vertical-align:middle;line-height:24px;font-size:16px;margin:0}table.wc-shipping-classes .wc-shipping-zone-method-enabled .status-disabled:before,table.wc-shipping-classes .wc-shipping-zone-method-enabled .status-enabled:before,table.wc-shipping-zone-methods .wc-shipping-zone-method-enabled .status-disabled:before,table.wc-shipping-zone-methods .wc-shipping-zone-method-enabled .status-enabled:before,table.wc-shipping-zones .wc-shipping-zone-method-enabled .status-disabled:before,table.wc-shipping-zones .wc-shipping-zone-method-enabled .status-enabled:before{line-height:inherit}table.wc-shipping-classes .wc-shipping-zone-method-enabled .status-disabled,table.wc-shipping-classes .wc-shipping-zone-method-enabled .status-enabled,table.wc-shipping-zone-methods .wc-shipping-zone-method-enabled .status-disabled,table.wc-shipping-zone-methods .wc-shipping-zone-method-enabled .status-enabled,table.wc-shipping-zones .wc-shipping-zone-method-enabled .status-disabled,table.wc-shipping-zones .wc-shipping-zone-method-enabled .status-enabled{margin-top:1px;display:inline-block}table.wc-shipping-classes td.wc-shipping-zone-methods .add_shipping_method.disabled,table.wc-shipping-zone-methods td.wc-shipping-zone-methods .add_shipping_method.disabled,table.wc-shipping-zones td.wc-shipping-zone-methods .add_shipping_method.disabled{cursor:not-allowed}table.wc-shipping-classes td.wc-shipping-zone-methods .add_shipping_method.disabled:before,table.wc-shipping-zone-methods td.wc-shipping-zone-methods .add_shipping_method.disabled:before,table.wc-shipping-zones td.wc-shipping-zone-methods .add_shipping_method.disabled:before{color:#ccc}table.wc-shipping-classes .wc-shipping-zone-method-title,table.wc-shipping-zone-methods .wc-shipping-zone-method-title,table.wc-shipping-zones .wc-shipping-zone-method-title{width:33%}table.wc-shipping-classes .wc-shipping-zone-method-title .wc-shipping-zone-method-delete,table.wc-shipping-zone-methods .wc-shipping-zone-method-title .wc-shipping-zone-method-delete,table.wc-shipping-zones .wc-shipping-zone-method-title .wc-shipping-zone-method-delete{color:red}table.wc-shipping-classes .wc-shipping-zone-method-enabled,table.wc-shipping-zone-methods .wc-shipping-zone-method-enabled,table.wc-shipping-zones .wc-shipping-zone-method-enabled{text-align:center}table.wc-shipping-classes tfoot input,table.wc-shipping-classes tfoot select,table.wc-shipping-zone-methods tfoot input,table.wc-shipping-zone-methods tfoot select,table.wc-shipping-zones tfoot input,table.wc-shipping-zones tfoot select{vertical-align:middle!important}table.wc-shipping-classes tfoot .button-secondary,table.wc-shipping-zone-methods tfoot .button-secondary,table.wc-shipping-zones tfoot .button-secondary{float:right}table.wc-shipping-classes .editing .wc-shipping-zone-edit,table.wc-shipping-classes .editing .wc-shipping-zone-view,table.wc-shipping-zone-methods .editing .wc-shipping-zone-edit,table.wc-shipping-zone-methods .editing .wc-shipping-zone-view,table.wc-shipping-zones .editing .wc-shipping-zone-edit,table.wc-shipping-zones .editing .wc-shipping-zone-view{display:none}.wc-modal-shipping-method-settings{background:#f8f8f8;padding:1em!important}.wc-modal-shipping-method-settings form .form-table{width:100%;background:#fff;margin:0 0 1.5em}.wc-modal-shipping-method-settings form .form-table tr th{width:30%;position:relative}.wc-modal-shipping-method-settings form .form-table tr th .woocommerce-help-tip{float:right;margin:-8px -.5em 0 0;vertical-align:middle;right:0;top:50%;position:absolute}.wc-modal-shipping-method-settings form .form-table tr td input,.wc-modal-shipping-method-settings form .form-table tr td select,.wc-modal-shipping-method-settings form .form-table tr td textarea{width:50%;min-width:250px}.wc-modal-shipping-method-settings form .form-table tr td input[type=checkbox]{width:auto;min-width:16px}.wc-modal-shipping-method-settings form .form-table tr td,.wc-modal-shipping-method-settings form .form-table tr th{vertical-align:middle;margin:0;line-height:24px;padding:1em;border-bottom:1px solid #f8f8f8}.wc-modal-shipping-method-settings form .form-table:last-of-type{margin-bottom:0}.wc-backbone-modal .wc-shipping-zone-method-selector p{margin-top:0}.wc-backbone-modal .wc-shipping-zone-method-selector .wc-shipping-zone-method-description{margin:.75em 1px 0;line-height:1.5em;color:#999;font-style:italic}.wc-backbone-modal .wc-shipping-zone-method-selector select{width:100%;cursor:pointer}img.help_tip{margin:0 0 0 9px;vertical-align:middle}.postbox img.help_tip{margin-top:0}.postbox .woocommerce-help-tip{margin:0 0 0 9px}.status-disabled,.status-enabled,.status-manual{font-size:1.4em;display:block;text-indent:-9999px;position:relative;height:1em;width:1em}.status-disabled:before,.status-enabled:before,.status-manual:before{font-family:WooCommerce;line-height:1;margin:0;position:absolute;width:100%;height:100%;text-indent:0;top:0;font-variant:normal;-webkit-font-smoothing:antialiased;font-weight:400;text-align:center;left:0;speak:none;text-transform:none}.status-manual:before{content:"";color:#999}.status-enabled:before{content:"";color:#a46497}.status-disabled:before{content:"";color:#ccc}.woocommerce h2.woo-nav-tab-wrapper{margin-bottom:1em}.woocommerce nav.woo-nav-tab-wrapper{margin:1.5em 0 1em;border-bottom:1px solid #ccc}.woocommerce .subsubsub{margin:-8px 0 0}.woocommerce .wc-admin-breadcrumb{margin-left:.5em}.woocommerce .wc-admin-breadcrumb a{color:#a46497}.woocommerce #template div{margin:0}.woocommerce #template div p .button{float:right;margin-left:10px;margin-top:-4px}.woocommerce #template div .editor textarea{margin-bottom:8px}.woocommerce textarea[disabled=disabled]{background:#DFDFDF!important}.woocommerce table.form-table{margin:0;position:relative}.woocommerce table.form-table .forminp-radio ul{margin:0}.woocommerce table.form-table .forminp-radio ul li{line-height:1.4em}.woocommerce table.form-table textarea.input-text{height:100%;min-width:150px;display:block}.woocommerce table.form-table input.regular-input{width:25em}.woocommerce table.form-table textarea.wide-input{width:100%}.woocommerce table.form-table .woocommerce-help-tip,.woocommerce table.form-table img.help_tip{padding:0;margin:-4px 0 0 5px;vertical-align:middle;cursor:help;line-height:1}.woocommerce table.form-table span.help_tip{cursor:help;color:#2ea2cc}.woocommerce table.form-table th{position:relative;padding-right:24px}.woocommerce table.form-table .select2-container{display:block;max-width:350px;vertical-align:top;margin-bottom:3px}.woocommerce table.form-table table.widefat th{padding-right:inherit}.woocommerce table.form-table th .woocommerce-help-tip,.woocommerce table.form-table th img.help_tip{margin:0 -24px 0 0;float:right}.woocommerce table.form-table .wp-list-table .woocommerce-help-tip{float:none}.woocommerce table.form-table fieldset{margin-top:4px}.woocommerce table.form-table fieldset .woocommerce-help-tip,.woocommerce table.form-table fieldset img.help_tip{margin:-3px 0 0 5px}.woocommerce table.form-table fieldset p.description{margin-bottom:8px}.woocommerce table.form-table fieldset:first-child{margin-top:0}.woocommerce table.form-table .iris-picker{z-index:100;display:none;position:absolute;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.2)}.woocommerce table.form-table .iris-picker .ui-slider{border:0!important;margin:0!important;width:auto!important;height:auto!important;background:none!important}.woocommerce table.form-table .iris-picker .ui-slider .ui-slider-handle{margin-bottom:0!important}.woocommerce table.form-table .colorpickpreview{padding:3px 3px 3px 20px;border:1px solid #ddd;border-right:0}.woocommerce table.form-table .colorpick{border-left:0}.woocommerce table.form-table .image_width_settings{vertical-align:middle}.woocommerce table.form-table .image_width_settings label{margin-left:10px}.woocommerce table.form-table .wc_emails_wrapper{padding:0 15px 10px 0}.woocommerce #tabs-wrap table a.remove{margin-left:4px}.woocommerce #tabs-wrap table p{margin:0 0 4px!important;overflow:hidden;zoom:1}.woocommerce #tabs-wrap table p a.add{float:left}#wp-excerpt-editor-container{background:#fff}#product_variation-parent #parent_id{width:100%}#postimagediv img{border:1px solid #d5d5d5;max-width:100%}#woocommerce-product-images .inside{margin:0;padding:0}#woocommerce-product-images .inside .add_product_images{padding:0 12px 12px}#woocommerce-product-images .inside #product_images_container{padding:0 0 0 9px}#woocommerce-product-images .inside #product_images_container ul{margin:0;padding:0}#woocommerce-product-images .inside #product_images_container ul:after,#woocommerce-product-images .inside #product_images_container ul:before{content:" ";display:table}#woocommerce-product-images .inside #product_images_container ul:after{clear:both}#woocommerce-product-images .inside #product_images_container ul li.add,#woocommerce-product-images .inside #product_images_container ul li.image,#woocommerce-product-images .inside #product_images_container ul li.wc-metabox-sortable-placeholder{width:80px;float:left;cursor:move;border:1px solid #d5d5d5;margin:9px 9px 0 0;background:#f7f7f7;border-radius:2px;position:relative;box-sizing:border-box}#woocommerce-product-images .inside #product_images_container ul li.add img,#woocommerce-product-images .inside #product_images_container ul li.image img,#woocommerce-product-images .inside #product_images_container ul li.wc-metabox-sortable-placeholder img{width:100%;height:auto;display:block}#woocommerce-product-images .inside #product_images_container ul li.wc-metabox-sortable-placeholder{border:3px dashed #ddd;position:relative}#woocommerce-product-images .inside #product_images_container ul li.wc-metabox-sortable-placeholder:after{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";font-size:2.618em;line-height:72px;color:#ddd}#woocommerce-product-images .inside #product_images_container ul ul.actions{position:absolute;top:-8px;right:-8px;padding:2px;display:none}#woocommerce-product-images .inside #product_images_container ul ul.actions li{float:right;margin:0 0 0 2px}#woocommerce-product-images .inside #product_images_container ul ul.actions li a{width:1em;margin:0;height:0;display:block;overflow:hidden}#woocommerce-product-images .inside #product_images_container ul ul.actions li a.tips{cursor:pointer}#woocommerce-product-images .inside #product_images_container ul ul.actions li a.delete{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;font-size:1.4em}#woocommerce-product-images .inside #product_images_container ul ul.actions li a.delete:before{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";color:#999}#woocommerce-product-images .inside #product_images_container ul ul.actions li a.delete:hover:before{color:#a00}#woocommerce-product-images .inside #product_images_container ul li:hover ul.actions{display:block}#woocommerce-product-data .hndle{padding:10px}#woocommerce-product-data .hndle span{display:block;vertical-align:middle;line-height:24px}#woocommerce-product-data .hndle span span{display:inline;line-height:inherit;vertical-align:baseline}#woocommerce-product-data .hndle label{padding-right:1em;font-size:12px;vertical-align:baseline}#woocommerce-product-data .hndle label:first-child{margin-right:1em;border-right:1px solid #dfdfdf}#woocommerce-product-data .hndle input,#woocommerce-product-data .hndle select{margin:-3px 0 0 .5em;vertical-align:middle}#woocommerce-product-data>.handlediv{margin-top:4px}#woocommerce-product-data .wrap{margin:0}#woocommerce-coupon-description{padding:3px 8px;font-size:1.7em;line-height:1.42em;height:auto;width:100%;outline:0;margin:10px 0;display:block}#woocommerce-coupon-description::-webkit-input-placeholder{line-height:1.42em;color:#bbb}#woocommerce-coupon-description::-moz-placeholder{line-height:1.42em;color:#bbb}#woocommerce-coupon-description:-ms-input-placeholder{line-height:1.42em;color:#bbb}#woocommerce-coupon-description:-moz-placeholder{line-height:1.42em;color:#bbb}#woocommerce-coupon-data .panel-wrap,#woocommerce-product-data .panel-wrap{background:#fff}#woocommerce-coupon-data .wc-metaboxes-wrapper,#woocommerce-coupon-data .woocommerce_options_panel,#woocommerce-product-data .wc-metaboxes-wrapper,#woocommerce-product-data .woocommerce_options_panel{float:left;width:80%}#woocommerce-coupon-data .wc-metaboxes-wrapper .wc-radios,#woocommerce-coupon-data .woocommerce_options_panel .wc-radios,#woocommerce-product-data .wc-metaboxes-wrapper .wc-radios,#woocommerce-product-data .woocommerce_options_panel .wc-radios{display:block;float:left;margin:0}#woocommerce-coupon-data .wc-metaboxes-wrapper .wc-radios li,#woocommerce-coupon-data .woocommerce_options_panel .wc-radios li,#woocommerce-product-data .wc-metaboxes-wrapper .wc-radios li,#woocommerce-product-data .woocommerce_options_panel .wc-radios li{display:block;padding:0 0 10px}#woocommerce-coupon-data .wc-metaboxes-wrapper .wc-radios li input,#woocommerce-coupon-data .woocommerce_options_panel .wc-radios li input,#woocommerce-product-data .wc-metaboxes-wrapper .wc-radios li input,#woocommerce-product-data .woocommerce_options_panel .wc-radios li input{width:auto}#woocommerce-coupon-data .panel-wrap,#woocommerce-product-data .panel-wrap,.woocommerce .panel-wrap{overflow:hidden}#woocommerce-coupon-data ul.wc-tabs,#woocommerce-product-data ul.wc-tabs,.woocommerce ul.wc-tabs{margin:0;width:20%;float:left;line-height:1em;padding:0 0 10px;position:relative;background-color:#fafafa;border-right:1px solid #eee;box-sizing:border-box}#woocommerce-coupon-data ul.wc-tabs:after,#woocommerce-product-data ul.wc-tabs:after,.woocommerce ul.wc-tabs:after{content:"";display:block;width:100%;height:9999em;position:absolute;bottom:-9999em;left:0;background-color:#fafafa;border-right:1px solid #eee}#woocommerce-coupon-data ul.wc-tabs li,#woocommerce-product-data ul.wc-tabs li,.woocommerce ul.wc-tabs li{margin:0;padding:0;display:block;position:relative}#woocommerce-coupon-data ul.wc-tabs li a,#woocommerce-product-data ul.wc-tabs li a,.woocommerce ul.wc-tabs li a{margin:0;padding:10px;display:block;box-shadow:none;text-decoration:none;line-height:20px!important;border-bottom:1px solid #eee}#woocommerce-coupon-data ul.wc-tabs li a:before,#woocommerce-product-data ul.wc-tabs li a:before,.woocommerce ul.wc-tabs li a:before{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-right:.618em;content:"";text-decoration:none}#woocommerce-coupon-data ul.wc-tabs li.general_options a:before,#woocommerce-product-data ul.wc-tabs li.general_options a:before,.woocommerce ul.wc-tabs li.general_options a:before{content:"\f107"}#woocommerce-coupon-data ul.wc-tabs li.inventory_options a:before,#woocommerce-product-data ul.wc-tabs li.inventory_options a:before,.woocommerce ul.wc-tabs li.inventory_options a:before{content:"\f481"}#woocommerce-coupon-data ul.wc-tabs li.shipping_options a:before,#woocommerce-product-data ul.wc-tabs li.shipping_options a:before,.woocommerce ul.wc-tabs li.shipping_options a:before{font-family:WooCommerce;content:"\e01a"}#woocommerce-coupon-data ul.wc-tabs li.linked_product_options a:before,#woocommerce-product-data ul.wc-tabs li.linked_product_options a:before,.woocommerce ul.wc-tabs li.linked_product_options a:before{content:"\f103"}#woocommerce-coupon-data ul.wc-tabs li.attribute_options a:before,#woocommerce-product-data ul.wc-tabs li.attribute_options a:before,.woocommerce ul.wc-tabs li.attribute_options a:before{content:"\f175"}#woocommerce-coupon-data ul.wc-tabs li.advanced_options a:before,#woocommerce-product-data ul.wc-tabs li.advanced_options a:before,.woocommerce ul.wc-tabs li.advanced_options a:before{font-family:Dashicons;content:"\f111"}#woocommerce-coupon-data ul.wc-tabs li.variations_options a:before,#woocommerce-product-data ul.wc-tabs li.variations_options a:before,.woocommerce ul.wc-tabs li.variations_options a:before{content:"\f509"}#woocommerce-coupon-data ul.wc-tabs li.usage_restriction_options a:before,#woocommerce-product-data ul.wc-tabs li.usage_restriction_options a:before,.woocommerce ul.wc-tabs li.usage_restriction_options a:before{font-family:WooCommerce;content:"\e602"}#woocommerce-coupon-data ul.wc-tabs li.usage_limit_options a:before,#woocommerce-product-data ul.wc-tabs li.usage_limit_options a:before,.woocommerce ul.wc-tabs li.usage_limit_options a:before{font-family:WooCommerce;content:"\e601"}#woocommerce-coupon-data ul.wc-tabs li.general_coupon_data a:before,#woocommerce-product-data ul.wc-tabs li.general_coupon_data a:before,.woocommerce ul.wc-tabs li.general_coupon_data a:before{font-family:WooCommerce;content:"\e600"}#woocommerce-coupon-data ul.wc-tabs li.active a,#woocommerce-product-data ul.wc-tabs li.active a,.woocommerce ul.wc-tabs li.active a{color:#555;position:relative;background-color:#eee}.woocommerce_page_wc-settings .shippingrows th.check-column{padding-top:20px}.woocommerce_page_wc-settings .shippingrows tfoot th{padding-left:10px}.woocommerce_page_wc-settings .shippingrows .add.button:before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-right:.618em;content:"";text-decoration:none}.woocommerce_page_wc-settings h3.wc-settings-sub-title{font-size:1.2em}#woocommerce-coupon-data .inside,#woocommerce-order-data .inside,#woocommerce-order-downloads .inside,#woocommerce-product-data .inside,#woocommerce-product-type-options .inside{margin:0;padding:0}.panel,.woocommerce_options_panel{padding:9px;color:#555}.panel .form-field .woocommerce-help-tip,.woocommerce_options_panel .form-field .woocommerce-help-tip{font-size:1.4em}.panel,.woocommerce_page_settings .woocommerce_options_panel{padding:0}#woocommerce-product-specs .inside,#woocommerce-product-type-options .panel{margin:0;padding:9px}#woocommerce-product-type-options .panel p,.woocommerce_options_panel fieldset.form-field,.woocommerce_options_panel p{margin:0 0 9px;font-size:12px;padding:5px 9px;line-height:24px}#woocommerce-product-type-options .panel p:after,.woocommerce_options_panel fieldset.form-field:after,.woocommerce_options_panel p:after{content:".";display:block;height:0;clear:both;visibility:hidden}.woocommerce_options_panel .checkbox,.woocommerce_variable_attributes .checkbox{width:auto;margin:3px 0;vertical-align:middle}.woocommerce_options_panel .downloadable_files table,.woocommerce_variations .downloadable_files table{width:100%;padding:0!important}.woocommerce_options_panel .downloadable_files table th,.woocommerce_variations .downloadable_files table th{padding:7px 0 7px 7px!important}.woocommerce_options_panel .downloadable_files table th.sort,.woocommerce_variations .downloadable_files table th.sort{width:17px;padding:7px!important}.woocommerce_options_panel .downloadable_files table th .woocommerce-help-tip,.woocommerce_variations .downloadable_files table th .woocommerce-help-tip{font-size:1.1em;margin-left:0}.woocommerce_options_panel .downloadable_files table td,.woocommerce_variations .downloadable_files table td{vertical-align:middle!important;padding:4px 0 4px 7px!important;position:relative}.woocommerce_options_panel .downloadable_files table td:last-child,.woocommerce_variations .downloadable_files table td:last-child{padding-right:7px!important}.woocommerce_options_panel .downloadable_files table td input.input_text,.woocommerce_variations .downloadable_files table td input.input_text{width:100%;float:none;min-width:0;margin:1px 0}.woocommerce_options_panel .downloadable_files table td .upload_file_button,.woocommerce_variations .downloadable_files table td .upload_file_button{width:auto;float:right;cursor:pointer}.woocommerce_options_panel .downloadable_files table td .delete,.woocommerce_variations .downloadable_files table td .delete{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;font-size:1.2em}.woocommerce_options_panel .downloadable_files table td .delete:before,.woocommerce_variations .downloadable_files table td .delete:before{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";color:#999}.woocommerce_options_panel .downloadable_files table td .delete:hover:before,.woocommerce_variations .downloadable_files table td .delete:hover:before{color:#a00}.woocommerce_options_panel .downloadable_files table td.sort,.woocommerce_variations .downloadable_files table td.sort{width:17px;cursor:move;font-size:15px;text-align:center;background:#f9f9f9;padding-right:7px!important}.woocommerce_options_panel .downloadable_files table td.sort:before,.woocommerce_variations .downloadable_files table td.sort:before{content:"\f333";font-family:Dashicons;text-align:center;line-height:1;color:#999;display:block;width:17px;float:left;height:100%}.woocommerce_options_panel .downloadable_files table td.sort:hover:before,.woocommerce_variations .downloadable_files table td.sort:hover:before{color:#333}.woocommerce_variation h3 .sort{width:17px;height:26px;cursor:move;float:right;font-size:15px;font-weight:400;margin-right:.5em;visibility:hidden;text-align:center;vertical-align:middle}.woocommerce_variation h3 .sort:before{content:"\f333";font-family:Dashicons;text-align:center;line-height:28px;color:#999;display:block;width:17px;float:left;height:100%}.woocommerce_variation h3 .sort:hover:before{color:#777}.woocommerce_variation h3:hover .sort,.woocommerce_variation.ui-sortable-helper .sort{visibility:visible}.woocommerce_options_panel{min-height:175px;box-sizing:border-box}.woocommerce_options_panel .downloadable_files{padding:0 9px 0 162px;position:relative;margin:9px 0}.woocommerce_options_panel .downloadable_files label{position:absolute;left:0;margin:0 0 0 12px;line-height:24px}.woocommerce_options_panel p{margin:9px 0}.woocommerce_options_panel fieldset.form-field,.woocommerce_options_panel p.form-field{padding:5px 20px 5px 162px!important}.woocommerce_options_panel .sale_price_dates_fields .short:first-of-type{margin-bottom:1em}.woocommerce_options_panel .sale_price_dates_fields .short:nth-of-type(2){clear:left}.woocommerce_options_panel label,.woocommerce_options_panel legend{float:left;width:150px;padding:0;margin:0 0 0 -150px}.woocommerce_options_panel label .req,.woocommerce_options_panel legend .req{font-weight:700;font-style:normal;color:#a00}.woocommerce_options_panel .description{padding:0;margin:0 0 0 7px;clear:none;display:inline}.woocommerce_options_panel .description-block{margin-left:0;display:block}.woocommerce_options_panel input,.woocommerce_options_panel select,.woocommerce_options_panel textarea{margin:0}.woocommerce_options_panel textarea{height:3.5em;line-height:1.5em;vertical-align:top}.woocommerce_options_panel input[type=text],.woocommerce_options_panel input[type=number],.woocommerce_options_panel input[type=email],.woocommerce_options_panel input[type=password]{width:50%;float:left}.woocommerce_options_panel input.button{width:auto;margin-left:8px}.woocommerce_options_panel select{float:left}.woocommerce_options_panel .short,.woocommerce_options_panel input[type=text].short,.woocommerce_options_panel input[type=number].short,.woocommerce_options_panel input[type=email].short,.woocommerce_options_panel input[type=password].short{width:50%}.woocommerce_options_panel .sized{width:auto!important;margin-right:6px}.woocommerce_options_panel .options_group{border-top:1px solid #fff;border-bottom:1px solid #eee}.woocommerce_options_panel .options_group:first-child{border-top:0}.woocommerce_options_panel .options_group:last-child{border-bottom:0}.woocommerce_options_panel .options_group fieldset{margin:9px 0;font-size:12px;padding:5px 9px;line-height:24px}.woocommerce_options_panel .options_group fieldset label{width:auto;float:none}.woocommerce_options_panel .options_group fieldset ul{float:left;width:50%;margin:0;padding:0}.woocommerce_options_panel .options_group fieldset ul li{margin:0;width:auto}.woocommerce_options_panel .options_group fieldset ul li input{width:auto;float:none;margin-right:4px}.woocommerce_options_panel .options_group fieldset ul.wc-radios label{margin-left:0}.woocommerce_options_panel .dimensions_field .wrap{display:block;width:50%}.woocommerce_options_panel .dimensions_field .wrap input{width:30.75%;margin-right:3.8%}.woocommerce_options_panel .dimensions_field .wrap .last{margin-right:0}.woocommerce_options_panel.padded{padding:1em}#woocommerce-product-data input.dp-applied,.woocommerce_options_panel .select2-container{float:left}#grouped_product_options,#simple_product_options,#virtual_product_options{padding:12px;font-style:italic;color:#666}.wc-metaboxes-wrapper .toolbar{margin:0!important;border-top:1px solid #fff;border-bottom:1px solid #eee;padding:9px 12px!important}.wc-metaboxes-wrapper .toolbar:first-child{border-top:0}.wc-metaboxes-wrapper .toolbar:last-child{border-bottom:0}.wc-metaboxes-wrapper .toolbar .add_variation{float:right;margin-left:5px}.wc-metaboxes-wrapper .toolbar .cancel-variation-changes,.wc-metaboxes-wrapper .toolbar .save-variation-changes{float:left;margin-right:5px}.wc-metaboxes-wrapper p.toolbar{overflow:hidden;zoom:1}.wc-metaboxes-wrapper .expand-close{margin-right:2px;color:#777;font-size:12px;font-style:italic}.wc-metaboxes-wrapper .expand-close a{background:0 0;padding:0;font-size:12px;text-decoration:none}.wc-metaboxes-wrapper#product_attributes .expand-close{float:right;line-height:28px}.wc-metaboxes-wrapper .fr,.wc-metaboxes-wrapper button.add_variable_attribute{float:right;margin:0 0 0 6px}.wc-metaboxes-wrapper .wc-metaboxes{border-bottom:1px solid #eee}.wc-metaboxes-wrapper .wc-metabox-sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;margin-bottom:9px;border-width:1px;border-style:dashed}.wc-metaboxes-wrapper .wc-metabox{background:#fff;border-bottom:1px solid #eee;margin:0!important}.wc-metaboxes-wrapper .wc-metabox select{font-weight:400}.wc-metaboxes-wrapper .wc-metabox:last-of-type{border-bottom:0}.wc-metaboxes-wrapper .wc-metabox .handlediv{width:27px}.wc-metaboxes-wrapper .wc-metabox .handlediv:before{content:"\f142"!important;cursor:pointer;display:inline-block;font:400 20px/1 Dashicons;line-height:.5!important;padding:8px 10px;position:relative;right:12px;top:0}.wc-metaboxes-wrapper .wc-metabox.closed{border-radius:3px}.wc-metaboxes-wrapper .wc-metabox.closed .handlediv:before{content:"\f140"!important}.wc-metaboxes-wrapper .wc-metabox.closed h3{border:0}.wc-metaboxes-wrapper .wc-metabox h3{margin:0!important;padding:.75em .75em .75em 1em!important;font-size:1em!important;overflow:hidden;zoom:1;cursor:move}.wc-metaboxes-wrapper .wc-metabox h3 a.delete,.wc-metaboxes-wrapper .wc-metabox h3 button{float:right}.wc-metaboxes-wrapper .wc-metabox h3 a.delete{color:red;font-weight:400;line-height:26px;text-decoration:none;position:relative;visibility:hidden}.wc-metaboxes-wrapper .wc-metabox h3 strong{line-height:26px;font-weight:700}.wc-metaboxes-wrapper .wc-metabox h3 select{font-family:sans-serif;max-width:20%;margin:.25em .25em .25em 0}.wc-metaboxes-wrapper .wc-metabox h3 .handlediv{background-position:6px 5px!important;visibility:hidden;height:26px}.wc-metaboxes-wrapper .wc-metabox h3.fixed{cursor:pointer!important}.wc-metaboxes-wrapper .wc-metabox.woocommerce_variation h3{cursor:pointer;padding:.5em .75em .5em 1em!important}.wc-metaboxes-wrapper .wc-metabox.woocommerce_variation h3 .handlediv,.wc-metaboxes-wrapper .wc-metabox.woocommerce_variation h3 .sort,.wc-metaboxes-wrapper .wc-metabox.woocommerce_variation h3 a.delete{margin-top:.25em}.wc-metaboxes-wrapper .wc-metabox h3:hover .handlediv,.wc-metaboxes-wrapper .wc-metabox h3:hover a.delete,.wc-metaboxes-wrapper .wc-metabox.ui-sortable-helper .handlediv,.wc-metaboxes-wrapper .wc-metabox.ui-sortable-helper a.delete{visibility:visible}.wc-metaboxes-wrapper .wc-metabox table{width:100%;position:relative;background-color:#fdfdfd;padding:1em;border-top:1px solid #eee}.wc-metaboxes-wrapper .wc-metabox table td{text-align:left;padding:0 6px 1em 0;vertical-align:top;border:0}.wc-metaboxes-wrapper .wc-metabox table td label{text-align:left;display:block;line-height:21px}.wc-metaboxes-wrapper .wc-metabox table td input{float:left;min-width:200px}.wc-metaboxes-wrapper .wc-metabox table td input,.wc-metaboxes-wrapper .wc-metabox table td textarea{width:100%;margin:0;display:block;font-size:14px;padding:4px;color:#555}.wc-metaboxes-wrapper .wc-metabox table td .select2-container,.wc-metaboxes-wrapper .wc-metabox table td select{width:100%!important}.wc-metaboxes-wrapper .wc-metabox table td input.short{width:200px}.wc-metaboxes-wrapper .wc-metabox table td input.checkbox{width:16px;min-width:inherit;vertical-align:text-bottom;display:inline-block;float:none}.wc-metaboxes-wrapper .wc-metabox table td.attribute_name{width:200px}.wc-metaboxes-wrapper .wc-metabox table .minus,.wc-metaboxes-wrapper .wc-metabox table .plus{margin-top:6px}.wc-metaboxes-wrapper .wc-metabox table .fl{float:left}.wc-metaboxes-wrapper .wc-metabox table .fr{float:right}.variations-pagenav{float:right;line-height:24px}.variations-pagenav .displaying-num{color:#777;font-size:12px;font-style:italic}.variations-pagenav a{padding:0 10px 3px;background:rgba(0,0,0,.05);font-size:16px;font-weight:400;text-decoration:none}.variations-pagenav a.disabled,.variations-pagenav a.disabled:active,.variations-pagenav a.disabled:focus,.variations-pagenav a.disabled:hover{color:#A0A5AA;background:rgba(0,0,0,.05)}.variations-defaults{float:left}.variations-defaults select{margin:.25em .25em .25em 0}.woocommerce_variable_attributes{background-color:#fdfdfd;border-top:1px solid #eee}.woocommerce_variable_attributes .data{padding:1em 2em}.woocommerce_variable_attributes .data:after,.woocommerce_variable_attributes .data:before{content:" ";display:table}.woocommerce_variable_attributes .data:after{clear:both}.woocommerce_variable_attributes .upload_image_button{display:block;width:48px;height:48px;float:left;margin-right:20px;position:relative;cursor:pointer}.woocommerce_variable_attributes .upload_image_button img{width:100%;height:auto;display:none}.woocommerce_variable_attributes .upload_image_button:before{content:"\f128";font-family:Dashicons;position:absolute;top:0;left:0;right:0;bottom:0;text-align:center;line-height:48px;font-size:48px;font-weight:400;-webkit-font-smoothing:antialiased}.woocommerce_variable_attributes .upload_image_button.remove img{display:block}.woocommerce_variable_attributes .upload_image_button.remove:before{content:"\f335";display:none}.woocommerce_variable_attributes .upload_image_button.remove:hover:before{display:block}.woocommerce_variable_attributes .options{border:1px solid #eee;border-width:1px 0;padding:.25em 0}.woocommerce_variable_attributes .options label{display:inline-block;padding:4px 1em 2px 0}.woocommerce_variable_attributes .options input[type=checkbox]{margin-top:5px;margin-right:3px}.form-row label{display:block}.form-row input[type=number],.form-row input[type=text],.form-row select{width:100%}.form-row.dimensions_field input{width:25%;float:left;margin-right:1%}.form-row.dimensions_field input:last-of-type{margin-right:0}.form-row-first,.form-row-last{width:48%;float:right}.form-row-first{clear:both;float:left}.form-row-full{clear:both}.tips{cursor:help;text-decoration:none}img.tips{padding:5px 0 0}#tiptip_holder{display:none;position:absolute;top:0;left:0;z-index:9999999}#tiptip_holder.tip_top{padding-bottom:5px}#tiptip_holder.tip_top #tiptip_arrow_inner{margin-top:-7px;margin-left:-6px;border-top-color:#333}#tiptip_holder.tip_bottom{padding-top:5px}#tiptip_holder.tip_bottom #tiptip_arrow_inner{margin-top:-5px;margin-left:-6px;border-bottom-color:#333}#tiptip_holder.tip_right{padding-left:5px}#tiptip_holder.tip_right #tiptip_arrow_inner{margin-top:-6px;margin-left:-5px;border-right-color:#333}#tiptip_holder.tip_left{padding-right:5px}#tiptip_holder.tip_left #tiptip_arrow_inner{margin-top:-6px;margin-left:-7px;border-left-color:#333}#tiptip_content,.chart-tooltip,.wc_error_tip{color:#fff;font-size:.8em;max-width:150px;background:#333;text-align:center;border-radius:3px;padding:.618em 1em;box-shadow:0 1px 3px rgba(0,0,0,.2)}#tiptip_content code,.chart-tooltip code,.wc_error_tip code{padding:1px;background:#888}#tiptip_arrow,#tiptip_arrow_inner{position:absolute;border-color:transparent;border-style:solid;border-width:6px;height:0;width:0}.wc_error_tip{max-width:20em;line-height:1.8em;position:absolute;white-space:normal;background:#d82223;margin:1.5em 1px 0 -1em;z-index:9999999}.wc_error_tip:after{content:"";display:block;border:8px solid #d82223;border-right-color:transparent;border-left-color:transparent;border-top-color:transparent;position:absolute;top:-3px;left:50%;margin:-1em 0 0 -3px}img.ui-datepicker-trigger{vertical-align:middle;margin-top:-1px;cursor:pointer}.wc-metabox-content img.ui-datepicker-trigger,.woocommerce_options_panel img.ui-datepicker-trigger{float:left;margin-right:8px;margin-top:4px;margin-left:4px}#ui-datepicker-div{display:none}.woocommerce-reports-wide.woocommerce-reports-wrap,.woocommerce-reports-wrap.woocommerce-reports-wrap{margin-left:300px;padding-top:18px}.woocommerce-reports-wide.halved,.woocommerce-reports-wrap.halved{margin:0;overflow:hidden;zoom:1}.woocommerce-reports-wide .widefat td,.woocommerce-reports-wrap .widefat td{vertical-align:top;padding:7px}.woocommerce-reports-wide .widefat td .description,.woocommerce-reports-wrap .widefat td .description{margin:4px 0 0}.woocommerce-reports-wide .postbox:after,.woocommerce-reports-wrap .postbox:after{content:".";display:block;height:0;clear:both;visibility:hidden}.woocommerce-reports-wide .postbox h3,.woocommerce-reports-wrap .postbox h3{cursor:default!important}.woocommerce-reports-wide .postbox .inside,.woocommerce-reports-wrap .postbox .inside{padding:10px;margin:0!important}.woocommerce-reports-wide .postbox div.stats_range,.woocommerce-reports-wide .postbox h3.stats_range,.woocommerce-reports-wrap .postbox div.stats_range,.woocommerce-reports-wrap .postbox h3.stats_range{border-bottom-color:#dfdfdf;margin:0;padding:0!important}.woocommerce-reports-wide .postbox div.stats_range .export_csv,.woocommerce-reports-wide .postbox h3.stats_range .export_csv,.woocommerce-reports-wrap .postbox div.stats_range .export_csv,.woocommerce-reports-wrap .postbox h3.stats_range .export_csv{float:right;line-height:26px;border-left:1px solid #dfdfdf;padding:10px;display:block;text-decoration:none}.woocommerce-reports-wide .postbox div.stats_range .export_csv:before,.woocommerce-reports-wide .postbox h3.stats_range .export_csv:before,.woocommerce-reports-wrap .postbox div.stats_range .export_csv:before,.woocommerce-reports-wrap .postbox h3.stats_range .export_csv:before{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;content:"";text-decoration:none;margin-right:4px}.woocommerce-reports-wide .postbox div.stats_range ul,.woocommerce-reports-wide .postbox h3.stats_range ul,.woocommerce-reports-wrap .postbox div.stats_range ul,.woocommerce-reports-wrap .postbox h3.stats_range ul{list-style:none;margin:0;padding:0;zoom:1;background:#f5f5f5;border-bottom:1px solid #ccc}.woocommerce-reports-wide .postbox div.stats_range ul:after,.woocommerce-reports-wide .postbox div.stats_range ul:before,.woocommerce-reports-wide .postbox h3.stats_range ul:after,.woocommerce-reports-wide .postbox h3.stats_range ul:before,.woocommerce-reports-wrap .postbox div.stats_range ul:after,.woocommerce-reports-wrap .postbox div.stats_range ul:before,.woocommerce-reports-wrap .postbox h3.stats_range ul:after,.woocommerce-reports-wrap .postbox h3.stats_range ul:before{content:" ";display:table}.woocommerce-reports-wide .postbox div.stats_range ul:after,.woocommerce-reports-wide .postbox h3.stats_range ul:after,.woocommerce-reports-wrap .postbox div.stats_range ul:after,.woocommerce-reports-wrap .postbox h3.stats_range ul:after{clear:both}.woocommerce-reports-wide .postbox div.stats_range ul li,.woocommerce-reports-wide .postbox h3.stats_range ul li,.woocommerce-reports-wrap .postbox div.stats_range ul li,.woocommerce-reports-wrap .postbox h3.stats_range ul li{float:left;margin:0;padding:0;line-height:26px;font-weight:700;font-size:14px}.woocommerce-reports-wide .postbox div.stats_range ul li a,.woocommerce-reports-wide .postbox h3.stats_range ul li a,.woocommerce-reports-wrap .postbox div.stats_range ul li a,.woocommerce-reports-wrap .postbox h3.stats_range ul li a{border-right:1px solid #dfdfdf;padding:10px;display:block;text-decoration:none}.woocommerce-reports-wide .postbox div.stats_range ul li.active,.woocommerce-reports-wide .postbox h3.stats_range ul li.active,.woocommerce-reports-wrap .postbox div.stats_range ul li.active,.woocommerce-reports-wrap .postbox h3.stats_range ul li.active{background:#fff;-webkit-box-shadow:0 4px 0 0 #fff;box-shadow:0 4px 0 0 #fff}.woocommerce-reports-wide .postbox div.stats_range ul li.active a,.woocommerce-reports-wide .postbox h3.stats_range ul li.active a,.woocommerce-reports-wrap .postbox div.stats_range ul li.active a,.woocommerce-reports-wrap .postbox h3.stats_range ul li.active a{color:#777}.woocommerce-reports-wide .postbox div.stats_range ul li.custom,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom,.woocommerce-reports-wrap .postbox div.stats_range ul li.custom,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom{padding:9px 10px;vertical-align:middle}.woocommerce-reports-wide .postbox div.stats_range ul li.custom div,.woocommerce-reports-wide .postbox div.stats_range ul li.custom form,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom div,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom form,.woocommerce-reports-wrap .postbox div.stats_range ul li.custom div,.woocommerce-reports-wrap .postbox div.stats_range ul li.custom form,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom div,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom form{display:inline;margin:0}.woocommerce-reports-wide .postbox div.stats_range ul li.custom div input.range_datepicker,.woocommerce-reports-wide .postbox div.stats_range ul li.custom form input.range_datepicker,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom div input.range_datepicker,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom form input.range_datepicker,.woocommerce-reports-wrap .postbox div.stats_range ul li.custom div input.range_datepicker,.woocommerce-reports-wrap .postbox div.stats_range ul li.custom form input.range_datepicker,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom div input.range_datepicker,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom form input.range_datepicker{padding:0;margin:0 10px 0 0;background:0 0;border:0;color:#777;text-align:center;-webkit-box-shadow:none;box-shadow:none}.woocommerce-reports-wide .postbox .chart-with-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar{padding:12px 12px 12px 249px;margin:0!important}.woocommerce-reports-wide .postbox .chart-with-sidebar .chart-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar .chart-sidebar{width:225px;margin-left:-237px;float:left}.woocommerce-reports-wide .postbox .chart-widgets,.woocommerce-reports-wrap .postbox .chart-widgets{margin:0;padding:0}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget{margin:0 0 1em;background:#fafafa;border:1px solid #dfdfdf}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget:after,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget:after{content:".";display:block;height:0;clear:both;visibility:hidden}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget h4,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget h4{background:#fff;border:1px solid #dfdfdf;border-left-width:0;border-right-width:0;padding:10px;margin:0;color:#2ea2cc;border-top-width:0;background-image:-webkit-gradient(linear,left bottom,left top,from(#ececec),to(#f9f9f9));background-image:-webkit-linear-gradient(bottom,#ececec,#f9f9f9);background-image:-moz-linear-gradient(bottom,#ececec,#f9f9f9);background-image:-o-linear-gradient(bottom,#ececec,#f9f9f9);background-image:linear-gradient(to top,#ececec,#f9f9f9)}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget table td.count,.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget table tr.active td,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget table td.count,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget table tr.active td{background:#f5f5f5}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget h4.section_title:hover,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget h4.section_title:hover{color:#a00}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .section_title,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .section_title{cursor:pointer}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .section_title span,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .section_title span{display:block}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .section_title span:after,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .section_title span:after{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin-left:.618em;content:"";text-decoration:none;float:right;font-size:.9em;line-height:1.618}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .section_title.open,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .section_title.open{color:#333}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .section_title.open span:after,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .section_title.open span:after{display:none}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .section,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .section{border-bottom:1px solid #dfdfdf}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .section .select2-container,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .section .select2-container{width:100%!important}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .section:last-of-type,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .section:last-of-type{border-radius:0 0 3px 3px}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget table,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget table{width:100%}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget table td,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget table td{padding:7px 10px;vertical-align:top;border-top:1px solid #e5e5e5;line-height:1.4em}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget table td.sparkline,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget table td.sparkline,form.report_filters div,form.report_filters input,form.report_filters label,form.report_filters p{vertical-align:middle}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget table tr:first-child td,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget table tr:first-child td{border-top:0}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget table td.name,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget table td.name{max-width:175px}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget table td.name a,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget table td.name a{word-wrap:break-word}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget table .wc_sparkline,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget table .wc_sparkline{width:32px;height:1em;display:block;float:right}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget form,.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget p,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget form,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget p{margin:0;padding:10px}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget form .submit,.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget p .submit,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget form .submit,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget p .submit{margin-top:10px}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget #product_ids,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget #product_ids{width:100%}.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .select_all,.woocommerce-reports-wide .postbox .chart-widgets li.chart-widget .select_none,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .select_all,.woocommerce-reports-wrap .postbox .chart-widgets li.chart-widget .select_none{float:right;color:#999;margin-left:4px;margin-top:10px}.woocommerce-reports-wide .postbox .chart-legend,.woocommerce-reports-wrap .postbox .chart-legend{list-style:none;margin:0 0 1em;padding:0;border:1px solid #dfdfdf;border-right-width:0;border-bottom-width:0;background:#fff}.woocommerce-reports-wide .postbox .chart-legend li,.woocommerce-reports-wrap .postbox .chart-legend li{border-right:5px solid #aaa;color:#aaa;padding:1em;display:block;margin:0;-webkit-transition:all ease .5s;box-shadow:inset 0 -1px 0 0 #dfdfdf}.woocommerce-reports-wide .postbox .chart-legend li strong,.woocommerce-reports-wrap .postbox .chart-legend li strong{font-size:1.618em;line-height:1.2em;color:#464646;font-weight:400;display:block;font-family:HelveticaNeue-Light,"Helvetica Neue Light","Helvetica Neue",sans-serif}.woocommerce-reports-wide .postbox .chart-legend li strong del,.woocommerce-reports-wrap .postbox .chart-legend li strong del{color:#e74c3c;font-weight:400}.woocommerce-reports-wide .postbox .chart-legend li:hover,.woocommerce-reports-wrap .postbox .chart-legend li:hover{box-shadow:inset 0 -1px 0 0 #dfdfdf,inset 300px 0 0 rgba(156,93,144,.1);border-right:5px solid #9c5d90!important;padding-left:1.5em;color:#9c5d90}.woocommerce-reports-wide .postbox .pie-chart-legend,.woocommerce-reports-wrap .postbox .pie-chart-legend{margin:12px 0 0;overflow:hidden}.woocommerce-reports-wide .postbox .pie-chart-legend li,.woocommerce-reports-wrap .postbox .pie-chart-legend li{float:left;margin:0;padding:6px 0 0;border-top:4px solid #999;text-align:center;box-sizing:border-box;width:50%}.woocommerce-reports-wide .postbox .stat,.woocommerce-reports-wrap .postbox .stat{font-size:1.5em!important;font-weight:700;text-align:center}.woocommerce-reports-wide .postbox .chart-placeholder,.woocommerce-reports-wrap .postbox .chart-placeholder{width:100%;height:650px;overflow:hidden;position:relative}.woocommerce-reports-wide .postbox .chart-prompt,.woocommerce-reports-wrap .postbox .chart-prompt{line-height:650px;margin:0;color:#999;font-size:1.2em;font-style:italic;text-align:center}.woocommerce-reports-wide .postbox .chart-container,.woocommerce-reports-wrap .postbox .chart-container{background:#fff;padding:12px;position:relative;border:1px solid #dfdfdf;border-radius:3px}.woocommerce-reports-wide .postbox .main .chart-legend,.woocommerce-reports-wrap .postbox .main .chart-legend{margin-top:12px}.woocommerce-reports-wide .postbox .main .chart-legend li,.woocommerce-reports-wrap .postbox .main .chart-legend li{border-right:0;margin:0 8px 0 0;float:left;border-top:4px solid #aaa}.woocommerce-reports-wide .woocommerce-reports-main,.woocommerce-reports-wrap .woocommerce-reports-main{float:left;min-width:100%}.woocommerce-reports-wide .woocommerce-reports-main table td,.woocommerce-reports-wrap .woocommerce-reports-main table td{padding:9px}.woocommerce-reports-wide .woocommerce-reports-sidebar,.woocommerce-reports-wrap .woocommerce-reports-sidebar{display:inline;width:281px;margin-left:-300px;clear:both;float:left}.woocommerce-reports-wide .woocommerce-reports-left,.woocommerce-reports-wrap .woocommerce-reports-left{width:49.5%;float:left}.woocommerce-reports-wide .woocommerce-reports-right,.woocommerce-reports-wrap .woocommerce-reports-right{width:49.5%;float:right}.woocommerce-reports-wide .column-wc_actions a.edit,.woocommerce-reports-wide .column-wc_actions a.view,.woocommerce-reports-wrap .column-wc_actions a.edit,.woocommerce-reports-wrap .column-wc_actions a.view{display:block;text-indent:-9999px;position:relative;padding:0!important;height:2em!important;width:2em}.woocommerce-reports-wide .column-wc_actions a.edit:after,.woocommerce-reports-wide .column-wc_actions a.view:after,.woocommerce-reports-wrap .column-wc_actions a.edit:after,.woocommerce-reports-wrap .column-wc_actions a.view:after{font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;line-height:1.85}.woocommerce-reports-wide .column-wc_actions a.edit:after,.woocommerce-reports-wrap .column-wc_actions a.edit:after{content:"\f464"}.woocommerce-reports-wide .column-wc_actions a.view:after,.woocommerce-reports-wrap .column-wc_actions a.view:after{content:"\f177"}.woocommerce-wide-reports-wrap{padding-bottom:11px}.woocommerce-wide-reports-wrap .widefat .export-data{float:right}.woocommerce-wide-reports-wrap .widefat td,.woocommerce-wide-reports-wrap .widefat th{vertical-align:middle;padding:7px}.chart-tooltip{position:absolute;display:none;line-height:1}table.bar_chart{width:100%}table.bar_chart thead th{text-align:left;color:#ccc;padding:6px 0}table.bar_chart tbody th{padding:6px 0;width:25%;text-align:left!important;font-weight:400!important;border-bottom:1px solid #fee}table.bar_chart tbody td{text-align:right;line-height:24px;padding:6px 6px 6px 0;border-bottom:1px solid #fee}table.bar_chart tbody td span{color:#8a4b75;display:block}table.bar_chart tbody td span.alt{color:#47a03e;margin-top:6px}table.bar_chart tbody td.bars{position:relative;text-align:left;padding:6px 6px 6px 0;border-bottom:1px solid #fee}table.bar_chart tbody td.bars a,table.bar_chart tbody td.bars span{text-decoration:none;clear:both;background:#8a4b75;float:left;display:block;line-height:24px;height:24px;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;border-radius:3px}.post-type-product .woocommerce-BlankState-message:before,.post-type-shop_coupon .woocommerce-BlankState-message:before,.post-type-shop_order .woocommerce-BlankState-message:before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center}table.bar_chart tbody td.bars span.alt{clear:both;background:#47a03e}table.bar_chart tbody td.bars span.alt span{margin:0;color:#c5dec2!important;text-shadow:0 1px 0 #47a03e;background:0 0}.post-type-shop_order .woocommerce-BlankState-message:before{content:""}.post-type-shop_coupon .woocommerce-BlankState-message:before{content:""}.post-type-product .woocommerce-BlankState-message:before{content:""}.woocommerce-BlankState{text-align:center;padding:5em 0 0}.woocommerce-BlankState .woocommerce-BlankState-message{color:#aaa;margin:0 auto 1.5em;line-height:1.5em;font-size:1.2em;max-width:500px}.woocommerce-BlankState .woocommerce-BlankState-message:before{color:#ddd;text-shadow:0 -1px 1px rgba(0,0,0,.2),0 1px 0 rgba(255,255,255,.8);font-size:8em;display:block;position:relative!important;top:auto;left:auto;line-height:1em;margin:0 0 .1875em}.woocommerce-BlankState .woocommerce-BlankState-cta{font-size:1.2em;padding:.75em 1.5em;height:auto}@media only screen and (max-width:1280px){#order_data .order_data_column{width:48%}#order_data .order_data_column:first-child{width:100%}.woocommerce_options_panel .description{display:block;clear:both;margin-left:0}.woocommerce_options_panel .dimensions_field .wrap,.woocommerce_options_panel .short,.woocommerce_options_panel input[type=text].short,.woocommerce_options_panel input[type=number].short,.woocommerce_options_panel input[type=email].short,.woocommerce_options_panel input[type=password].short{width:80%}.woocommerce_options_panel .downloadable_files,.woocommerce_variations .downloadable_files{padding:0;clear:both}.woocommerce_options_panel .downloadable_files label,.woocommerce_variations .downloadable_files label{position:static}.woocommerce_options_panel .downloadable_files table,.woocommerce_variations .downloadable_files table{margin:0 12px 24px;width:94%}.woocommerce_options_panel .downloadable_files table .sort,.woocommerce_variations .downloadable_files table .sort{visibility:hidden}.woocommerce_options_panel .woocommerce_variable_attributes .downloadable_files table,.woocommerce_variations .woocommerce_variable_attributes .downloadable_files table{margin:0 0 1em;width:100%}}@media only screen and (max-width:900px){#woocommerce-coupon-data ul.coupon_data_tabs,#woocommerce-product-data .wc-tabs-back,#woocommerce-product-data ul.product_data_tabs{width:10%}#woocommerce-coupon-data .wc-metaboxes-wrapper,#woocommerce-coupon-data .woocommerce_options_panel,#woocommerce-product-data .wc-metaboxes-wrapper,#woocommerce-product-data .woocommerce_options_panel{width:90%}#woocommerce-coupon-data ul.coupon_data_tabs li a,#woocommerce-product-data ul.product_data_tabs li a{position:relative;text-indent:-999px;padding:10px}#woocommerce-coupon-data ul.coupon_data_tabs li a:before,#woocommerce-product-data ul.product_data_tabs li a:before{position:absolute;top:0;right:0;bottom:0;left:0;text-indent:0;text-align:center;line-height:40px;width:100%;height:40px}}@media only screen and (max-width:782px){#wp-excerpt-media-buttons a{font-size:16px;line-height:37px;height:39px;padding:0 20px 0 15px}#wp-excerpt-editor-tools{padding-top:20px;padding-right:15px;overflow:hidden;margin-bottom:-1px}.post-type-product .wp-list-table .is-expanded td:not(.hidden),.post-type-shop_order .wp-list-table .is-expanded td:not(.hidden){overflow:visible}#woocommerce-product-data .checkbox{width:25px}.variations-pagenav{float:none;text-align:center;font-size:18px}.variations-pagenav .displaying-num{font-size:16px}.variations-pagenav a{padding:8px 20px 11px;font-size:18px}.variations-pagenav select{padding:0 20px}.variations-defaults{float:none;text-align:center;margin-top:10px}.post-type-product .wp-list-table .column-thumb{display:none;text-align:left;padding-bottom:0}.post-type-product .wp-list-table .column-thumb:before{display:none!important}.post-type-product .wp-list-table .column-thumb img{max-width:32px}.post-type-product .wp-list-table .toggle-row{top:-28px}.post-type-shop_order .wp-list-table .column-order_status{display:none;text-align:left;padding-bottom:0}.post-type-shop_order .wp-list-table .column-order_status mark{margin:0}.post-type-shop_order .wp-list-table .column-order_status:before{display:none!important}.post-type-shop_order .wp-list-table .column-customer_message,.post-type-shop_order .wp-list-table .column-order_notes{text-align:inherit}.post-type-shop_order .wp-list-table .column-order_notes .note-on{font-size:1.3em;margin:0}.post-type-shop_order .wp-list-table .toggle-row{top:-15px}}@media only screen and (max-width:500px){.woocommerce_options_panel label,.woocommerce_options_panel legend{float:none;width:auto;display:block;margin:0}.woocommerce_options_panel fieldset.form-field,.woocommerce_options_panel p.form-field{padding:5px 20px!important}}.wc-backbone-modal *{box-sizing:border-box}.wc-backbone-modal .wc-backbone-modal-content{position:fixed;background:#fff;z-index:100000;left:50%;top:50%;transform:translate(-50%,-50%);width:500px}.wc-backbone-modal .wc-backbone-modal-content article{overflow:auto}.wc-backbone-modal.wc-backbone-modal-shipping-method-settings .wc-backbone-modal-content{width:75%;min-width:500px}.wc-backbone-modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;min-height:360px;background:#000;opacity:.7;z-index:99900}.wc-backbone-modal-main{padding-bottom:55px}.wc-backbone-modal-main article,.wc-backbone-modal-main header{display:block;position:relative}.wc-backbone-modal-main .wc-backbone-modal-header{height:auto;background:#fcfcfc;padding:1em 1.5em;border-bottom:1px solid #ddd}.wc-backbone-modal-main .wc-backbone-modal-header h1{margin:0;font-size:18px;font-weight:700;line-height:1.5em}.wc-backbone-modal-main .wc-backbone-modal-header .modal-close-link{cursor:pointer;color:#777;height:54px;width:54px;padding:0;position:absolute;top:0;right:0;text-align:center;border:0;border-left:1px solid #ddd;background-color:transparent;-webkit-transition:color .1s ease-in-out,background .1s ease-in-out;transition:color .1s ease-in-out,background .1s ease-in-out}.wc-backbone-modal-main .wc-backbone-modal-header .modal-close-link:before{font:400 22px/50px dashicons!important;color:#666;display:block;content:'\f335';font-weight:300}.wc-backbone-modal-main .wc-backbone-modal-header .modal-close-link:focus,.wc-backbone-modal-main .wc-backbone-modal-header .modal-close-link:hover{background:#ddd;border-color:#ccc;color:#000}.wc-backbone-modal-main .wc-backbone-modal-header .modal-close-link:focus{outline:0}.wc-backbone-modal-main article{padding:1.5em}.wc-backbone-modal-main article p{margin:1.5em 0}.wc-backbone-modal-main article p:last-child,.wc-backbone-modal-main footer .inner .button{margin-bottom:0}.wc-backbone-modal-main article p:first-child{margin-top:0}.wc-backbone-modal-main article .pagination{padding:10px 0 0;text-align:center}.wc-backbone-modal-main footer{position:absolute;left:0;right:0;bottom:0;z-index:100;padding:1em 1.5em;background:#fcfcfc;border-top:1px solid #dfdfdf;box-shadow:0 -4px 4px -4px rgba(0,0,0,.1)}.wc-backbone-modal-main footer .inner{float:right;line-height:23px}.select2-drop{z-index:999999!important}.select2-container-multi .select2-choices .select2-search-field input{font-family:inherit;font-size:inherit;font-weight:inherit;padding:3px 5px}.select2-container{line-height:1.85em;font-size:14px} \ No newline at end of file diff --git a/assets/css/admin.scss b/assets/css/admin.scss index c727dfa568e..902893d4fd3 100644 --- a/assets/css/admin.scss +++ b/assets/css/admin.scss @@ -306,7 +306,12 @@ table.wc_status_table { #log-viewer-select { padding: 10px 0 8px; - line-height: 180%; + line-height: 28px; + h2 { + a { + vertical-align: middle; + } + } } #log-viewer { @@ -585,7 +590,7 @@ ul.wc_coupon_list_block { .hour, .minute { - width: 3em; + width: 3.5em; } small { @@ -2037,20 +2042,32 @@ table.wc_input_table { color: $blue; } + th { + white-space: nowrap; + padding: 10px; + } + td { padding: 0; border-right: 1px solid #DFDFDF; border-bottom: 1px solid #DFDFDF; border-top: 0; background: #fff; + cursor: default; input[type="text"], input[type="number"] { width: 100%; - padding: 5px 7px; + padding: 8px 10px; margin: 0; border: 0; + outline: 0; background: transparent none; + + &:focus { + outline: 0; + box-shadow: none; + } } &.compound, @@ -2149,13 +2166,6 @@ table.wc_input_table { } } - tfoot { - th { - padding-left: 20px; - padding-right: 20px; - } - } - tr { &:last-child { td { diff --git a/assets/css/select2.css b/assets/css/select2.css index ada0b51e308..0d74c77f1a0 100644 --- a/assets/css/select2.css +++ b/assets/css/select2.css @@ -1 +1 @@ -.select2-container .select2-choice,.select2-results .select2-result-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-touch-callout:none}.select2-container{margin:0;position:relative;display:block!important;zoom:1;vertical-align:middle}.select2-container,.select2-drop,.select2-search,.select2-search input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.select2-container .select2-choice{display:block;padding:0 0 0 8px;overflow:hidden;position:relative;border:1px solid #ccc;white-space:nowrap;color:#444;text-decoration:none;border-radius:3px;background-clip:padding-box;user-select:none;background-color:#fff;font-weight:400}html[dir=rtl] .select2-container .select2-choice{padding:0 8px 0 0}.select2-container.select2-drop-above .select2-choice{border-bottom-color:#ccc;border-radius:0 0 4px 4px}.select2-container.select2-allowclear .select2-choice .select2-chosen{margin-right:42px}.select2-container .select2-choice>.select2-chosen{margin-right:26px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;float:none;width:auto}html[dir=rtl] .select2-container .select2-choice>.select2-chosen{margin-left:26px;margin-right:0}.select2-container .select2-choice abbr{display:none;width:12px;height:12px;position:absolute;right:24px;top:5px;font-size:1px;text-decoration:none;border:0;background:url(../images/select2.png) right top no-repeat;cursor:pointer;outline:0}.select2-container.select2-allowclear .select2-choice abbr{display:inline-block}.select2-container .select2-choice abbr:hover{background-position:right -11px;cursor:pointer}.select2-drop-mask{border:0;margin:0;padding:0;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:9998;background-color:#fff;filter:alpha(opacity=0)}.select2-drop{width:100%;margin-top:-1px;position:absolute;z-index:9999;top:100%;background:#fff;color:#000;border:1px solid #ccc;border-top:0;border-radius:0 0 3px 3px}.select2-drop.select2-drop-above{margin-top:1px;border-top:1px solid #ccc;border-bottom:0;border-radius:3px 3px 0 0}.select2-drop-active{border:1px solid #666;border-top:none}.select2-drop.select2-drop-above.select2-drop-active{border-top:1px solid #666}.select2-drop-auto-width{border-top:1px solid #ccc;width:auto}.select2-drop-auto-width .select2-search{padding-top:4px}.select2-container .select2-choice .select2-arrow{display:inline-block;width:18px;height:100%;position:absolute;right:0;top:0;border-radius:0 3px 3px 0;background-clip:padding-box}html[dir=rtl] .select2-container .select2-choice .select2-arrow{left:0;right:auto;border-radius:3px 0 0 3px}.select2-container .select2-choice .select2-arrow b{display:block;width:100%;height:100%;position:relative}.select2-container .select2-choice .select2-arrow b:after{position:absolute;display:block;content:"";top:50%;left:50%;border:4px solid transparent;border-top-color:#666;margin-left:-7px;margin-top:-2px}.select2-search{display:inline-block;width:100%;margin:0;padding-left:4px;padding-right:4px;position:relative;z-index:10000;white-space:nowrap;padding-bottom:4px}.select2-search input{width:100%;height:auto!important;padding:4px 20px 4px 5px!important;margin:0;outline:0;font-family:sans-serif;font-size:1em;border:1px solid #ccc;-webkit-box-shadow:none;box-shadow:none;background:url(../images/select2.png) 100% -22px no-repeat #fff}html[dir=rtl] .select2-search input{padding:4px 5px 4px 20px;background:url(../images/select2.png) -37px -22px no-repeat #fff}.select2-drop.select2-drop-above .select2-search input{margin-top:4px}.select2-search input.select2-active{background:url(../images/select2-spinner.gif) 100% no-repeat #fff}.select2-container-active .select2-choice,.select2-container-active .select2-choices{border:1px solid #666;outline:0}.select2-dropdown-open .select2-choice{border-bottom-color:transparent;-webkit-box-shadow:0 1px 0 #fff inset;box-shadow:0 1px 0 #fff inset;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-dropdown-open .select2-choice .select2-arrow b:after{border-top-color:transparent;border-bottom-color:#666;margin-top:-6px}.select2-dropdown-open.select2-drop-above .select2-choice,.select2-dropdown-open.select2-drop-above .select2-choices{border:1px solid #666;border-top-color:transparent}.select2-dropdown-open .select2-choice .select2-arrow{background:0 0;border-left:none;filter:none}html[dir=rtl] .select2-dropdown-open .select2-choice .select2-arrow{border-right:none}.select2-dropdown-open .select2-choice .select2-arrow b{background-position:-18px 1px}html[dir=rtl] .select2-dropdown-open .select2-choice .select2-arrow b{background-position:-16px 1px}.select2-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.select2-results{max-height:200px;padding:4px;margin:0;position:relative;overflow-x:hidden;overflow-y:auto;-webkit-tap-highlight-color:transparent;background:#fafafa}html[dir=rtl] .select2-results{padding:0 4px 0 0;margin:4px 0 4px 4px}.select2-results ul.select2-result-sub{margin:0;padding-left:0}.select2-results li{list-style:none;display:list-item;background-image:none;margin:3px 0}.select2-results li.select2-result-with-children>.select2-result-label{font-weight:700}.select2-results .select2-result-label{padding:5px 7px;margin:0;cursor:pointer;min-height:1em;user-select:none}.select2-results-dept-1 .select2-result-label{padding-left:20px}.select2-results-dept-2 .select2-result-label{padding-left:40px}.select2-results-dept-3 .select2-result-label{padding-left:60px}.select2-results-dept-4 .select2-result-label{padding-left:80px}.select2-results-dept-5 .select2-result-label{padding-left:100px}.select2-results-dept-6 .select2-result-label{padding-left:110px}.select2-results-dept-7 .select2-result-label{padding-left:120px}.select2-results .select2-highlighted{background:#f1f1f1;color:#000;border-radius:3px}.select2-results li em{background:#feffde;font-style:normal}.select2-results .select2-highlighted em{background:0 0}.select2-results .select2-highlighted ul{background:#fff;color:#000}.select2-results .select2-ajax-error,.select2-results .select2-no-results,.select2-results .select2-searching,.select2-results .select2-selection-limit{background:#f4f4f4;display:list-item;padding-left:5px}.select2-results .select2-disabled.select2-highlighted{color:#666;background:#f4f4f4;display:list-item;cursor:default}.select2-results .select2-disabled{background:#f4f4f4;display:list-item;cursor:default}.select2-results .select2-selected{display:none}.select2-more-results.select2-active{background:url(../images/select2-spinner.gif) 100% no-repeat #f4f4f4}.select2-results .select2-ajax-error{background:rgba(255,50,50,.2)}.select2-more-results{background:#f4f4f4;display:list-item}.select2-container.select2-container-disabled .select2-choice{background-color:#f4f4f4;background-image:none;border:1px solid #ddd;cursor:default}.select2-container.select2-container-disabled .select2-choice .select2-arrow{background-color:#f4f4f4;background-image:none;border-left:0}.select2-container.select2-container-disabled .select2-choice abbr{display:none}.select2-container-multi .select2-choices{height:auto!important;height:1%;margin:0;padding:0 5px 0 0;position:relative;border:1px solid #ccc;cursor:text;overflow:hidden;background-color:#fff;min-height:26px}html[dir=rtl] .select2-container-multi .select2-choices{padding:0 0 0 5px}.select2-locked{padding:3px 5px!important}.select2-container-multi.select2-container-active .select2-choices{border:1px solid #666;outline:0}.select2-container-multi .select2-choices li{float:left;list-style:none}html[dir=rtl] .select2-container-multi .select2-choices li{float:right}.select2-container-multi .select2-choices .select2-search-field{margin:0;padding:0;white-space:nowrap}.select2-container-multi .select2-choices .select2-search-field:first-child{width:100%}.select2-container-multi .select2-choices .select2-search-field input{padding:5px;margin:1px 0;font-family:sans-serif;outline:0;border:0;-webkit-box-shadow:none;box-shadow:none;background:0 0!important}.select2-container-multi .select2-choices .select2-search-field input.select2-active{background:url(../images/select2-spinner.gif) 100% no-repeat #fff!important}.select2-default{color:#999!important}.select2-container-multi .select2-choices .select2-search-choice{padding:5px 8px 5px 24px;margin:3px 0 3px 5px;position:relative;line-height:15px;color:#333;cursor:default;border-radius:2px;background-clip:padding-box;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#e4e4e4}html[dir=rtl] .select2-container-multi .select2-choices .select2-search-choice{margin:3px 5px 3px 0;padding:5px 24px 5px 8px}.select2-container-multi .select2-choices .select2-search-choice .select2-chosen{cursor:default}.select2-container-multi .select2-choices .select2-search-choice-focus{background:#d4d4d4}.select2-search-choice-close{display:block;width:12px;height:13px;position:absolute;right:7px;top:6px;font-size:1px;outline:0;background:url(../images/select2.png) right top no-repeat}html[dir=rtl] .select2-search-choice-close{right:auto;left:7px}.select2-container-multi .select2-search-choice-close{left:7px}html[dir=rtl] .select2-container-multi .select2-search-choice-close{left:auto;right:7px}.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover,.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close{background-position:right -11px}.select2-container-multi.select2-container-disabled .select2-choices{background-color:#f4f4f4;background-image:none;border:1px solid #ddd;cursor:default}.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice{padding:3px 5px;border:1px solid #ddd;background-image:none;background-color:#f4f4f4}.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close{display:none;background:0 0}.select2-result-selectable .select2-match,.select2-result-unselectable .select2-match{text-decoration:underline}.select2-offscreen,.select2-offscreen:focus{clip:rect(0 0 0 0)!important;width:1px!important;height:1px!important;border:0!important;margin:0!important;padding:0!important;overflow:hidden!important;position:absolute!important;outline:0!important;left:0!important;top:0!important}.select2-display-none{display:none}.select2-measure-scrollbar{position:absolute;top:-10000px;left:-10000px;width:100px;height:100px;overflow:scroll}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-resolution:2dppx){.select2-search input{background-image:url(../images/select2x2.png)!important;background-repeat:no-repeat!important;background-size:60px 40px!important;background-position:100% -21px!important}} \ No newline at end of file +.select2-container .select2-choice,.select2-results .select2-result-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-touch-callout:none}.select2-container{margin:0;position:relative;display:block!important;zoom:1;vertical-align:middle}.select2-container,.select2-drop,.select2-search,.select2-search input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.select2-container .select2-choice{display:block;padding:0 0 0 8px;overflow:hidden;position:relative;border:1px solid #ccc;white-space:nowrap;color:#444;text-decoration:none;border-radius:3px;background-clip:padding-box;user-select:none;background-color:#fff;font-weight:400}html[dir=rtl] .select2-container .select2-choice{padding:0 8px 0 0}.select2-container.select2-drop-above .select2-choice{border-bottom-color:#ccc;border-radius:0 0 4px 4px}.select2-container.select2-allowclear .select2-choice .select2-chosen{margin-right:42px}.select2-container .select2-choice>.select2-chosen{margin-right:26px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;float:none;width:auto}html[dir=rtl] .select2-container .select2-choice>.select2-chosen{margin-left:26px;margin-right:0}.select2-container .select2-choice abbr{display:none;width:12px;height:12px;position:absolute;right:24px;top:5px;font-size:1px;text-decoration:none;border:0;background:url(../images/select2.png) right top no-repeat;cursor:pointer;outline:0}.select2-container.select2-allowclear .select2-choice abbr{display:inline-block}.select2-container .select2-choice abbr:hover{background-position:right -11px;cursor:pointer}.select2-drop-mask{border:0;margin:0;padding:0;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:9998;background-color:#fff;filter:alpha(opacity=0)}.select2-drop{width:100%;margin-top:-1px;position:absolute;z-index:9999;top:100%;background:#fff;color:#000;border:1px solid #ccc;border-top:0;border-radius:0 0 3px 3px}.select2-drop.select2-drop-above{margin-top:1px;border-top:1px solid #ccc;border-bottom:0;border-radius:3px 3px 0 0}.select2-drop-active{border:1px solid #666;border-top:none}.select2-drop.select2-drop-above.select2-drop-active{border-top:1px solid #666}.select2-drop-auto-width{border-top:1px solid #ccc;width:auto}.select2-drop-auto-width .select2-search{padding-top:4px}.select2-container .select2-choice .select2-arrow{display:inline-block;width:18px;height:100%;position:absolute;right:0;top:0;border-radius:0 3px 3px 0;background-clip:padding-box}html[dir=rtl] .select2-container .select2-choice .select2-arrow{left:0;right:auto;border-radius:3px 0 0 3px}.select2-container .select2-choice .select2-arrow b{display:block;width:100%;height:100%;position:relative}.select2-container .select2-choice .select2-arrow b:after{position:absolute;display:block;content:"";top:50%;left:50%;border:4px solid transparent;border-top-color:#666;margin-left:-7px;margin-top:-2px}.select2-search{display:inline-block;width:100%;margin:0;padding-left:4px;padding-right:4px;position:relative;z-index:10000;white-space:nowrap;padding-bottom:4px}.select2-search input{width:100%;height:auto!important;padding:4px 20px 4px 5px!important;margin:0;outline:0;font-family:sans-serif;font-size:1em;border:1px solid #ccc;-webkit-box-shadow:none;box-shadow:none;background:url(../images/select2.png) 100% -22px no-repeat #fff}html[dir=rtl] .select2-search input{padding:4px 5px 4px 20px;background:url(../images/select2.png) -37px -22px no-repeat #fff}.select2-drop.select2-drop-above .select2-search input{margin-top:4px}.select2-search input.select2-active{background:url(../images/select2-spinner.gif) 100% no-repeat #fff}.select2-container-active .select2-choice,.select2-container-active .select2-choices{border:1px solid #666;outline:0}.select2-dropdown-open .select2-choice{border-bottom-color:transparent;-webkit-box-shadow:0 1px 0 #fff inset;box-shadow:0 1px 0 #fff inset;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-dropdown-open .select2-choice .select2-arrow b:after{border-top-color:transparent;border-bottom-color:#666;margin-top:-6px}.select2-dropdown-open.select2-drop-above .select2-choice,.select2-dropdown-open.select2-drop-above .select2-choices{border:1px solid #666;border-top-color:transparent}.select2-dropdown-open .select2-choice .select2-arrow{background:0 0;border-left:none;filter:none}html[dir=rtl] .select2-dropdown-open .select2-choice .select2-arrow{border-right:none}.select2-dropdown-open .select2-choice .select2-arrow b{background-position:-18px 1px}html[dir=rtl] .select2-dropdown-open .select2-choice .select2-arrow b{background-position:-16px 1px}.select2-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.select2-results{max-height:200px;padding:4px;margin:0;position:relative;overflow-x:hidden;overflow-y:auto;-webkit-tap-highlight-color:transparent;background:#fafafa}html[dir=rtl] .select2-results{padding:0 4px 0 0;margin:4px 0 4px 4px}.select2-results ul.select2-result-sub{margin:0;padding-left:0}.select2-results li{list-style:none;display:list-item;background-image:none;margin:3px 0}.select2-results li.select2-result-with-children>.select2-result-label{font-weight:700}.select2-results .select2-result-label{padding:5px 7px;margin:0;cursor:pointer;min-height:1em;user-select:none}.select2-results-dept-1 .select2-result-label{padding-left:20px}.select2-results-dept-2 .select2-result-label{padding-left:40px}.select2-results-dept-3 .select2-result-label{padding-left:60px}.select2-results-dept-4 .select2-result-label{padding-left:80px}.select2-results-dept-5 .select2-result-label{padding-left:100px}.select2-results-dept-6 .select2-result-label{padding-left:110px}.select2-results-dept-7 .select2-result-label{padding-left:120px}.select2-results .select2-highlighted{background:#f1f1f1;color:#000;border-radius:3px}.select2-results li em{background:#feffde;font-style:normal}.select2-results .select2-highlighted em{background:0 0}.select2-results .select2-highlighted ul{background:#fff;color:#000}.select2-results .select2-ajax-error,.select2-results .select2-no-results,.select2-results .select2-searching,.select2-results .select2-selection-limit{background:#f4f4f4;display:list-item;padding-left:5px}.select2-results .select2-disabled.select2-highlighted{color:#666;background:#f4f4f4;display:list-item;cursor:default}.select2-results .select2-disabled{background:#f4f4f4;display:list-item;cursor:default}.select2-results .select2-selected{display:none}.select2-more-results.select2-active{background:url(../images/select2-spinner.gif) 100% no-repeat #f4f4f4}.select2-results .select2-ajax-error{background:rgba(255,50,50,.2)}.select2-more-results{background:#f4f4f4;display:list-item}.select2-container.select2-container-disabled .select2-choice{background-color:#f4f4f4;background-image:none;border:1px solid #ddd;cursor:default}.select2-container.select2-container-disabled .select2-choice .select2-arrow{background-color:#f4f4f4;background-image:none;border-left:0}.select2-container.select2-container-disabled .select2-choice abbr{display:none}.select2-container-multi .select2-choices{height:auto!important;height:1%;margin:0;padding:0 5px 0 0;position:relative;border:1px solid #ccc;cursor:text;overflow:hidden;background-color:#fff;min-height:26px}html[dir=rtl] .select2-container-multi .select2-choices{padding:0 0 0 5px}.select2-locked{padding:3px 5px!important}.select2-container-multi.select2-container-active .select2-choices{border:1px solid #666;outline:0}.select2-container-multi .select2-choices li{float:left;list-style:none}html[dir=rtl] .select2-container-multi .select2-choices li{float:right}.select2-container-multi .select2-choices .select2-search-field{margin:0;padding:0;white-space:nowrap}.select2-container-multi .select2-choices .select2-search-field:first-child{width:100%}.select2-container-multi .select2-choices .select2-search-field input{padding:5px;margin:1px 0;font-family:sans-serif;outline:0;border:0;-webkit-box-shadow:none;box-shadow:none;background:0 0!important}.select2-container-multi .select2-choices .select2-search-field input.select2-active{background:url(../images/select2-spinner.gif) 100% no-repeat #fff!important}.select2-default{color:#999!important}.select2-container-multi .select2-choices .select2-search-choice{padding:5px 8px 5px 24px;margin:3px 0 3px 5px;position:relative;line-height:15px;color:#333;cursor:default;border-radius:2px;background-clip:padding-box;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#e4e4e4}.select2-container-multi .ui-sortable .select2-search-choice{cursor:move}html[dir=rtl] .select2-container-multi .select2-choices .select2-search-choice{margin:3px 5px 3px 0;padding:5px 24px 5px 8px}.select2-container-multi .select2-choices .select2-search-choice .select2-chosen{cursor:default}.select2-container-multi .select2-choices .select2-search-choice-focus{background:#d4d4d4}.select2-search-choice-close{display:block;width:12px;height:13px;position:absolute;right:7px;top:6px;font-size:1px;outline:0;background:url(../images/select2.png) right top no-repeat}html[dir=rtl] .select2-search-choice-close{right:auto;left:7px}.select2-container-multi .select2-search-choice-close{left:7px}html[dir=rtl] .select2-container-multi .select2-search-choice-close{left:auto;right:7px}.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover,.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close{background-position:right -11px}.select2-container-multi.select2-container-disabled .select2-choices{background-color:#f4f4f4;background-image:none;border:1px solid #ddd;cursor:default}.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice{padding:3px 5px;border:1px solid #ddd;background-image:none;background-color:#f4f4f4}.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close{display:none;background:0 0}.select2-result-selectable .select2-match,.select2-result-unselectable .select2-match{text-decoration:underline}.select2-offscreen,.select2-offscreen:focus{clip:rect(0 0 0 0)!important;width:1px!important;height:1px!important;border:0!important;margin:0!important;padding:0!important;overflow:hidden!important;position:absolute!important;outline:0!important;left:0!important;top:0!important}.select2-display-none{display:none}.select2-measure-scrollbar{position:absolute;top:-10000px;left:-10000px;width:100px;height:100px;overflow:scroll}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-resolution:2dppx){.select2-search input{background-image:url(../images/select2x2.png)!important;background-repeat:no-repeat!important;background-size:60px 40px!important;background-position:100% -21px!important}} \ No newline at end of file diff --git a/assets/css/select2.scss b/assets/css/select2.scss index db699b4deca..e7e8ce1c9bc 100644 --- a/assets/css/select2.scss +++ b/assets/css/select2.scss @@ -547,6 +547,11 @@ html[dir="rtl"] .select2-container-multi .select2-choices li background-color: #e4e4e4; } + +.select2-container-multi .ui-sortable .select2-search-choice { + cursor: move; +} + html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice { margin: 3px 5px 3px 0; diff --git a/assets/css/woocommerce-smallscreen.scss b/assets/css/woocommerce-smallscreen.scss index 0309d868849..9c7cf8cd6f3 100644 --- a/assets/css/woocommerce-smallscreen.scss +++ b/assets/css/woocommerce-smallscreen.scss @@ -41,7 +41,7 @@ text-align: right !important; // Important to overwrite order status inline styling &.order-actions { - text-align: left !important; + text-align: left !important; // This must always align left on handheld } &:before { @@ -109,7 +109,7 @@ &:nth-child(2n) { float: right; - clear: none !important; + clear: none !important; // This should never clear. } } } diff --git a/assets/css/woocommerce.css b/assets/css/woocommerce.css index 9fbe2a59123..1263c6d5343 100644 --- a/assets/css/woocommerce.css +++ b/assets/css/woocommerce.css @@ -1 +1 @@ -@charset "UTF-8";.clear,.woocommerce .woocommerce-breadcrumb:after{clear:both}@-webkit-keyframes spin{100%{-webkit-transform:rotate(360deg)}}@-moz-keyframes spin{100%{-moz-transform:rotate(360deg)}}@keyframes spin{100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-ms-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}@font-face{font-family:star;src:url(../fonts/star.eot);src:url(../fonts/star.eot?#iefix) format("embedded-opentype"),url(../fonts/star.woff) format("woff"),url(../fonts/star.ttf) format("truetype"),url(../fonts/star.svg#star) format("svg");font-weight:400;font-style:normal}@font-face{font-family:WooCommerce;src:url(../fonts/WooCommerce.eot);src:url(../fonts/WooCommerce.eot?#iefix) format("embedded-opentype"),url(../fonts/WooCommerce.woff) format("woff"),url(../fonts/WooCommerce.ttf) format("truetype"),url(../fonts/WooCommerce.svg#WooCommerce) format("svg");font-weight:400;font-style:normal}p.demo_store{position:fixed;top:0;left:0;right:0;margin:0;width:100%;font-size:1em;padding:1em 0;text-align:center;background-color:#a46497;color:#fff;z-index:99998;box-shadow:0 1px 1em rgba(0,0,0,.2)}p.demo_store a{color:#fff}.admin-bar p.demo_store{top:32px}.woocommerce .blockUI.blockOverlay{position:relative}.woocommerce .blockUI.blockOverlay:before,.woocommerce .loader:before{height:1em;width:1em;position:absolute;top:50%;left:50%;margin-left:-.5em;margin-top:-.5em;display:block;content:"";-webkit-animation:spin 1s ease-in-out infinite;-moz-animation:spin 1s ease-in-out infinite;animation:spin 1s ease-in-out infinite;background:url(../images/icons/loader.svg) center center;background-size:cover;line-height:1;text-align:center;font-size:2em;color:rgba(0,0,0,.75)}.woocommerce a.remove{display:block;font-size:1.5em;height:1em;width:1em;text-align:center;line-height:1;border-radius:100%;color:red!important;text-decoration:none;font-weight:700;border:0}.woocommerce a.remove:hover{color:#fff!important;background:red}.woocommerce small.note{display:block;color:#777;font-size:.857em;margin-top:10px}.woocommerce .woocommerce-breadcrumb{margin:0 0 1em;padding:0;font-size:.92em;color:#777}.woocommerce .woocommerce-breadcrumb:after,.woocommerce .woocommerce-breadcrumb:before{content:" ";display:table}.woocommerce .woocommerce-breadcrumb a{color:#777}.woocommerce .quantity .qty{width:3.631em;text-align:center}.woocommerce div.product{margin-bottom:0;position:relative}.woocommerce div.product .product_title{clear:none;margin-top:0;padding:0}.woocommerce #reviews #comments .add_review:after,.woocommerce .products ul:after,.woocommerce div.product form.cart:after,.woocommerce div.product p.cart:after,.woocommerce nav.woocommerce-pagination ul,.woocommerce ul.products:after{clear:both}.woocommerce div.product p.price,.woocommerce div.product span.price{color:#77a464;font-size:1.25em}.woocommerce div.product p.price ins,.woocommerce div.product span.price ins{background:inherit;font-weight:700}.woocommerce div.product p.price del,.woocommerce div.product span.price del{opacity:.5}.woocommerce div.product p.stock{font-size:.92em}.woocommerce div.product .stock{color:#77a464}.woocommerce div.product .out-of-stock{color:red}.woocommerce div.product .woocommerce-product-rating{margin-bottom:1.618em}.woocommerce div.product div.images,.woocommerce div.product div.summary{margin-bottom:2em}.woocommerce div.product div.images img{display:block;width:100%;height:auto;box-shadow:none}.woocommerce div.product div.images div.thumbnails{padding-top:1em}.woocommerce div.product div.social{text-align:right;margin:0 0 1em}.woocommerce div.product div.social span{margin:0 0 0 2px}.woocommerce div.product div.social span span{margin:0}.woocommerce div.product div.social span .stButton .chicklets{padding-left:16px;width:0}.woocommerce div.product div.social iframe{float:left;margin-top:3px}.woocommerce div.product .woocommerce-tabs ul.tabs{list-style:none;padding:0 0 0 1em;margin:0 0 1.618em;overflow:hidden;position:relative}.woocommerce div.product .woocommerce-tabs ul.tabs li{border:1px solid #d3ced2;background-color:#ebe9eb;display:inline-block;position:relative;z-index:0;border-radius:4px 4px 0 0;margin:0 -5px;padding:0 1em}.woocommerce div.product .woocommerce-tabs ul.tabs li a{display:inline-block;padding:.5em 0;font-weight:700;color:#515151;text-decoration:none}.woocommerce div.product form.cart:after,.woocommerce div.product form.cart:before,.woocommerce div.product p.cart:after,.woocommerce div.product p.cart:before{display:table;content:" "}.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover{text-decoration:none;color:#6b6b6b}.woocommerce div.product .woocommerce-tabs ul.tabs li.active{background:#fff;z-index:2;border-bottom-color:#fff}.woocommerce div.product .woocommerce-tabs ul.tabs li.active a{color:inherit;text-shadow:inherit}.woocommerce div.product .woocommerce-tabs ul.tabs li.active:before{box-shadow:2px 2px 0 #fff}.woocommerce div.product .woocommerce-tabs ul.tabs li.active:after{box-shadow:-2px 2px 0 #fff}.woocommerce div.product .woocommerce-tabs ul.tabs li:after,.woocommerce div.product .woocommerce-tabs ul.tabs li:before{border:1px solid #d3ced2;position:absolute;bottom:-1px;width:5px;height:5px;content:" "}.woocommerce div.product .woocommerce-tabs ul.tabs li:before{left:-6px;-webkit-border-bottom-right-radius:4px;-moz-border-bottom-right-radius:4px;border-bottom-right-radius:4px;border-width:0 1px 1px 0;box-shadow:2px 2px 0 #ebe9eb}.woocommerce div.product .woocommerce-tabs ul.tabs li:after{right:-6px;-webkit-border-bottom-left-radius:4px;-moz-border-bottom-left-radius:4px;border-bottom-left-radius:4px;border-width:0 0 1px 1px;box-shadow:-2px 2px 0 #ebe9eb}.woocommerce div.product .woocommerce-tabs ul.tabs:before{position:absolute;content:" ";width:100%;bottom:0;left:0;border-bottom:1px solid #d3ced2;z-index:1}.woocommerce div.product .woocommerce-tabs .panel{margin:0 0 2em;padding:0}.woocommerce div.product form.cart,.woocommerce div.product p.cart{margin-bottom:2em}.woocommerce div.product form.cart div.quantity{float:left;margin:0 4px 0 0}.woocommerce div.product form.cart table{border-width:0 0 1px}.woocommerce div.product form.cart table td{padding-left:0}.woocommerce div.product form.cart table div.quantity{float:none;margin:0}.woocommerce div.product form.cart table small.stock{display:block;float:none}.woocommerce div.product form.cart .variations{margin-bottom:1em;border:0;width:100%}.woocommerce div.product form.cart .variations td,.woocommerce div.product form.cart .variations th{border:0;vertical-align:top;line-height:2em}.woocommerce div.product form.cart .variations label{font-weight:700}.woocommerce div.product form.cart .variations select{max-width:100%;min-width:75%;display:inline-block;margin-right:1em}.woocommerce div.product form.cart .variations td.label{padding-right:1em}.woocommerce div.product form.cart .woocommerce-variation-description p{margin-bottom:1em}.woocommerce div.product form.cart .reset_variations{visibility:hidden;font-size:.83em}.woocommerce div.product form.cart .wc-no-matching-variations{display:none}.woocommerce div.product form.cart .button{vertical-align:middle;float:left}.woocommerce div.product form.cart .group_table td.label{padding-right:1em;padding-left:1em}.woocommerce div.product form.cart .group_table td{vertical-align:top;padding-bottom:.5em;border:0}.woocommerce span.onsale{min-height:3.236em;min-width:3.236em;padding:.202em;font-weight:700;position:absolute;text-align:center;line-height:3.236;top:-.5em;left:-.5em;margin:0;border-radius:100%;background-color:#77a464;color:#fff;font-size:.857em;-webkit-font-smoothing:antialiased}.woocommerce .products ul,.woocommerce ul.products{margin:0 0 1em;padding:0;list-style:none;clear:both}.woocommerce .products ul:after,.woocommerce .products ul:before,.woocommerce ul.products:after,.woocommerce ul.products:before{content:" ";display:table}.woocommerce .products ul li,.woocommerce ul.products li{list-style:none}.woocommerce ul.products li.product .onsale{top:0;right:0;left:auto;margin:-.5em -.5em 0 0}.woocommerce ul.products li.product h3{padding:.5em 0;margin:0;font-size:1em}.woocommerce ul.products li.product a{text-decoration:none}.woocommerce ul.products li.product a img{width:100%;height:auto;display:block;margin:0 0 1em;box-shadow:none}.woocommerce ul.products li.product strong{display:block}.woocommerce ul.products li.product .star-rating{font-size:.857em}.woocommerce ul.products li.product .button{margin-top:1em}.woocommerce ul.products li.product .price{color:#77a464;display:block;font-weight:400;margin-bottom:.5em;font-size:.857em}.woocommerce ul.products li.product .price del{color:inherit;opacity:.5;display:block}.woocommerce ul.products li.product .price ins{background:0 0;font-weight:700}.woocommerce ul.products li.product .price .from{font-size:.67em;margin:-2px 0 0;text-transform:uppercase;color:rgba(132,132,132,.5)}.woocommerce .woocommerce-ordering,.woocommerce .woocommerce-result-count{margin:0 0 1em}.woocommerce .woocommerce-ordering select{vertical-align:top}.woocommerce nav.woocommerce-pagination{text-align:center}.woocommerce nav.woocommerce-pagination ul{display:inline-block;white-space:nowrap;padding:0;border:1px solid #d3ced2;border-right:0;margin:1px}.woocommerce nav.woocommerce-pagination ul li{border-right:1px solid #d3ced2;padding:0;margin:0;float:left;display:inline;overflow:hidden}.woocommerce nav.woocommerce-pagination ul li a,.woocommerce nav.woocommerce-pagination ul li span{margin:0;text-decoration:none;line-height:1;font-size:1em;font-weight:400;padding:.5em;min-width:1em;display:block}.woocommerce nav.woocommerce-pagination ul li a:focus,.woocommerce nav.woocommerce-pagination ul li a:hover,.woocommerce nav.woocommerce-pagination ul li span.current{background:#ebe9eb;color:#8a7e88}.woocommerce #respond input#submit,.woocommerce a.button,.woocommerce button.button,.woocommerce input.button{font-size:100%;margin:0;line-height:1;cursor:pointer;position:relative;text-decoration:none;overflow:visible;padding:.618em 1em;font-weight:700;border-radius:3px;left:auto;color:#515151;background-color:#ebe9eb;border:0;white-space:nowrap;display:inline-block;background-image:none;box-shadow:none;-webkit-box-shadow:none;text-shadow:none}.woocommerce #respond input#submit.loading,.woocommerce a.button.loading,.woocommerce button.button.loading,.woocommerce input.button.loading{opacity:.25;padding-right:2.618em}.woocommerce #respond input#submit.loading:after,.woocommerce a.button.loading:after,.woocommerce button.button.loading:after,.woocommerce input.button.loading:after{font-family:WooCommerce;content:"\e01c";vertical-align:top;-webkit-font-smoothing:antialiased;font-weight:400;position:absolute;top:.618em;right:1em;-webkit-animation:spin 2s linear infinite;-moz-animation:spin 2s linear infinite;animation:spin 2s linear infinite}.woocommerce #respond input#submit.added:after,.woocommerce a.button.added:after,.woocommerce button.button.added:after,.woocommerce input.button.added:after{font-family:WooCommerce;content:"\e017";margin-left:.53em;vertical-align:bottom}.woocommerce #respond input#submit:hover,.woocommerce a.button:hover,.woocommerce button.button:hover,.woocommerce input.button:hover{background-color:#dad8da;text-decoration:none;background-image:none;color:#515151}.woocommerce #respond input#submit.alt,.woocommerce a.button.alt,.woocommerce button.button.alt,.woocommerce input.button.alt{background-color:#a46497;color:#fff;-webkit-font-smoothing:antialiased}.woocommerce #respond input#submit.alt:hover,.woocommerce a.button.alt:hover,.woocommerce button.button.alt:hover,.woocommerce input.button.alt:hover{background-color:#935386;color:#fff}.woocommerce #respond input#submit.alt.disabled,.woocommerce #respond input#submit.alt.disabled:hover,.woocommerce #respond input#submit.alt:disabled,.woocommerce #respond input#submit.alt:disabled:hover,.woocommerce #respond input#submit.alt:disabled[disabled],.woocommerce #respond input#submit.alt:disabled[disabled]:hover,.woocommerce a.button.alt.disabled,.woocommerce a.button.alt.disabled:hover,.woocommerce a.button.alt:disabled,.woocommerce a.button.alt:disabled:hover,.woocommerce a.button.alt:disabled[disabled],.woocommerce a.button.alt:disabled[disabled]:hover,.woocommerce button.button.alt.disabled,.woocommerce button.button.alt.disabled:hover,.woocommerce button.button.alt:disabled,.woocommerce button.button.alt:disabled:hover,.woocommerce button.button.alt:disabled[disabled],.woocommerce button.button.alt:disabled[disabled]:hover,.woocommerce input.button.alt.disabled,.woocommerce input.button.alt.disabled:hover,.woocommerce input.button.alt:disabled,.woocommerce input.button.alt:disabled:hover,.woocommerce input.button.alt:disabled[disabled],.woocommerce input.button.alt:disabled[disabled]:hover{background-color:#a46497;color:#fff}.woocommerce #respond input#submit.disabled,.woocommerce #respond input#submit:disabled,.woocommerce #respond input#submit:disabled[disabled],.woocommerce a.button.disabled,.woocommerce a.button:disabled,.woocommerce a.button:disabled[disabled],.woocommerce button.button.disabled,.woocommerce button.button:disabled,.woocommerce button.button:disabled[disabled],.woocommerce input.button.disabled,.woocommerce input.button:disabled,.woocommerce input.button:disabled[disabled]{color:inherit;cursor:not-allowed;opacity:.5;padding:.618em 1em}.woocommerce #respond input#submit.disabled:hover,.woocommerce #respond input#submit:disabled:hover,.woocommerce #respond input#submit:disabled[disabled]:hover,.woocommerce a.button.disabled:hover,.woocommerce a.button:disabled:hover,.woocommerce a.button:disabled[disabled]:hover,.woocommerce button.button.disabled:hover,.woocommerce button.button:disabled:hover,.woocommerce button.button:disabled[disabled]:hover,.woocommerce input.button.disabled:hover,.woocommerce input.button:disabled:hover,.woocommerce input.button:disabled[disabled]:hover{color:inherit;background-color:#ebe9eb}.woocommerce .cart .button,.woocommerce .cart input.button{float:none}.woocommerce a.added_to_cart{padding-top:.5em;white-space:nowrap;display:inline-block}.woocommerce #reviews #comments .add_review:after,.woocommerce #reviews #comments .add_review:before,.woocommerce #reviews #comments ol.commentlist li .comment-text:after,.woocommerce #reviews #comments ol.commentlist li .comment-text:before,.woocommerce #reviews #comments ol.commentlist:after,.woocommerce #reviews #comments ol.commentlist:before{content:" ";display:table}.woocommerce #reviews h2 small{float:right;color:#777;font-size:15px;margin:10px 0 0}.woocommerce #reviews h2 small a{text-decoration:none;color:#777}.woocommerce #reviews h3{margin:0}.woocommerce #reviews #respond{margin:0;border:0;padding:0}.woocommerce #reviews #comment{height:75px}.woocommerce #reviews #comments h2{clear:none}.woocommerce #review_form #respond:after,.woocommerce #reviews #comments ol.commentlist li .comment-text:after,.woocommerce #reviews #comments ol.commentlist:after,.woocommerce .woocommerce-product-rating:after,.woocommerce td.product-name dl.variation:after{clear:both}.woocommerce #reviews #comments ol.commentlist{margin:0;width:100%;background:0 0;list-style:none}.woocommerce #reviews #comments ol.commentlist li{padding:0;margin:0 0 20px;position:relative;background:0;border:0}.woocommerce #reviews #comments ol.commentlist li .meta{color:#777;font-size:.75em}.woocommerce #reviews #comments ol.commentlist li img.avatar{float:left;position:absolute;top:0;left:0;padding:3px;width:32px;height:auto;background:#ebe9eb;border:1px solid #e4e1e3;margin:0;box-shadow:none}.woocommerce #reviews #comments ol.commentlist li .comment-text{margin:0 0 0 50px;border:1px solid #e4e1e3;border-radius:4px;padding:1em 1em 0}.woocommerce #reviews #comments ol.commentlist li .comment-text p{margin:0 0 1em}.woocommerce #reviews #comments ol.commentlist li .comment-text p.meta{font-size:.83em}.woocommerce #reviews #comments ol.commentlist ul.children{list-style:none;margin:20px 0 0 50px}.woocommerce #reviews #comments ol.commentlist ul.children .star-rating{display:none}.woocommerce #reviews #comments ol.commentlist #respond{border:1px solid #e4e1e3;border-radius:4px;padding:1em 1em 0;margin:20px 0 0 50px}.woocommerce #reviews #comments .commentlist>li:before{content:""}.woocommerce .star-rating{float:right;overflow:hidden;position:relative;height:1em;line-height:1;font-size:1em;width:5.4em;font-family:star}.woocommerce .star-rating:before{content:"\73\73\73\73\73";color:#d3ced2;float:left;top:0;left:0;position:absolute}.woocommerce .star-rating span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}.woocommerce .star-rating span:before{content:"\53\53\53\53\53";top:0;position:absolute;left:0}.woocommerce .woocommerce-product-rating{line-height:2;display:block}.woocommerce .woocommerce-product-rating:after,.woocommerce .woocommerce-product-rating:before{content:" ";display:table}.woocommerce .woocommerce-product-rating .star-rating{margin:.5em 4px 0 0;float:left}.woocommerce .products .star-rating{display:block;margin:0 0 .5em;float:none}.woocommerce .hreview-aggregate .star-rating{margin:10px 0 0}.woocommerce #review_form #respond{position:static;margin:0;width:auto;padding:0;background:0 0;border:0}.woocommerce #review_form #respond:after,.woocommerce #review_form #respond:before{content:" ";display:table}.woocommerce p.stars a:before,.woocommerce p.stars a:hover~a:before{content:"\e021"}.woocommerce #review_form #respond p{margin:0 0 10px}.woocommerce #review_form #respond .form-submit input{left:auto}.woocommerce #review_form #respond textarea{box-sizing:border-box;width:100%}.woocommerce p.stars a{position:relative;height:1em;width:1em;text-indent:-999em;display:inline-block;text-decoration:none}.woocommerce p.stars a:before{display:block;position:absolute;top:0;left:0;width:1em;height:1em;line-height:1;font-family:WooCommerce;text-indent:0}.woocommerce table.shop_attributes td,.woocommerce table.shop_attributes th{line-height:1.5;border-bottom:1px dotted rgba(0,0,0,.1);border-top:0;margin:0}.woocommerce p.stars.selected a.active:before,.woocommerce p.stars:hover a:before{content:"\e020"}.woocommerce p.stars.selected a.active~a:before{content:"\e021"}.woocommerce p.stars.selected a:not(.active):before{content:"\e020"}.woocommerce table.shop_attributes{border:0;border-top:1px dotted rgba(0,0,0,.1);margin-bottom:1.618em;width:100%}.woocommerce table.shop_attributes th{width:150px;font-weight:700;padding:8px}.woocommerce table.shop_attributes td{font-style:italic;padding:0}.woocommerce table.shop_attributes td p{margin:0;padding:8px 0}.woocommerce table.shop_attributes .alt td,.woocommerce table.shop_attributes .alt th{background:rgba(0,0,0,.025)}.woocommerce table.shop_table{border:1px solid rgba(0,0,0,.1);margin:0 -1px 24px 0;text-align:left;width:100%;border-collapse:separate;border-radius:5px}.woocommerce table.shop_table th{font-weight:700;padding:9px 12px}.woocommerce table.shop_table td{border-top:1px solid rgba(0,0,0,.1);padding:6px 12px;vertical-align:middle}.woocommerce table.shop_table td small{font-weight:400}.woocommerce table.shop_table tbody:first-child tr:first-child td,.woocommerce table.shop_table tbody:first-child tr:first-child th{border-top:0}.woocommerce table.shop_table tbody th,.woocommerce table.shop_table tfoot td,.woocommerce table.shop_table tfoot th{font-weight:700;border-top:1px solid rgba(0,0,0,.1)}.woocommerce table.my_account_orders{font-size:.85em}.woocommerce table.my_account_orders td,.woocommerce table.my_account_orders th{padding:4px 8px;vertical-align:middle}.woocommerce table.my_account_orders .button{white-space:nowrap}.woocommerce table.my_account_orders .order-actions{text-align:right}.woocommerce table.my_account_orders .order-actions .button{margin:.125em 0 .125em .25em}.woocommerce td.product-name dl.variation{margin:.25em 0}.woocommerce td.product-name dl.variation:after,.woocommerce td.product-name dl.variation:before{content:" ";display:table}.woocommerce td.product-name dl.variation dd,.woocommerce td.product-name dl.variation dt{display:inline-block;float:left;margin-bottom:1em}.woocommerce td.product-name dl.variation dt{font-weight:700;padding:0 0 .25em;margin:0 4px 0 0;clear:left}.woocommerce ul.cart_list li dl:after,.woocommerce ul.cart_list li:after,.woocommerce ul.product_list_widget li dl:after,.woocommerce ul.product_list_widget li:after{clear:both}.woocommerce td.product-name dl.variation dd{padding:0 0 .25em}.woocommerce td.product-name dl.variation dd p:last-child{margin-bottom:0}.woocommerce td.product-name p.backorder_notification{font-size:.83em}.woocommerce td.product-quantity{min-width:80px}.woocommerce ul.cart_list,.woocommerce ul.product_list_widget{list-style:none;padding:0;margin:0}.woocommerce ul.cart_list li,.woocommerce ul.product_list_widget li{padding:4px 0;margin:0;list-style:none}.woocommerce ul.cart_list li:after,.woocommerce ul.cart_list li:before,.woocommerce ul.product_list_widget li:after,.woocommerce ul.product_list_widget li:before{content:" ";display:table}.woocommerce ul.cart_list li a,.woocommerce ul.product_list_widget li a{display:block;font-weight:700}.woocommerce ul.cart_list li img,.woocommerce ul.product_list_widget li img{float:right;margin-left:4px;width:32px;height:auto;box-shadow:none}.woocommerce ul.cart_list li dl,.woocommerce ul.product_list_widget li dl{margin:0;padding-left:1em;border-left:2px solid rgba(0,0,0,.1)}.woocommerce ul.cart_list li dl:after,.woocommerce ul.cart_list li dl:before,.woocommerce ul.product_list_widget li dl:after,.woocommerce ul.product_list_widget li dl:before{content:" ";display:table}.woocommerce ul.cart_list li dl dd,.woocommerce ul.cart_list li dl dt,.woocommerce ul.product_list_widget li dl dd,.woocommerce ul.product_list_widget li dl dt{display:inline-block;float:left;margin-bottom:1em}.woocommerce ul.cart_list li dl dt,.woocommerce ul.product_list_widget li dl dt{font-weight:700;padding:0 0 .25em;margin:0 4px 0 0;clear:left}#add_payment_method .wc-proceed-to-checkout:after,.woocommerce .order_details:after,.woocommerce .widget_layered_nav ul li:after,.woocommerce .widget_rating_filter ul li:after,.woocommerce .widget_shopping_cart .buttons:after,.woocommerce-account .addresses .title:after,.woocommerce-account .woocommerce:after,.woocommerce-cart .wc-proceed-to-checkout:after,.woocommerce-checkout .wc-proceed-to-checkout:after,.woocommerce-error:after,.woocommerce-info:after,.woocommerce-message:after,.woocommerce.widget_shopping_cart .buttons:after{clear:both}.woocommerce ul.cart_list li dl dd,.woocommerce ul.product_list_widget li dl dd{padding:0 0 .25em}.woocommerce ul.cart_list li dl dd p:last-child,.woocommerce ul.product_list_widget li dl dd p:last-child{margin-bottom:0}.woocommerce ul.cart_list li .star-rating,.woocommerce ul.product_list_widget li .star-rating{float:none}.woocommerce .widget_shopping_cart .total,.woocommerce.widget_shopping_cart .total{border-top:3px double #ebe9eb;padding:4px 0 0}.woocommerce .widget_shopping_cart .total strong,.woocommerce.widget_shopping_cart .total strong{min-width:40px;display:inline-block}.woocommerce .widget_shopping_cart .cart_list li,.woocommerce.widget_shopping_cart .cart_list li{padding-left:2em;position:relative;padding-top:0}.woocommerce .widget_shopping_cart .cart_list li a.remove,.woocommerce.widget_shopping_cart .cart_list li a.remove{position:absolute;top:0;left:0}.woocommerce .widget_shopping_cart .buttons:after,.woocommerce .widget_shopping_cart .buttons:before,.woocommerce.widget_shopping_cart .buttons:after,.woocommerce.widget_shopping_cart .buttons:before{content:" ";display:table}.woocommerce form .form-row{padding:3px;margin:0 0 6px}.woocommerce form .form-row [placeholder]:focus::-webkit-input-placeholder{-webkit-transition:opacity .5s .5s ease;-moz-transition:opacity .5s .5s ease;transition:opacity .5s .5s ease;opacity:0}.woocommerce form .form-row label{line-height:2}.woocommerce form .form-row label.hidden{visibility:hidden}.woocommerce form .form-row label.inline{display:inline}.woocommerce form .form-row select{cursor:pointer;margin:0}.woocommerce form .form-row .required{color:red;font-weight:700;border:0}.woocommerce form .form-row .input-checkbox{display:inline;margin:-2px 8px 0 0;text-align:center;vertical-align:middle}.woocommerce form .form-row input.input-text,.woocommerce form .form-row textarea{box-sizing:border-box;width:100%;margin:0;outline:0;line-height:1}.woocommerce form .form-row textarea{height:4em;line-height:1.5;display:block;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.woocommerce form .form-row .select2-container{width:100%;line-height:2em}.woocommerce form .form-row.woocommerce-invalid label{color:#a00}.woocommerce form .form-row.woocommerce-invalid .select2-container,.woocommerce form .form-row.woocommerce-invalid input.input-text,.woocommerce form .form-row.woocommerce-invalid select{border-color:#a00}.woocommerce form .form-row.woocommerce-validated .select2-container,.woocommerce form .form-row.woocommerce-validated input.input-text,.woocommerce form .form-row.woocommerce-validated select{border-color:#69bf29}.woocommerce form .form-row ::-webkit-input-placeholder{line-height:normal}.woocommerce form .form-row :-moz-placeholder{line-height:normal}.woocommerce form .form-row :-ms-input-placeholder{line-height:normal}.woocommerce form.checkout_coupon,.woocommerce form.login,.woocommerce form.register{border:1px solid #d3ced2;padding:20px;margin:2em 0;text-align:left;border-radius:5px}.woocommerce ul#shipping_method{list-style:none;margin:0;padding:0}.woocommerce ul#shipping_method li{margin:0;padding:.25em 0 .25em 22px;text-indent:-22px;list-style:none}.woocommerce ul#shipping_method li input{margin:3px .5ex}.woocommerce ul#shipping_method li label{display:inline}.woocommerce ul#shipping_method .amount{font-weight:700}.woocommerce p.woocommerce-shipping-contents{margin:0}.woocommerce .order_details{margin:0 0 1.5em;list-style:none}.woocommerce .order_details:after,.woocommerce .order_details:before{content:" ";display:table}.woocommerce .order_details li{float:left;margin-right:2em;text-transform:uppercase;font-size:.715em;line-height:1;border-right:1px dashed #d3ced2;padding-right:2em;margin-left:0;padding-left:0;list-style-type:none}.woocommerce .order_details li strong{display:block;font-size:1.4em;text-transform:none;line-height:1.5}.woocommerce .order_details li:last-of-type{border:none}.woocommerce .widget_layered_nav ul{margin:0;padding:0;border:0;list-style:none}.woocommerce .widget_layered_nav ul li{padding:0 0 1px;list-style:none}.woocommerce .widget_layered_nav ul li:after,.woocommerce .widget_layered_nav ul li:before{content:" ";display:table}.woocommerce .widget_layered_nav ul li.chosen a:before,.woocommerce .widget_layered_nav_filters ul li a:before{line-height:1;content:"";font-family:WooCommerce;font-weight:400;color:#a00;speak:none;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;text-decoration:none}.woocommerce .widget_layered_nav ul li a,.woocommerce .widget_layered_nav ul li span{padding:1px 0}.woocommerce .widget_layered_nav ul li.chosen a:before{margin-right:.618em}.woocommerce .widget_layered_nav_filters ul{margin:0;padding:0;border:0;list-style:none;overflow:hidden;zoom:1}.woocommerce .widget_layered_nav_filters ul li{float:left;padding:0 1px 1px 0;list-style:none}.woocommerce .widget_layered_nav_filters ul li a{text-decoration:none}.woocommerce .widget_layered_nav_filters ul li a:before{margin-right:.618em}.woocommerce .widget_price_filter .price_slider{margin-bottom:1em}.woocommerce .widget_price_filter .price_slider_amount{text-align:right;line-height:2.4;font-size:.8751em}.woocommerce .widget_price_filter .price_slider_amount .button{font-size:1.15em;float:left}.woocommerce .widget_price_filter .ui-slider{position:relative;text-align:left;margin-left:.5em;margin-right:.5em}.woocommerce .widget_price_filter .ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1em;height:1em;background-color:#a46497;border-radius:1em;cursor:ew-resize;outline:0;top:-.3em;margin-left:-.5em}.woocommerce .widget_price_filter .ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;border-radius:1em;background-color:#a46497}.woocommerce .widget_price_filter .price_slider_wrapper .ui-widget-content{border-radius:1em;background-color:#602053;border:0}.woocommerce .widget_price_filter .ui-slider-horizontal{height:.5em}.woocommerce .widget_price_filter .ui-slider-horizontal .ui-slider-range{top:0;height:100%}.woocommerce .widget_price_filter .ui-slider-horizontal .ui-slider-range-min{left:-1px}.woocommerce .widget_price_filter .ui-slider-horizontal .ui-slider-range-max{right:-1px}.woocommerce .widget_rating_filter ul{margin:0;padding:0;border:0;list-style:none}.woocommerce .widget_rating_filter ul li{padding:0 0 1px;list-style:none}.woocommerce .widget_rating_filter ul li:after,.woocommerce .widget_rating_filter ul li:before{content:" ";display:table}.woocommerce .widget_rating_filter ul li a{padding:1px 0;text-decoration:none}.woocommerce .widget_rating_filter ul li .star-rating{float:none;display:inline-block}.woocommerce .widget_rating_filter ul li.chosen a:before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-right:.618em;content:"";text-decoration:none;color:#a00}.woocommerce-error,.woocommerce-info,.woocommerce-message{padding:1em 2em 1em 3.5em!important;margin:0 0 2em!important;position:relative;background-color:#f7f6f7;color:#515151;border-top:3px solid #a46497;list-style:none!important;width:auto;word-wrap:break-word}.woocommerce-error:after,.woocommerce-error:before,.woocommerce-info:after,.woocommerce-info:before,.woocommerce-message:after,.woocommerce-message:before{content:" ";display:table}.woocommerce-error:before,.woocommerce-info:before,.woocommerce-message:before{font-family:WooCommerce;content:"\e028";display:inline-block;position:absolute;top:1em;left:1.5em}.woocommerce-error .button,.woocommerce-info .button,.woocommerce-message .button{float:right}.woocommerce-error li,.woocommerce-info li,.woocommerce-message li{list-style:none!important;padding-left:0!important;margin-left:0!important}.woocommerce-message{border-top-color:#8fae1b}.woocommerce-message:before{content:"\e015";color:#8fae1b}.woocommerce-info{border-top-color:#1e85be}.woocommerce-info:before{color:#1e85be}.woocommerce-error{border-top-color:#b81c23}.woocommerce-error:before{content:"\e016";color:#b81c23}.woocommerce-account .addresses .title:after,.woocommerce-account .addresses .title:before,.woocommerce-account .woocommerce:after,.woocommerce-account .woocommerce:before{content:" ";display:table}.woocommerce-account .addresses .title h3{float:left}.woocommerce-account .addresses .title .edit,.woocommerce-account ul.digital-downloads li .count{float:right}.woocommerce-account ol.commentlist.notes li.note p.meta{font-weight:700;margin-bottom:0}.woocommerce-account ol.commentlist.notes li.note .description p:last-child{margin-bottom:0}.woocommerce-account ul.digital-downloads{margin-left:0;padding-left:0}.woocommerce-account ul.digital-downloads li{list-style:none;margin-left:0;padding-left:0}.woocommerce-account ul.digital-downloads li:before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-right:.618em;content:"";text-decoration:none}#add_payment_method table.cart .product-thumbnail,.woocommerce-cart table.cart .product-thumbnail,.woocommerce-checkout table.cart .product-thumbnail{min-width:32px}#add_payment_method table.cart img,.woocommerce-cart table.cart img,.woocommerce-checkout table.cart img{width:32px;box-shadow:none}#add_payment_method table.cart td,#add_payment_method table.cart th,.woocommerce-cart table.cart td,.woocommerce-cart table.cart th,.woocommerce-checkout table.cart td,.woocommerce-checkout table.cart th{vertical-align:middle}#add_payment_method table.cart td.actions .coupon .input-text,.woocommerce-cart table.cart td.actions .coupon .input-text,.woocommerce-checkout table.cart td.actions .coupon .input-text{float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #d3ced2;padding:6px 6px 5px;margin:0 4px 0 0;outline:0;line-height:1}#add_payment_method table.cart input,.woocommerce-cart table.cart input,.woocommerce-checkout table.cart input{margin:0;vertical-align:middle;line-height:1}#add_payment_method .wc-proceed-to-checkout,.woocommerce-cart .wc-proceed-to-checkout,.woocommerce-checkout .wc-proceed-to-checkout{padding:1em 0}#add_payment_method .wc-proceed-to-checkout:after,#add_payment_method .wc-proceed-to-checkout:before,.woocommerce-cart .wc-proceed-to-checkout:after,.woocommerce-cart .wc-proceed-to-checkout:before,.woocommerce-checkout .wc-proceed-to-checkout:after,.woocommerce-checkout .wc-proceed-to-checkout:before{content:" ";display:table}#add_payment_method .wc-proceed-to-checkout a.checkout-button,.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,.woocommerce-checkout .wc-proceed-to-checkout a.checkout-button{display:block;text-align:center;margin-bottom:1em;font-size:1.25em;padding:1em}#add_payment_method .cart-collaterals .shipping_calculator .button,.woocommerce-cart .cart-collaterals .shipping_calculator .button,.woocommerce-checkout .cart-collaterals .shipping_calculator .button{width:100%;float:none;display:block}#add_payment_method .cart-collaterals .shipping_calculator .shipping-calculator-button:after,.woocommerce-cart .cart-collaterals .shipping_calculator .shipping-calculator-button:after,.woocommerce-checkout .cart-collaterals .shipping_calculator .shipping-calculator-button:after{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-left:.618em;content:"";text-decoration:none}#add_payment_method #payment ul.payment_methods li:after,#add_payment_method #payment ul.payment_methods li:before,#add_payment_method #payment ul.payment_methods:after,#add_payment_method #payment ul.payment_methods:before,.woocommerce-cart #payment ul.payment_methods li:after,.woocommerce-cart #payment ul.payment_methods li:before,.woocommerce-cart #payment ul.payment_methods:after,.woocommerce-cart #payment ul.payment_methods:before,.woocommerce-checkout #payment ul.payment_methods li:after,.woocommerce-checkout #payment ul.payment_methods li:before,.woocommerce-checkout #payment ul.payment_methods:after,.woocommerce-checkout #payment ul.payment_methods:before{content:" ";display:table}#add_payment_method .cart-collaterals .cart_totals p small,.woocommerce-cart .cart-collaterals .cart_totals p small,.woocommerce-checkout .cart-collaterals .cart_totals p small{color:#777;font-size:.83em}#add_payment_method .cart-collaterals .cart_totals table,.woocommerce-cart .cart-collaterals .cart_totals table,.woocommerce-checkout .cart-collaterals .cart_totals table{border-collapse:separate;margin:0 0 6px;padding:0}#add_payment_method .cart-collaterals .cart_totals table tr:first-child td,#add_payment_method .cart-collaterals .cart_totals table tr:first-child th,.woocommerce-cart .cart-collaterals .cart_totals table tr:first-child td,.woocommerce-cart .cart-collaterals .cart_totals table tr:first-child th,.woocommerce-checkout .cart-collaterals .cart_totals table tr:first-child td,.woocommerce-checkout .cart-collaterals .cart_totals table tr:first-child th{border-top:0}#add_payment_method .cart-collaterals .cart_totals table th,.woocommerce-cart .cart-collaterals .cart_totals table th,.woocommerce-checkout .cart-collaterals .cart_totals table th{width:40%}#add_payment_method .cart-collaterals .cart_totals table td,#add_payment_method .cart-collaterals .cart_totals table th,.woocommerce-cart .cart-collaterals .cart_totals table td,.woocommerce-cart .cart-collaterals .cart_totals table th,.woocommerce-checkout .cart-collaterals .cart_totals table td,.woocommerce-checkout .cart-collaterals .cart_totals table th{vertical-align:top;border-left:0;border-right:0;line-height:1.5em}#add_payment_method .cart-collaterals .cart_totals table small,.woocommerce-cart .cart-collaterals .cart_totals table small,.woocommerce-checkout .cart-collaterals .cart_totals table small{color:#777}#add_payment_method .cart-collaterals .cart_totals table select,.woocommerce-cart .cart-collaterals .cart_totals table select,.woocommerce-checkout .cart-collaterals .cart_totals table select{width:100%}#add_payment_method .cart-collaterals .cart_totals .discount td,.woocommerce-cart .cart-collaterals .cart_totals .discount td,.woocommerce-checkout .cart-collaterals .cart_totals .discount td{color:#77a464}#add_payment_method .cart-collaterals .cart_totals tr td,#add_payment_method .cart-collaterals .cart_totals tr th,.woocommerce-cart .cart-collaterals .cart_totals tr td,.woocommerce-cart .cart-collaterals .cart_totals tr th,.woocommerce-checkout .cart-collaterals .cart_totals tr td,.woocommerce-checkout .cart-collaterals .cart_totals tr th{border-top:1px solid #ebe9eb}#add_payment_method .cart-collaterals .cross-sells ul.products li.product,.woocommerce-cart .cart-collaterals .cross-sells ul.products li.product,.woocommerce-checkout .cart-collaterals .cross-sells ul.products li.product{margin-top:0}#add_payment_method .checkout .col-2 h3#ship-to-different-address,.woocommerce-cart .checkout .col-2 h3#ship-to-different-address,.woocommerce-checkout .checkout .col-2 h3#ship-to-different-address{float:left;clear:none}#add_payment_method .checkout .col-2 .form-row-first,#add_payment_method .checkout .col-2 .notes,.woocommerce-cart .checkout .col-2 .form-row-first,.woocommerce-cart .checkout .col-2 .notes,.woocommerce-checkout .checkout .col-2 .form-row-first,.woocommerce-checkout .checkout .col-2 .notes{clear:left}#add_payment_method .checkout .create-account small,.woocommerce-cart .checkout .create-account small,.woocommerce-checkout .checkout .create-account small{font-size:11px;color:#777;font-weight:400}#add_payment_method .checkout div.shipping-address,.woocommerce-cart .checkout div.shipping-address,.woocommerce-checkout .checkout div.shipping-address{padding:0;clear:left;width:100%}#add_payment_method #payment ul.payment_methods li:after,#add_payment_method #payment ul.payment_methods:after,#add_payment_method .checkout .shipping_address,.single-product .twentythirteen p.stars,.woocommerce-cart #payment ul.payment_methods li:after,.woocommerce-cart #payment ul.payment_methods:after,.woocommerce-cart .checkout .shipping_address,.woocommerce-checkout #payment ul.payment_methods li:after,.woocommerce-checkout #payment ul.payment_methods:after,.woocommerce-checkout .checkout .shipping_address{clear:both}#add_payment_method #payment,.woocommerce-cart #payment,.woocommerce-checkout #payment{background:#ebe9eb;border-radius:5px}#add_payment_method #payment ul.payment_methods,.woocommerce-cart #payment ul.payment_methods,.woocommerce-checkout #payment ul.payment_methods{text-align:left;padding:1em;border-bottom:1px solid #d3ced2;margin:0;list-style:none}#add_payment_method #payment ul.payment_methods li,.woocommerce-cart #payment ul.payment_methods li,.woocommerce-checkout #payment ul.payment_methods li{line-height:2;text-align:left;margin:0;font-weight:400}#add_payment_method #payment ul.payment_methods li input,.woocommerce-cart #payment ul.payment_methods li input,.woocommerce-checkout #payment ul.payment_methods li input{margin:0 1em 0 0}#add_payment_method #payment ul.payment_methods li img,.woocommerce-cart #payment ul.payment_methods li img,.woocommerce-checkout #payment ul.payment_methods li img{vertical-align:middle;margin:-2px 0 0 .5em;padding:0;position:relative;box-shadow:none}#add_payment_method #payment ul.payment_methods li img+img,.woocommerce-cart #payment ul.payment_methods li img+img,.woocommerce-checkout #payment ul.payment_methods li img+img{margin-left:2px}#add_payment_method #payment div.form-row,.woocommerce-cart #payment div.form-row,.woocommerce-checkout #payment div.form-row{padding:1em}#add_payment_method #payment div.payment_box,.woocommerce-cart #payment div.payment_box,.woocommerce-checkout #payment div.payment_box{position:relative;box-sizing:border-box;width:100%;padding:1em;margin:1em 0;font-size:.92em;border-radius:2px;line-height:1.5;background-color:#dfdcde;color:#515151}#add_payment_method #payment div.payment_box input.input-text,#add_payment_method #payment div.payment_box textarea,.woocommerce-cart #payment div.payment_box input.input-text,.woocommerce-cart #payment div.payment_box textarea,.woocommerce-checkout #payment div.payment_box input.input-text,.woocommerce-checkout #payment div.payment_box textarea{border-color:#bbb3b9 #c7c1c6 #c7c1c6}#add_payment_method #payment div.payment_box ::-webkit-input-placeholder,.woocommerce-cart #payment div.payment_box ::-webkit-input-placeholder,.woocommerce-checkout #payment div.payment_box ::-webkit-input-placeholder{color:#bbb3b9}#add_payment_method #payment div.payment_box :-moz-placeholder,.woocommerce-cart #payment div.payment_box :-moz-placeholder,.woocommerce-checkout #payment div.payment_box :-moz-placeholder{color:#bbb3b9}#add_payment_method #payment div.payment_box :-ms-input-placeholder,.woocommerce-cart #payment div.payment_box :-ms-input-placeholder,.woocommerce-checkout #payment div.payment_box :-ms-input-placeholder{color:#bbb3b9}#add_payment_method #payment div.payment_box .woocommerce-SavedPaymentMethods,.woocommerce-cart #payment div.payment_box .woocommerce-SavedPaymentMethods,.woocommerce-checkout #payment div.payment_box .woocommerce-SavedPaymentMethods{list-style:none;margin:0}#add_payment_method #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-new,#add_payment_method #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-token,.woocommerce-cart #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-new,.woocommerce-cart #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-token,.woocommerce-checkout #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-new,.woocommerce-checkout #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-token{margin:0 0 .5em}#add_payment_method #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-new label,#add_payment_method #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-token label,.woocommerce-cart #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-new label,.woocommerce-cart #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-token label,.woocommerce-checkout #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-new label,.woocommerce-checkout #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-token label{cursor:pointer}#add_payment_method #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-tokenInput,.woocommerce-cart #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-tokenInput,.woocommerce-checkout #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-tokenInput{vertical-align:middle;margin:-3px 1em 0 0;position:relative}#add_payment_method #payment div.payment_box .wc-credit-card-form,.woocommerce-cart #payment div.payment_box .wc-credit-card-form,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form{border:0;padding:0;margin:1em 0 0}#add_payment_method #payment div.payment_box .wc-credit-card-form-card-cvc,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-expiry,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-number,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-cvc,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-expiry,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-number,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number{font-size:1.5em;padding:8px;background-repeat:no-repeat;background-position:right .618em center;background-size:32px 20px}#add_payment_method #payment div.payment_box .wc-credit-card-form-card-cvc.visa,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-expiry.visa,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-number.visa,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-cvc.visa,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-expiry.visa,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-number.visa,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.visa,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.visa,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.visa{background-image:url(../images/icons/credit-cards/visa.svg)}#add_payment_method #payment div.payment_box .wc-credit-card-form-card-cvc.mastercard,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-expiry.mastercard,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-number.mastercard,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-cvc.mastercard,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-expiry.mastercard,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-number.mastercard,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.mastercard,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.mastercard,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.mastercard{background-image:url(../images/icons/credit-cards/mastercard.svg)}#add_payment_method #payment div.payment_box .wc-credit-card-form-card-cvc.laser,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-expiry.laser,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-number.laser,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-cvc.laser,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-expiry.laser,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-number.laser,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.laser,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.laser,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.laser{background-image:url(../images/icons/credit-cards/laser.svg)}#add_payment_method #payment div.payment_box .wc-credit-card-form-card-cvc.dinersclub,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-expiry.dinersclub,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-number.dinersclub,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-cvc.dinersclub,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-expiry.dinersclub,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-number.dinersclub,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.dinersclub,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.dinersclub,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.dinersclub{background-image:url(../images/icons/credit-cards/diners.svg)}#add_payment_method #payment div.payment_box .wc-credit-card-form-card-cvc.maestro,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-expiry.maestro,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-number.maestro,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-cvc.maestro,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-expiry.maestro,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-number.maestro,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.maestro,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.maestro,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.maestro{background-image:url(../images/icons/credit-cards/maestro.svg)}#add_payment_method #payment div.payment_box .wc-credit-card-form-card-cvc.jcb,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-expiry.jcb,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-number.jcb,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-cvc.jcb,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-expiry.jcb,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-number.jcb,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.jcb,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.jcb,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.jcb{background-image:url(../images/icons/credit-cards/jcb.svg)}#add_payment_method #payment div.payment_box .wc-credit-card-form-card-cvc.amex,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-expiry.amex,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-number.amex,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-cvc.amex,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-expiry.amex,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-number.amex,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.amex,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.amex,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.amex{background-image:url(../images/icons/credit-cards/amex.svg)}#add_payment_method #payment div.payment_box .wc-credit-card-form-card-cvc.discover,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-expiry.discover,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-number.discover,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-cvc.discover,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-expiry.discover,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-number.discover,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.discover,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.discover,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.discover{background-image:url(../images/icons/credit-cards/discover.svg)}#add_payment_method #payment div.payment_box span.help,.woocommerce-cart #payment div.payment_box span.help,.woocommerce-checkout #payment div.payment_box span.help{font-size:.857em;color:#777;font-weight:400}#add_payment_method #payment div.payment_box .form-row,.woocommerce-cart #payment div.payment_box .form-row,.woocommerce-checkout #payment div.payment_box .form-row{margin:0 0 1em}#add_payment_method #payment div.payment_box p:last-child,.woocommerce-cart #payment div.payment_box p:last-child,.woocommerce-checkout #payment div.payment_box p:last-child{margin-bottom:0}#add_payment_method #payment div.payment_box:before,.woocommerce-cart #payment div.payment_box:before,.woocommerce-checkout #payment div.payment_box:before{content:"";display:block;border:1em solid #dfdcde;border-right-color:transparent;border-left-color:transparent;border-top-color:transparent;position:absolute;top:-.75em;left:0;margin:-1em 0 0 2em}#add_payment_method #payment .payment_method_paypal .about_paypal,.woocommerce-cart #payment .payment_method_paypal .about_paypal,.woocommerce-checkout #payment .payment_method_paypal .about_paypal{float:right;line-height:52px;font-size:.83em}#add_payment_method #payment .payment_method_paypal img,.woocommerce-cart #payment .payment_method_paypal img,.woocommerce-checkout #payment .payment_method_paypal img{max-height:52px;vertical-align:middle}.woocommerce-password-strength{text-align:center;font-weight:600;padding:3px .5em;font-size:1em}.woocommerce-password-strength.strong{background-color:#c1e1b9;border-color:#83c373}.woocommerce-password-strength.short{background-color:#f1adad;border-color:#e35b5b}.woocommerce-password-strength.bad{background-color:#fbc5a9;border-color:#f78b53}.woocommerce-password-strength.good{background-color:#ffe399;border-color:#ffc733}.woocommerce-password-hint{margin:.5em 0 0;display:block}.product.has-default-attributes.has-children>.images{opacity:0}#content.twentyeleven .woocommerce-pagination a{font-size:1em;line-height:1}.single-product .twentythirteen #reply-title,.single-product .twentythirteen #respond #commentform,.single-product .twentythirteen .entry-summary{padding:0}.twentythirteen .woocommerce-breadcrumb{padding-top:40px}.twentyfourteen ul.products li.product{margin-top:0!important}body:not(.search-results) .twentysixteen .entry-summary{color:inherit;font-size:inherit;line-height:inherit}.twentysixteen .price ins{background:inherit;color:inherit} \ No newline at end of file +@charset "UTF-8";.clear,.woocommerce .woocommerce-breadcrumb:after{clear:both}@-webkit-keyframes spin{100%{-webkit-transform:rotate(360deg)}}@-moz-keyframes spin{100%{-moz-transform:rotate(360deg)}}@keyframes spin{100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-ms-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}@font-face{font-family:star;src:url(../fonts/star.eot);src:url(../fonts/star.eot?#iefix) format("embedded-opentype"),url(../fonts/star.woff) format("woff"),url(../fonts/star.ttf) format("truetype"),url(../fonts/star.svg#star) format("svg");font-weight:400;font-style:normal}@font-face{font-family:WooCommerce;src:url(../fonts/WooCommerce.eot);src:url(../fonts/WooCommerce.eot?#iefix) format("embedded-opentype"),url(../fonts/WooCommerce.woff) format("woff"),url(../fonts/WooCommerce.ttf) format("truetype"),url(../fonts/WooCommerce.svg#WooCommerce) format("svg");font-weight:400;font-style:normal}p.demo_store{position:fixed;top:0;left:0;right:0;margin:0;width:100%;font-size:1em;padding:1em 0;text-align:center;background-color:#a46497;color:#fff;z-index:99998;box-shadow:0 1px 1em rgba(0,0,0,.2)}p.demo_store a{color:#fff}.admin-bar p.demo_store{top:32px}.woocommerce .blockUI.blockOverlay{position:relative}.woocommerce .blockUI.blockOverlay:before,.woocommerce .loader:before{height:1em;width:1em;position:absolute;top:50%;left:50%;margin-left:-.5em;margin-top:-.5em;display:block;content:"";-webkit-animation:spin 1s ease-in-out infinite;-moz-animation:spin 1s ease-in-out infinite;animation:spin 1s ease-in-out infinite;background:url(../images/icons/loader.svg) center center;background-size:cover;line-height:1;text-align:center;font-size:2em;color:rgba(0,0,0,.75)}.woocommerce a.remove{display:block;font-size:1.5em;height:1em;width:1em;text-align:center;line-height:1;border-radius:100%;color:red!important;text-decoration:none;font-weight:700;border:0}.woocommerce a.remove:hover{color:#fff!important;background:red}.woocommerce small.note{display:block;color:#777;font-size:.857em;margin-top:10px}.woocommerce .woocommerce-breadcrumb{margin:0 0 1em;padding:0;font-size:.92em;color:#777}.woocommerce .woocommerce-breadcrumb:after,.woocommerce .woocommerce-breadcrumb:before{content:" ";display:table}.woocommerce .woocommerce-breadcrumb a{color:#777}.woocommerce .quantity .qty{width:3.631em;text-align:center}.woocommerce div.product{margin-bottom:0;position:relative}.woocommerce div.product .product_title{clear:none;margin-top:0;padding:0}.woocommerce #reviews #comments .add_review:after,.woocommerce .products ul:after,.woocommerce div.product form.cart:after,.woocommerce div.product p.cart:after,.woocommerce nav.woocommerce-pagination ul,.woocommerce ul.products:after{clear:both}.woocommerce div.product p.price,.woocommerce div.product span.price{color:#77a464;font-size:1.25em}.woocommerce div.product p.price ins,.woocommerce div.product span.price ins{background:inherit;font-weight:700}.woocommerce div.product p.price del,.woocommerce div.product span.price del{opacity:.5}.woocommerce div.product p.stock{font-size:.92em}.woocommerce div.product .stock{color:#77a464}.woocommerce div.product .out-of-stock{color:red}.woocommerce div.product .woocommerce-product-rating{margin-bottom:1.618em}.woocommerce div.product div.images,.woocommerce div.product div.summary{margin-bottom:2em}.woocommerce div.product div.images img{display:block;width:100%;height:auto;box-shadow:none}.woocommerce div.product div.images div.thumbnails{padding-top:1em}.woocommerce div.product div.social{text-align:right;margin:0 0 1em}.woocommerce div.product div.social span{margin:0 0 0 2px}.woocommerce div.product div.social span span{margin:0}.woocommerce div.product div.social span .stButton .chicklets{padding-left:16px;width:0}.woocommerce div.product div.social iframe{float:left;margin-top:3px}.woocommerce div.product .woocommerce-tabs ul.tabs{list-style:none;padding:0 0 0 1em;margin:0 0 1.618em;overflow:hidden;position:relative}.woocommerce div.product .woocommerce-tabs ul.tabs li{border:1px solid #d3ced2;background-color:#ebe9eb;display:inline-block;position:relative;z-index:0;border-radius:4px 4px 0 0;margin:0 -5px;padding:0 1em}.woocommerce div.product .woocommerce-tabs ul.tabs li a{display:inline-block;padding:.5em 0;font-weight:700;color:#515151;text-decoration:none}.woocommerce div.product form.cart:after,.woocommerce div.product form.cart:before,.woocommerce div.product p.cart:after,.woocommerce div.product p.cart:before{display:table;content:" "}.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover{text-decoration:none;color:#6b6b6b}.woocommerce div.product .woocommerce-tabs ul.tabs li.active{background:#fff;z-index:2;border-bottom-color:#fff}.woocommerce div.product .woocommerce-tabs ul.tabs li.active a{color:inherit;text-shadow:inherit}.woocommerce div.product .woocommerce-tabs ul.tabs li.active:before{box-shadow:2px 2px 0 #fff}.woocommerce div.product .woocommerce-tabs ul.tabs li.active:after{box-shadow:-2px 2px 0 #fff}.woocommerce div.product .woocommerce-tabs ul.tabs li:after,.woocommerce div.product .woocommerce-tabs ul.tabs li:before{border:1px solid #d3ced2;position:absolute;bottom:-1px;width:5px;height:5px;content:" "}.woocommerce div.product .woocommerce-tabs ul.tabs li:before{left:-6px;-webkit-border-bottom-right-radius:4px;-moz-border-bottom-right-radius:4px;border-bottom-right-radius:4px;border-width:0 1px 1px 0;box-shadow:2px 2px 0 #ebe9eb}.woocommerce div.product .woocommerce-tabs ul.tabs li:after{right:-6px;-webkit-border-bottom-left-radius:4px;-moz-border-bottom-left-radius:4px;border-bottom-left-radius:4px;border-width:0 0 1px 1px;box-shadow:-2px 2px 0 #ebe9eb}.woocommerce div.product .woocommerce-tabs ul.tabs:before{position:absolute;content:" ";width:100%;bottom:0;left:0;border-bottom:1px solid #d3ced2;z-index:1}.woocommerce div.product .woocommerce-tabs .panel{margin:0 0 2em;padding:0}.woocommerce div.product form.cart,.woocommerce div.product p.cart{margin-bottom:2em}.woocommerce div.product form.cart div.quantity{float:left;margin:0 4px 0 0}.woocommerce div.product form.cart table{border-width:0 0 1px}.woocommerce div.product form.cart table td{padding-left:0}.woocommerce div.product form.cart table div.quantity{float:none;margin:0}.woocommerce div.product form.cart table small.stock{display:block;float:none}.woocommerce div.product form.cart .variations{margin-bottom:1em;border:0;width:100%}.woocommerce div.product form.cart .variations td,.woocommerce div.product form.cart .variations th{border:0;vertical-align:top;line-height:2em}.woocommerce div.product form.cart .variations label{font-weight:700}.woocommerce div.product form.cart .variations select{max-width:100%;min-width:75%;display:inline-block;margin-right:1em}.woocommerce div.product form.cart .variations td.label{padding-right:1em}.woocommerce div.product form.cart .woocommerce-variation-description p{margin-bottom:1em}.woocommerce div.product form.cart .reset_variations{visibility:hidden;font-size:.83em}.woocommerce div.product form.cart .wc-no-matching-variations{display:none}.woocommerce div.product form.cart .button{vertical-align:middle;float:left}.woocommerce div.product form.cart .group_table td.label{padding-right:1em;padding-left:1em}.woocommerce div.product form.cart .group_table td{vertical-align:top;padding-bottom:.5em;border:0}.woocommerce span.onsale{min-height:3.236em;min-width:3.236em;padding:.202em;font-weight:700;position:absolute;text-align:center;line-height:3.236;top:-.5em;left:-.5em;margin:0;border-radius:100%;background-color:#77a464;color:#fff;font-size:.857em;-webkit-font-smoothing:antialiased}.woocommerce .products ul,.woocommerce ul.products{margin:0 0 1em;padding:0;list-style:none;clear:both}.woocommerce .products ul:after,.woocommerce .products ul:before,.woocommerce ul.products:after,.woocommerce ul.products:before{content:" ";display:table}.woocommerce .products ul li,.woocommerce ul.products li{list-style:none}.woocommerce ul.products li.product .onsale{top:0;right:0;left:auto;margin:-.5em -.5em 0 0}.woocommerce ul.products li.product h3{padding:.5em 0;margin:0;font-size:1em}.woocommerce ul.products li.product a{text-decoration:none}.woocommerce ul.products li.product a img{width:100%;height:auto;display:block;margin:0 0 1em;box-shadow:none}.woocommerce ul.products li.product strong{display:block}.woocommerce ul.products li.product .star-rating{font-size:.857em}.woocommerce ul.products li.product .button{margin-top:1em}.woocommerce ul.products li.product .price{color:#77a464;display:block;font-weight:400;margin-bottom:.5em;font-size:.857em}.woocommerce ul.products li.product .price del{color:inherit;opacity:.5;display:block}.woocommerce ul.products li.product .price ins{background:0 0;font-weight:700}.woocommerce ul.products li.product .price .from{font-size:.67em;margin:-2px 0 0;text-transform:uppercase;color:rgba(132,132,132,.5)}.woocommerce .woocommerce-ordering,.woocommerce .woocommerce-result-count{margin:0 0 1em}.woocommerce .woocommerce-ordering select{vertical-align:top}.woocommerce nav.woocommerce-pagination{text-align:center}.woocommerce nav.woocommerce-pagination ul{display:inline-block;white-space:nowrap;padding:0;border:1px solid #d3ced2;border-right:0;margin:1px}.woocommerce nav.woocommerce-pagination ul li{border-right:1px solid #d3ced2;padding:0;margin:0;float:left;display:inline;overflow:hidden}.woocommerce nav.woocommerce-pagination ul li a,.woocommerce nav.woocommerce-pagination ul li span{margin:0;text-decoration:none;line-height:1;font-size:1em;font-weight:400;padding:.5em;min-width:1em;display:block}.woocommerce nav.woocommerce-pagination ul li a:focus,.woocommerce nav.woocommerce-pagination ul li a:hover,.woocommerce nav.woocommerce-pagination ul li span.current{background:#ebe9eb;color:#8a7e88}.woocommerce #respond input#submit,.woocommerce a.button,.woocommerce button.button,.woocommerce input.button{font-size:100%;margin:0;line-height:1;cursor:pointer;position:relative;text-decoration:none;overflow:visible;padding:.618em 1em;font-weight:700;border-radius:3px;left:auto;color:#515151;background-color:#ebe9eb;border:0;white-space:nowrap;display:inline-block;background-image:none;box-shadow:none;-webkit-box-shadow:none;text-shadow:none}.woocommerce #respond input#submit.loading,.woocommerce a.button.loading,.woocommerce button.button.loading,.woocommerce input.button.loading{opacity:.25;padding-right:2.618em}.woocommerce #respond input#submit.loading:after,.woocommerce a.button.loading:after,.woocommerce button.button.loading:after,.woocommerce input.button.loading:after{font-family:WooCommerce;content:"\e01c";vertical-align:top;-webkit-font-smoothing:antialiased;font-weight:400;position:absolute;top:.618em;right:1em;-webkit-animation:spin 2s linear infinite;-moz-animation:spin 2s linear infinite;animation:spin 2s linear infinite}.woocommerce #respond input#submit.added:after,.woocommerce a.button.added:after,.woocommerce button.button.added:after,.woocommerce input.button.added:after{font-family:WooCommerce;content:"\e017";margin-left:.53em;vertical-align:bottom}.woocommerce #respond input#submit:hover,.woocommerce a.button:hover,.woocommerce button.button:hover,.woocommerce input.button:hover{background-color:#dad8da;text-decoration:none;background-image:none;color:#515151}.woocommerce #respond input#submit.alt,.woocommerce a.button.alt,.woocommerce button.button.alt,.woocommerce input.button.alt{background-color:#a46497;color:#fff;-webkit-font-smoothing:antialiased}.woocommerce #respond input#submit.alt:hover,.woocommerce a.button.alt:hover,.woocommerce button.button.alt:hover,.woocommerce input.button.alt:hover{background-color:#935386;color:#fff}.woocommerce #respond input#submit.alt.disabled,.woocommerce #respond input#submit.alt.disabled:hover,.woocommerce #respond input#submit.alt:disabled,.woocommerce #respond input#submit.alt:disabled:hover,.woocommerce #respond input#submit.alt:disabled[disabled],.woocommerce #respond input#submit.alt:disabled[disabled]:hover,.woocommerce a.button.alt.disabled,.woocommerce a.button.alt.disabled:hover,.woocommerce a.button.alt:disabled,.woocommerce a.button.alt:disabled:hover,.woocommerce a.button.alt:disabled[disabled],.woocommerce a.button.alt:disabled[disabled]:hover,.woocommerce button.button.alt.disabled,.woocommerce button.button.alt.disabled:hover,.woocommerce button.button.alt:disabled,.woocommerce button.button.alt:disabled:hover,.woocommerce button.button.alt:disabled[disabled],.woocommerce button.button.alt:disabled[disabled]:hover,.woocommerce input.button.alt.disabled,.woocommerce input.button.alt.disabled:hover,.woocommerce input.button.alt:disabled,.woocommerce input.button.alt:disabled:hover,.woocommerce input.button.alt:disabled[disabled],.woocommerce input.button.alt:disabled[disabled]:hover{background-color:#a46497;color:#fff}.woocommerce #respond input#submit.disabled,.woocommerce #respond input#submit:disabled,.woocommerce #respond input#submit:disabled[disabled],.woocommerce a.button.disabled,.woocommerce a.button:disabled,.woocommerce a.button:disabled[disabled],.woocommerce button.button.disabled,.woocommerce button.button:disabled,.woocommerce button.button:disabled[disabled],.woocommerce input.button.disabled,.woocommerce input.button:disabled,.woocommerce input.button:disabled[disabled]{color:inherit;cursor:not-allowed;opacity:.5;padding:.618em 1em}.woocommerce #respond input#submit.disabled:hover,.woocommerce #respond input#submit:disabled:hover,.woocommerce #respond input#submit:disabled[disabled]:hover,.woocommerce a.button.disabled:hover,.woocommerce a.button:disabled:hover,.woocommerce a.button:disabled[disabled]:hover,.woocommerce button.button.disabled:hover,.woocommerce button.button:disabled:hover,.woocommerce button.button:disabled[disabled]:hover,.woocommerce input.button.disabled:hover,.woocommerce input.button:disabled:hover,.woocommerce input.button:disabled[disabled]:hover{color:inherit;background-color:#ebe9eb}.woocommerce .cart .button,.woocommerce .cart input.button{float:none}.woocommerce a.added_to_cart{padding-top:.5em;white-space:nowrap;display:inline-block}.woocommerce #reviews #comments .add_review:after,.woocommerce #reviews #comments .add_review:before,.woocommerce #reviews #comments ol.commentlist li .comment-text:after,.woocommerce #reviews #comments ol.commentlist li .comment-text:before,.woocommerce #reviews #comments ol.commentlist:after,.woocommerce #reviews #comments ol.commentlist:before{content:" ";display:table}.woocommerce #reviews h2 small{float:right;color:#777;font-size:15px;margin:10px 0 0}.woocommerce #reviews h2 small a{text-decoration:none;color:#777}.woocommerce #reviews h3{margin:0}.woocommerce #reviews #respond{margin:0;border:0;padding:0}.woocommerce #reviews #comment{height:75px}.woocommerce #reviews #comments h2{clear:none}.woocommerce #review_form #respond:after,.woocommerce #reviews #comments ol.commentlist li .comment-text:after,.woocommerce #reviews #comments ol.commentlist:after,.woocommerce .woocommerce-product-rating:after,.woocommerce td.product-name dl.variation:after{clear:both}.woocommerce #reviews #comments ol.commentlist{margin:0;width:100%;background:0 0;list-style:none}.woocommerce #reviews #comments ol.commentlist li{padding:0;margin:0 0 20px;position:relative;background:0;border:0}.woocommerce #reviews #comments ol.commentlist li .meta{color:#777;font-size:.75em}.woocommerce #reviews #comments ol.commentlist li img.avatar{float:left;position:absolute;top:0;left:0;padding:3px;width:32px;height:auto;background:#ebe9eb;border:1px solid #e4e1e3;margin:0;box-shadow:none}.woocommerce #reviews #comments ol.commentlist li .comment-text{margin:0 0 0 50px;border:1px solid #e4e1e3;border-radius:4px;padding:1em 1em 0}.woocommerce #reviews #comments ol.commentlist li .comment-text p{margin:0 0 1em}.woocommerce #reviews #comments ol.commentlist li .comment-text p.meta{font-size:.83em}.woocommerce #reviews #comments ol.commentlist ul.children{list-style:none;margin:20px 0 0 50px}.woocommerce #reviews #comments ol.commentlist ul.children .star-rating{display:none}.woocommerce #reviews #comments ol.commentlist #respond{border:1px solid #e4e1e3;border-radius:4px;padding:1em 1em 0;margin:20px 0 0 50px}.woocommerce #reviews #comments .commentlist>li:before{content:""}.woocommerce .star-rating{float:right;overflow:hidden;position:relative;height:1em;line-height:1;font-size:1em;width:5.4em;font-family:star}.woocommerce .star-rating:before{content:"\73\73\73\73\73";color:#d3ced2;float:left;top:0;left:0;position:absolute}.woocommerce .star-rating span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}.woocommerce .star-rating span:before{content:"\53\53\53\53\53";top:0;position:absolute;left:0}.woocommerce .woocommerce-product-rating{line-height:2;display:block}.woocommerce .woocommerce-product-rating:after,.woocommerce .woocommerce-product-rating:before{content:" ";display:table}.woocommerce .woocommerce-product-rating .star-rating{margin:.5em 4px 0 0;float:left}.woocommerce .products .star-rating{display:block;margin:0 0 .5em;float:none}.woocommerce .hreview-aggregate .star-rating{margin:10px 0 0}.woocommerce #review_form #respond{position:static;margin:0;width:auto;padding:0;background:0 0;border:0}.woocommerce #review_form #respond:after,.woocommerce #review_form #respond:before{content:" ";display:table}.woocommerce p.stars a:before,.woocommerce p.stars a:hover~a:before{content:"\e021"}.woocommerce #review_form #respond p{margin:0 0 10px}.woocommerce #review_form #respond .form-submit input{left:auto}.woocommerce #review_form #respond textarea{box-sizing:border-box;width:100%}.woocommerce p.stars a{position:relative;height:1em;width:1em;text-indent:-999em;display:inline-block;text-decoration:none}.woocommerce p.stars a:before{display:block;position:absolute;top:0;left:0;width:1em;height:1em;line-height:1;font-family:WooCommerce;text-indent:0}.woocommerce table.shop_attributes td,.woocommerce table.shop_attributes th{line-height:1.5;border-bottom:1px dotted rgba(0,0,0,.1);border-top:0;margin:0}.woocommerce p.stars.selected a.active:before,.woocommerce p.stars:hover a:before{content:"\e020"}.woocommerce p.stars.selected a.active~a:before{content:"\e021"}.woocommerce p.stars.selected a:not(.active):before{content:"\e020"}.woocommerce table.shop_attributes{border:0;border-top:1px dotted rgba(0,0,0,.1);margin-bottom:1.618em;width:100%}.woocommerce table.shop_attributes th{width:150px;font-weight:700;padding:8px}.woocommerce table.shop_attributes td{font-style:italic;padding:0}.woocommerce table.shop_attributes td p{margin:0;padding:8px 0}.woocommerce table.shop_attributes .alt td,.woocommerce table.shop_attributes .alt th{background:rgba(0,0,0,.025)}.woocommerce table.shop_table{border:1px solid rgba(0,0,0,.1);margin:0 -1px 24px 0;text-align:left;width:100%;border-collapse:separate;border-radius:5px}.woocommerce table.shop_table th{font-weight:700;padding:9px 12px}.woocommerce table.shop_table td{border-top:1px solid rgba(0,0,0,.1);padding:6px 12px;vertical-align:middle}.woocommerce table.shop_table td small{font-weight:400}.woocommerce table.shop_table tbody:first-child tr:first-child td,.woocommerce table.shop_table tbody:first-child tr:first-child th{border-top:0}.woocommerce table.shop_table tbody th,.woocommerce table.shop_table tfoot td,.woocommerce table.shop_table tfoot th{font-weight:700;border-top:1px solid rgba(0,0,0,.1)}.woocommerce table.my_account_orders{font-size:.85em}.woocommerce table.my_account_orders td,.woocommerce table.my_account_orders th{padding:4px 8px;vertical-align:middle}.woocommerce table.my_account_orders .button{white-space:nowrap}.woocommerce table.my_account_orders .order-actions{text-align:right}.woocommerce table.my_account_orders .order-actions .button{margin:.125em 0 .125em .25em}.woocommerce td.product-name dl.variation{margin:.25em 0}.woocommerce td.product-name dl.variation:after,.woocommerce td.product-name dl.variation:before{content:" ";display:table}.woocommerce td.product-name dl.variation dd,.woocommerce td.product-name dl.variation dt{display:inline-block;float:left;margin-bottom:1em}.woocommerce td.product-name dl.variation dt{font-weight:700;padding:0 0 .25em;margin:0 4px 0 0;clear:left}.woocommerce ul.cart_list li dl:after,.woocommerce ul.cart_list li:after,.woocommerce ul.product_list_widget li dl:after,.woocommerce ul.product_list_widget li:after{clear:both}.woocommerce td.product-name dl.variation dd{padding:0 0 .25em}.woocommerce td.product-name dl.variation dd p:last-child{margin-bottom:0}.woocommerce td.product-name p.backorder_notification{font-size:.83em}.woocommerce td.product-quantity{min-width:80px}.woocommerce ul.cart_list,.woocommerce ul.product_list_widget{list-style:none;padding:0;margin:0}.woocommerce ul.cart_list li,.woocommerce ul.product_list_widget li{padding:4px 0;margin:0;list-style:none}.woocommerce ul.cart_list li:after,.woocommerce ul.cart_list li:before,.woocommerce ul.product_list_widget li:after,.woocommerce ul.product_list_widget li:before{content:" ";display:table}.woocommerce ul.cart_list li a,.woocommerce ul.product_list_widget li a{display:block;font-weight:700}.woocommerce ul.cart_list li img,.woocommerce ul.product_list_widget li img{float:right;margin-left:4px;width:32px;height:auto;box-shadow:none}.woocommerce ul.cart_list li dl,.woocommerce ul.product_list_widget li dl{margin:0;padding-left:1em;border-left:2px solid rgba(0,0,0,.1)}.woocommerce ul.cart_list li dl:after,.woocommerce ul.cart_list li dl:before,.woocommerce ul.product_list_widget li dl:after,.woocommerce ul.product_list_widget li dl:before{content:" ";display:table}.woocommerce ul.cart_list li dl dd,.woocommerce ul.cart_list li dl dt,.woocommerce ul.product_list_widget li dl dd,.woocommerce ul.product_list_widget li dl dt{display:inline-block;float:left;margin-bottom:1em}.woocommerce ul.cart_list li dl dt,.woocommerce ul.product_list_widget li dl dt{font-weight:700;padding:0 0 .25em;margin:0 4px 0 0;clear:left}#add_payment_method .wc-proceed-to-checkout:after,.woocommerce .order_details:after,.woocommerce .widget_layered_nav ul li:after,.woocommerce .widget_rating_filter ul li:after,.woocommerce .widget_shopping_cart .buttons:after,.woocommerce-account .addresses .title:after,.woocommerce-account .woocommerce:after,.woocommerce-cart .wc-proceed-to-checkout:after,.woocommerce-checkout .wc-proceed-to-checkout:after,.woocommerce-error:after,.woocommerce-info:after,.woocommerce-message:after,.woocommerce.widget_shopping_cart .buttons:after{clear:both}.woocommerce ul.cart_list li dl dd,.woocommerce ul.product_list_widget li dl dd{padding:0 0 .25em}.woocommerce ul.cart_list li dl dd p:last-child,.woocommerce ul.product_list_widget li dl dd p:last-child{margin-bottom:0}.woocommerce ul.cart_list li .star-rating,.woocommerce ul.product_list_widget li .star-rating{float:none}.woocommerce .widget_shopping_cart .total,.woocommerce.widget_shopping_cart .total{border-top:3px double #ebe9eb;padding:4px 0 0}.woocommerce .widget_shopping_cart .total strong,.woocommerce.widget_shopping_cart .total strong{min-width:40px;display:inline-block}.woocommerce .widget_shopping_cart .cart_list li,.woocommerce.widget_shopping_cart .cart_list li{padding-left:2em;position:relative;padding-top:0}.woocommerce .widget_shopping_cart .cart_list li a.remove,.woocommerce.widget_shopping_cart .cart_list li a.remove{position:absolute;top:0;left:0}.woocommerce .widget_shopping_cart .buttons:after,.woocommerce .widget_shopping_cart .buttons:before,.woocommerce.widget_shopping_cart .buttons:after,.woocommerce.widget_shopping_cart .buttons:before{content:" ";display:table}.woocommerce .widget_shopping_cart .buttons a,.woocommerce.widget_shopping_cart .buttons a{margin-right:5px;margin-bottom:5px}.woocommerce form .form-row{padding:3px;margin:0 0 6px}.woocommerce form .form-row [placeholder]:focus::-webkit-input-placeholder{-webkit-transition:opacity .5s .5s ease;-moz-transition:opacity .5s .5s ease;transition:opacity .5s .5s ease;opacity:0}.woocommerce form .form-row label{line-height:2}.woocommerce form .form-row label.hidden{visibility:hidden}.woocommerce form .form-row label.inline{display:inline}.woocommerce form .form-row select{cursor:pointer;margin:0}.woocommerce form .form-row .required{color:red;font-weight:700;border:0}.woocommerce form .form-row .input-checkbox{display:inline;margin:-2px 8px 0 0;text-align:center;vertical-align:middle}.woocommerce form .form-row input.input-text,.woocommerce form .form-row textarea{box-sizing:border-box;width:100%;margin:0;outline:0;line-height:1}.woocommerce form .form-row textarea{height:4em;line-height:1.5;display:block;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.woocommerce form .form-row .select2-container{width:100%;line-height:2em}.woocommerce form .form-row.woocommerce-invalid label{color:#a00}.woocommerce form .form-row.woocommerce-invalid .select2-container,.woocommerce form .form-row.woocommerce-invalid input.input-text,.woocommerce form .form-row.woocommerce-invalid select{border-color:#a00}.woocommerce form .form-row.woocommerce-validated .select2-container,.woocommerce form .form-row.woocommerce-validated input.input-text,.woocommerce form .form-row.woocommerce-validated select{border-color:#69bf29}.woocommerce form .form-row ::-webkit-input-placeholder{line-height:normal}.woocommerce form .form-row :-moz-placeholder{line-height:normal}.woocommerce form .form-row :-ms-input-placeholder{line-height:normal}.woocommerce form.checkout_coupon,.woocommerce form.login,.woocommerce form.register{border:1px solid #d3ced2;padding:20px;margin:2em 0;text-align:left;border-radius:5px}.woocommerce ul#shipping_method{list-style:none;margin:0;padding:0}.woocommerce ul#shipping_method li{margin:0;padding:.25em 0 .25em 22px;text-indent:-22px;list-style:none}.woocommerce ul#shipping_method li input{margin:3px .5ex}.woocommerce ul#shipping_method li label{display:inline}.woocommerce ul#shipping_method .amount{font-weight:700}.woocommerce p.woocommerce-shipping-contents{margin:0}.woocommerce .order_details{margin:0 0 1.5em;list-style:none}.woocommerce .order_details:after,.woocommerce .order_details:before{content:" ";display:table}.woocommerce .order_details li{float:left;margin-right:2em;text-transform:uppercase;font-size:.715em;line-height:1;border-right:1px dashed #d3ced2;padding-right:2em;margin-left:0;padding-left:0;list-style-type:none}.woocommerce .order_details li strong{display:block;font-size:1.4em;text-transform:none;line-height:1.5}.woocommerce .order_details li:last-of-type{border:none}.woocommerce .widget_layered_nav ul{margin:0;padding:0;border:0;list-style:none}.woocommerce .widget_layered_nav ul li{padding:0 0 1px;list-style:none}.woocommerce .widget_layered_nav ul li:after,.woocommerce .widget_layered_nav ul li:before{content:" ";display:table}.woocommerce .widget_layered_nav ul li.chosen a:before,.woocommerce .widget_layered_nav_filters ul li a:before{line-height:1;content:"";font-family:WooCommerce;font-weight:400;color:#a00;speak:none;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;text-decoration:none}.woocommerce .widget_layered_nav ul li a,.woocommerce .widget_layered_nav ul li span{padding:1px 0}.woocommerce .widget_layered_nav ul li.chosen a:before{margin-right:.618em}.woocommerce .widget_layered_nav_filters ul{margin:0;padding:0;border:0;list-style:none;overflow:hidden;zoom:1}.woocommerce .widget_layered_nav_filters ul li{float:left;padding:0 1px 1px 0;list-style:none}.woocommerce .widget_layered_nav_filters ul li a{text-decoration:none}.woocommerce .widget_layered_nav_filters ul li a:before{margin-right:.618em}.woocommerce .widget_price_filter .price_slider{margin-bottom:1em}.woocommerce .widget_price_filter .price_slider_amount{text-align:right;line-height:2.4;font-size:.8751em}.woocommerce .widget_price_filter .price_slider_amount .button{font-size:1.15em;float:left}.woocommerce .widget_price_filter .ui-slider{position:relative;text-align:left;margin-left:.5em;margin-right:.5em}.woocommerce .widget_price_filter .ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1em;height:1em;background-color:#a46497;border-radius:1em;cursor:ew-resize;outline:0;top:-.3em;margin-left:-.5em}.woocommerce .widget_price_filter .ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;border-radius:1em;background-color:#a46497}.woocommerce .widget_price_filter .price_slider_wrapper .ui-widget-content{border-radius:1em;background-color:#602053;border:0}.woocommerce .widget_price_filter .ui-slider-horizontal{height:.5em}.woocommerce .widget_price_filter .ui-slider-horizontal .ui-slider-range{top:0;height:100%}.woocommerce .widget_price_filter .ui-slider-horizontal .ui-slider-range-min{left:-1px}.woocommerce .widget_price_filter .ui-slider-horizontal .ui-slider-range-max{right:-1px}.woocommerce .widget_rating_filter ul{margin:0;padding:0;border:0;list-style:none}.woocommerce .widget_rating_filter ul li{padding:0 0 1px;list-style:none}.woocommerce .widget_rating_filter ul li:after,.woocommerce .widget_rating_filter ul li:before{content:" ";display:table}.woocommerce .widget_rating_filter ul li a{padding:1px 0;text-decoration:none}.woocommerce .widget_rating_filter ul li .star-rating{float:none;display:inline-block}.woocommerce .widget_rating_filter ul li.chosen a:before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-right:.618em;content:"";text-decoration:none;color:#a00}.woocommerce-error,.woocommerce-info,.woocommerce-message{padding:1em 2em 1em 3.5em!important;margin:0 0 2em!important;position:relative;background-color:#f7f6f7;color:#515151;border-top:3px solid #a46497;list-style:none!important;width:auto;word-wrap:break-word}.woocommerce-error:after,.woocommerce-error:before,.woocommerce-info:after,.woocommerce-info:before,.woocommerce-message:after,.woocommerce-message:before{content:" ";display:table}.woocommerce-error:before,.woocommerce-info:before,.woocommerce-message:before{font-family:WooCommerce;content:"\e028";display:inline-block;position:absolute;top:1em;left:1.5em}.woocommerce-error .button,.woocommerce-info .button,.woocommerce-message .button{float:right}.woocommerce-error li,.woocommerce-info li,.woocommerce-message li{list-style:none!important;padding-left:0!important;margin-left:0!important}.woocommerce-message{border-top-color:#8fae1b}.woocommerce-message:before{content:"\e015";color:#8fae1b}.woocommerce-info{border-top-color:#1e85be}.woocommerce-info:before{color:#1e85be}.woocommerce-error{border-top-color:#b81c23}.woocommerce-error:before{content:"\e016";color:#b81c23}.woocommerce-account .addresses .title:after,.woocommerce-account .addresses .title:before,.woocommerce-account .woocommerce:after,.woocommerce-account .woocommerce:before{content:" ";display:table}.woocommerce-account .addresses .title h3{float:left}.woocommerce-account .addresses .title .edit,.woocommerce-account ul.digital-downloads li .count{float:right}.woocommerce-account ol.commentlist.notes li.note p.meta{font-weight:700;margin-bottom:0}.woocommerce-account ol.commentlist.notes li.note .description p:last-child{margin-bottom:0}.woocommerce-account ul.digital-downloads{margin-left:0;padding-left:0}.woocommerce-account ul.digital-downloads li{list-style:none;margin-left:0;padding-left:0}.woocommerce-account ul.digital-downloads li:before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-right:.618em;content:"";text-decoration:none}#add_payment_method table.cart .product-thumbnail,.woocommerce-cart table.cart .product-thumbnail,.woocommerce-checkout table.cart .product-thumbnail{min-width:32px}#add_payment_method table.cart img,.woocommerce-cart table.cart img,.woocommerce-checkout table.cart img{width:32px;box-shadow:none}#add_payment_method table.cart td,#add_payment_method table.cart th,.woocommerce-cart table.cart td,.woocommerce-cart table.cart th,.woocommerce-checkout table.cart td,.woocommerce-checkout table.cart th{vertical-align:middle}#add_payment_method table.cart td.actions .coupon .input-text,.woocommerce-cart table.cart td.actions .coupon .input-text,.woocommerce-checkout table.cart td.actions .coupon .input-text{float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #d3ced2;padding:6px 6px 5px;margin:0 4px 0 0;outline:0;line-height:1}#add_payment_method table.cart input,.woocommerce-cart table.cart input,.woocommerce-checkout table.cart input{margin:0;vertical-align:middle;line-height:1}#add_payment_method .wc-proceed-to-checkout,.woocommerce-cart .wc-proceed-to-checkout,.woocommerce-checkout .wc-proceed-to-checkout{padding:1em 0}#add_payment_method .wc-proceed-to-checkout:after,#add_payment_method .wc-proceed-to-checkout:before,.woocommerce-cart .wc-proceed-to-checkout:after,.woocommerce-cart .wc-proceed-to-checkout:before,.woocommerce-checkout .wc-proceed-to-checkout:after,.woocommerce-checkout .wc-proceed-to-checkout:before{content:" ";display:table}#add_payment_method .wc-proceed-to-checkout a.checkout-button,.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,.woocommerce-checkout .wc-proceed-to-checkout a.checkout-button{display:block;text-align:center;margin-bottom:1em;font-size:1.25em;padding:1em}#add_payment_method .cart-collaterals .shipping_calculator .button,.woocommerce-cart .cart-collaterals .shipping_calculator .button,.woocommerce-checkout .cart-collaterals .shipping_calculator .button{width:100%;float:none;display:block}#add_payment_method .cart-collaterals .shipping_calculator .shipping-calculator-button:after,.woocommerce-cart .cart-collaterals .shipping_calculator .shipping-calculator-button:after,.woocommerce-checkout .cart-collaterals .shipping_calculator .shipping-calculator-button:after{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-left:.618em;content:"";text-decoration:none}#add_payment_method #payment ul.payment_methods li:after,#add_payment_method #payment ul.payment_methods li:before,#add_payment_method #payment ul.payment_methods:after,#add_payment_method #payment ul.payment_methods:before,.woocommerce-cart #payment ul.payment_methods li:after,.woocommerce-cart #payment ul.payment_methods li:before,.woocommerce-cart #payment ul.payment_methods:after,.woocommerce-cart #payment ul.payment_methods:before,.woocommerce-checkout #payment ul.payment_methods li:after,.woocommerce-checkout #payment ul.payment_methods li:before,.woocommerce-checkout #payment ul.payment_methods:after,.woocommerce-checkout #payment ul.payment_methods:before{content:" ";display:table}#add_payment_method .cart-collaterals .cart_totals p small,.woocommerce-cart .cart-collaterals .cart_totals p small,.woocommerce-checkout .cart-collaterals .cart_totals p small{color:#777;font-size:.83em}#add_payment_method .cart-collaterals .cart_totals table,.woocommerce-cart .cart-collaterals .cart_totals table,.woocommerce-checkout .cart-collaterals .cart_totals table{border-collapse:separate;margin:0 0 6px;padding:0}#add_payment_method .cart-collaterals .cart_totals table tr:first-child td,#add_payment_method .cart-collaterals .cart_totals table tr:first-child th,.woocommerce-cart .cart-collaterals .cart_totals table tr:first-child td,.woocommerce-cart .cart-collaterals .cart_totals table tr:first-child th,.woocommerce-checkout .cart-collaterals .cart_totals table tr:first-child td,.woocommerce-checkout .cart-collaterals .cart_totals table tr:first-child th{border-top:0}#add_payment_method .cart-collaterals .cart_totals table th,.woocommerce-cart .cart-collaterals .cart_totals table th,.woocommerce-checkout .cart-collaterals .cart_totals table th{width:40%}#add_payment_method .cart-collaterals .cart_totals table td,#add_payment_method .cart-collaterals .cart_totals table th,.woocommerce-cart .cart-collaterals .cart_totals table td,.woocommerce-cart .cart-collaterals .cart_totals table th,.woocommerce-checkout .cart-collaterals .cart_totals table td,.woocommerce-checkout .cart-collaterals .cart_totals table th{vertical-align:top;border-left:0;border-right:0;line-height:1.5em}#add_payment_method .cart-collaterals .cart_totals table small,.woocommerce-cart .cart-collaterals .cart_totals table small,.woocommerce-checkout .cart-collaterals .cart_totals table small{color:#777}#add_payment_method .cart-collaterals .cart_totals table select,.woocommerce-cart .cart-collaterals .cart_totals table select,.woocommerce-checkout .cart-collaterals .cart_totals table select{width:100%}#add_payment_method .cart-collaterals .cart_totals .discount td,.woocommerce-cart .cart-collaterals .cart_totals .discount td,.woocommerce-checkout .cart-collaterals .cart_totals .discount td{color:#77a464}#add_payment_method .cart-collaterals .cart_totals tr td,#add_payment_method .cart-collaterals .cart_totals tr th,.woocommerce-cart .cart-collaterals .cart_totals tr td,.woocommerce-cart .cart-collaterals .cart_totals tr th,.woocommerce-checkout .cart-collaterals .cart_totals tr td,.woocommerce-checkout .cart-collaterals .cart_totals tr th{border-top:1px solid #ebe9eb}#add_payment_method .cart-collaterals .cross-sells ul.products li.product,.woocommerce-cart .cart-collaterals .cross-sells ul.products li.product,.woocommerce-checkout .cart-collaterals .cross-sells ul.products li.product{margin-top:0}#add_payment_method .checkout .col-2 h3#ship-to-different-address,.woocommerce-cart .checkout .col-2 h3#ship-to-different-address,.woocommerce-checkout .checkout .col-2 h3#ship-to-different-address{float:left;clear:none}#add_payment_method .checkout .col-2 .form-row-first,#add_payment_method .checkout .col-2 .notes,.woocommerce-cart .checkout .col-2 .form-row-first,.woocommerce-cart .checkout .col-2 .notes,.woocommerce-checkout .checkout .col-2 .form-row-first,.woocommerce-checkout .checkout .col-2 .notes{clear:left}#add_payment_method .checkout .create-account small,.woocommerce-cart .checkout .create-account small,.woocommerce-checkout .checkout .create-account small{font-size:11px;color:#777;font-weight:400}#add_payment_method .checkout div.shipping-address,.woocommerce-cart .checkout div.shipping-address,.woocommerce-checkout .checkout div.shipping-address{padding:0;clear:left;width:100%}#add_payment_method #payment ul.payment_methods li:after,#add_payment_method #payment ul.payment_methods:after,#add_payment_method .checkout .shipping_address,.single-product .twentythirteen p.stars,.woocommerce-cart #payment ul.payment_methods li:after,.woocommerce-cart #payment ul.payment_methods:after,.woocommerce-cart .checkout .shipping_address,.woocommerce-checkout #payment ul.payment_methods li:after,.woocommerce-checkout #payment ul.payment_methods:after,.woocommerce-checkout .checkout .shipping_address{clear:both}#add_payment_method #payment,.woocommerce-cart #payment,.woocommerce-checkout #payment{background:#ebe9eb;border-radius:5px}#add_payment_method #payment ul.payment_methods,.woocommerce-cart #payment ul.payment_methods,.woocommerce-checkout #payment ul.payment_methods{text-align:left;padding:1em;border-bottom:1px solid #d3ced2;margin:0;list-style:none}#add_payment_method #payment ul.payment_methods li,.woocommerce-cart #payment ul.payment_methods li,.woocommerce-checkout #payment ul.payment_methods li{line-height:2;text-align:left;margin:0;font-weight:400}#add_payment_method #payment ul.payment_methods li input,.woocommerce-cart #payment ul.payment_methods li input,.woocommerce-checkout #payment ul.payment_methods li input{margin:0 1em 0 0}#add_payment_method #payment ul.payment_methods li img,.woocommerce-cart #payment ul.payment_methods li img,.woocommerce-checkout #payment ul.payment_methods li img{vertical-align:middle;margin:-2px 0 0 .5em;padding:0;position:relative;box-shadow:none}#add_payment_method #payment ul.payment_methods li img+img,.woocommerce-cart #payment ul.payment_methods li img+img,.woocommerce-checkout #payment ul.payment_methods li img+img{margin-left:2px}#add_payment_method #payment div.form-row,.woocommerce-cart #payment div.form-row,.woocommerce-checkout #payment div.form-row{padding:1em}#add_payment_method #payment div.payment_box,.woocommerce-cart #payment div.payment_box,.woocommerce-checkout #payment div.payment_box{position:relative;box-sizing:border-box;width:100%;padding:1em;margin:1em 0;font-size:.92em;border-radius:2px;line-height:1.5;background-color:#dfdcde;color:#515151}#add_payment_method #payment div.payment_box input.input-text,#add_payment_method #payment div.payment_box textarea,.woocommerce-cart #payment div.payment_box input.input-text,.woocommerce-cart #payment div.payment_box textarea,.woocommerce-checkout #payment div.payment_box input.input-text,.woocommerce-checkout #payment div.payment_box textarea{border-color:#bbb3b9 #c7c1c6 #c7c1c6}#add_payment_method #payment div.payment_box ::-webkit-input-placeholder,.woocommerce-cart #payment div.payment_box ::-webkit-input-placeholder,.woocommerce-checkout #payment div.payment_box ::-webkit-input-placeholder{color:#bbb3b9}#add_payment_method #payment div.payment_box :-moz-placeholder,.woocommerce-cart #payment div.payment_box :-moz-placeholder,.woocommerce-checkout #payment div.payment_box :-moz-placeholder{color:#bbb3b9}#add_payment_method #payment div.payment_box :-ms-input-placeholder,.woocommerce-cart #payment div.payment_box :-ms-input-placeholder,.woocommerce-checkout #payment div.payment_box :-ms-input-placeholder{color:#bbb3b9}#add_payment_method #payment div.payment_box .woocommerce-SavedPaymentMethods,.woocommerce-cart #payment div.payment_box .woocommerce-SavedPaymentMethods,.woocommerce-checkout #payment div.payment_box .woocommerce-SavedPaymentMethods{list-style:none;margin:0}#add_payment_method #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-new,#add_payment_method #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-token,.woocommerce-cart #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-new,.woocommerce-cart #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-token,.woocommerce-checkout #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-new,.woocommerce-checkout #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-token{margin:0 0 .5em}#add_payment_method #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-new label,#add_payment_method #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-token label,.woocommerce-cart #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-new label,.woocommerce-cart #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-token label,.woocommerce-checkout #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-new label,.woocommerce-checkout #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-token label{cursor:pointer}#add_payment_method #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-tokenInput,.woocommerce-cart #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-tokenInput,.woocommerce-checkout #payment div.payment_box .woocommerce-SavedPaymentMethods .woocommerce-SavedPaymentMethods-tokenInput{vertical-align:middle;margin:-3px 1em 0 0;position:relative}#add_payment_method #payment div.payment_box .wc-credit-card-form,.woocommerce-cart #payment div.payment_box .wc-credit-card-form,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form{border:0;padding:0;margin:1em 0 0}#add_payment_method #payment div.payment_box .wc-credit-card-form-card-cvc,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-expiry,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-number,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-cvc,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-expiry,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-number,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number{font-size:1.5em;padding:8px;background-repeat:no-repeat;background-position:right .618em center;background-size:32px 20px}#add_payment_method #payment div.payment_box .wc-credit-card-form-card-cvc.visa,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-expiry.visa,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-number.visa,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-cvc.visa,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-expiry.visa,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-number.visa,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.visa,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.visa,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.visa{background-image:url(../images/icons/credit-cards/visa.svg)}#add_payment_method #payment div.payment_box .wc-credit-card-form-card-cvc.mastercard,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-expiry.mastercard,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-number.mastercard,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-cvc.mastercard,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-expiry.mastercard,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-number.mastercard,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.mastercard,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.mastercard,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.mastercard{background-image:url(../images/icons/credit-cards/mastercard.svg)}#add_payment_method #payment div.payment_box .wc-credit-card-form-card-cvc.laser,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-expiry.laser,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-number.laser,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-cvc.laser,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-expiry.laser,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-number.laser,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.laser,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.laser,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.laser{background-image:url(../images/icons/credit-cards/laser.svg)}#add_payment_method #payment div.payment_box .wc-credit-card-form-card-cvc.dinersclub,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-expiry.dinersclub,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-number.dinersclub,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-cvc.dinersclub,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-expiry.dinersclub,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-number.dinersclub,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.dinersclub,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.dinersclub,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.dinersclub{background-image:url(../images/icons/credit-cards/diners.svg)}#add_payment_method #payment div.payment_box .wc-credit-card-form-card-cvc.maestro,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-expiry.maestro,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-number.maestro,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-cvc.maestro,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-expiry.maestro,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-number.maestro,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.maestro,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.maestro,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.maestro{background-image:url(../images/icons/credit-cards/maestro.svg)}#add_payment_method #payment div.payment_box .wc-credit-card-form-card-cvc.jcb,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-expiry.jcb,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-number.jcb,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-cvc.jcb,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-expiry.jcb,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-number.jcb,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.jcb,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.jcb,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.jcb{background-image:url(../images/icons/credit-cards/jcb.svg)}#add_payment_method #payment div.payment_box .wc-credit-card-form-card-cvc.amex,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-expiry.amex,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-number.amex,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-cvc.amex,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-expiry.amex,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-number.amex,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.amex,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.amex,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.amex{background-image:url(../images/icons/credit-cards/amex.svg)}#add_payment_method #payment div.payment_box .wc-credit-card-form-card-cvc.discover,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-expiry.discover,#add_payment_method #payment div.payment_box .wc-credit-card-form-card-number.discover,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-cvc.discover,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-expiry.discover,.woocommerce-cart #payment div.payment_box .wc-credit-card-form-card-number.discover,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.discover,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.discover,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.discover{background-image:url(../images/icons/credit-cards/discover.svg)}#add_payment_method #payment div.payment_box span.help,.woocommerce-cart #payment div.payment_box span.help,.woocommerce-checkout #payment div.payment_box span.help{font-size:.857em;color:#777;font-weight:400}#add_payment_method #payment div.payment_box .form-row,.woocommerce-cart #payment div.payment_box .form-row,.woocommerce-checkout #payment div.payment_box .form-row{margin:0 0 1em}#add_payment_method #payment div.payment_box p:last-child,.woocommerce-cart #payment div.payment_box p:last-child,.woocommerce-checkout #payment div.payment_box p:last-child{margin-bottom:0}#add_payment_method #payment div.payment_box:before,.woocommerce-cart #payment div.payment_box:before,.woocommerce-checkout #payment div.payment_box:before{content:"";display:block;border:1em solid #dfdcde;border-right-color:transparent;border-left-color:transparent;border-top-color:transparent;position:absolute;top:-.75em;left:0;margin:-1em 0 0 2em}#add_payment_method #payment .payment_method_paypal .about_paypal,.woocommerce-cart #payment .payment_method_paypal .about_paypal,.woocommerce-checkout #payment .payment_method_paypal .about_paypal{float:right;line-height:52px;font-size:.83em}#add_payment_method #payment .payment_method_paypal img,.woocommerce-cart #payment .payment_method_paypal img,.woocommerce-checkout #payment .payment_method_paypal img{max-height:52px;vertical-align:middle}.woocommerce-password-strength{text-align:center;font-weight:600;padding:3px .5em;font-size:1em}.woocommerce-password-strength.strong{background-color:#c1e1b9;border-color:#83c373}.woocommerce-password-strength.short{background-color:#f1adad;border-color:#e35b5b}.woocommerce-password-strength.bad{background-color:#fbc5a9;border-color:#f78b53}.woocommerce-password-strength.good{background-color:#ffe399;border-color:#ffc733}.woocommerce-password-hint{margin:.5em 0 0;display:block}.product.has-default-attributes.has-children>.images{opacity:0}#content.twentyeleven .woocommerce-pagination a{font-size:1em;line-height:1}.single-product .twentythirteen #reply-title,.single-product .twentythirteen #respond #commentform,.single-product .twentythirteen .entry-summary{padding:0}.twentythirteen .woocommerce-breadcrumb{padding-top:40px}.twentyfourteen ul.products li.product{margin-top:0!important}body:not(.search-results) .twentysixteen .entry-summary{color:inherit;font-size:inherit;line-height:inherit}.twentysixteen .price ins{background:inherit;color:inherit} \ No newline at end of file diff --git a/assets/css/woocommerce.scss b/assets/css/woocommerce.scss index bc243d367c0..53daff01c87 100644 --- a/assets/css/woocommerce.scss +++ b/assets/css/woocommerce.scss @@ -69,13 +69,13 @@ p.demo_store { text-align: center; line-height: 1; border-radius: 100%; - color: red !important; + color: red !important; // Required for default theme compatibility text-decoration: none; font-weight: 700; border: 0; &:hover { - color: #fff !important; + color: #fff !important; // Required for default theme compatibility background: red; } } @@ -1140,6 +1140,10 @@ p.demo_store { .buttons { @include clearfix(); + a { + margin-right: 5px; + margin-bottom: 5px; + } } } @@ -1492,13 +1496,13 @@ p.demo_store { .woocommerce-message, .woocommerce-error, .woocommerce-info { - padding: 1em 2em 1em 3.5em !important; - margin: 0 0 2em !important; + padding: 1em 2em 1em 3.5em; + margin: 0 0 2em; position: relative; background-color: lighten($secondary,5%); color: $secondarytext; border-top: 3px solid $primary; - list-style: none outside !important; + list-style: none outside; @include clearfix(); width: auto; word-wrap: break-word; @@ -1517,9 +1521,9 @@ p.demo_store { } li { - list-style: none outside !important; - padding-left: 0 !important; - margin-left: 0 !important; + list-style: none outside !important; // Required for default theme compatibility + padding-left: 0 !important; // Required for default theme compatibility + margin-left: 0 !important; // Required for default theme compatibility } } diff --git a/assets/js/admin/backbone-modal.js b/assets/js/admin/backbone-modal.js index 013a40cb787..72cc8971480 100644 --- a/assets/js/admin/backbone-modal.js +++ b/assets/js/admin/backbone-modal.js @@ -88,6 +88,8 @@ }).append( this.$el ); this.resizeContent(); + this.$el.focus(); + $( document.body ).trigger( 'init_tooltips' ); $( document.body ).trigger( 'wc_backbone_modal_loaded', this._target ); }, diff --git a/assets/js/admin/settings-views-html-settings-tax.js b/assets/js/admin/settings-views-html-settings-tax.js index 9519cf155bc..495aac4e3c2 100644 --- a/assets/js/admin/settings-views-html-settings-tax.js +++ b/assets/js/admin/settings-views-html-settings-tax.js @@ -120,7 +120,6 @@ this.listenTo( this.model, 'change:rates', this.setUnloadConfirmation ); this.listenTo( this.model, 'saved:rates', this.clearUnloadConfirmation ); $tbody.on( 'change autocompletechange', ':input', { view: this }, this.updateModelOnChange ); - $tbody.on( 'sortupdate', { view: this }, this.updateModelOnSort ); $search_field.on( 'keyup search', { view: this }, this.onSearchField ); $pagination.on( 'click', 'a', { view: this }, this.onPageChange ); $pagination.on( 'change', 'input', { view: this }, this.onPageChange ); @@ -182,13 +181,6 @@ $pagination.empty(); view.page = 1; } - - // Disable sorting if there is a search term filtering the items. - if ( $search_field.val() ) { - $tbody.sortable( 'disable' ); - } else { - $tbody.sortable( 'enable' ); - } }, updateUrl: function() { if ( ! window.history.replaceState ) { @@ -364,31 +356,6 @@ model.setRateAttribute( id, attribute, val ); }, - updateModelOnSort: function( event ) { - var view = event.data.view, - model = view.model, - rates = _.indexBy( model.get( 'rates' ), 'tax_rate_id' ), - changes = {}; - - _.each( rates, function( rate ) { - var new_position = 0; - var old_position = parseInt( rate.tax_rate_order, 10 ); - - if ( $table.find( 'tr[data-id="' + rate.tax_rate_id + '"]').length ) { - new_position = parseInt( $table.find( 'tr[data-id="' + rate.tax_rate_id + '"]').index(), 10 ) + parseInt( ( view.page - 1 ) * view.per_page, 10 ); - } else { - new_position = old_position; - } - - if ( old_position !== new_position ) { - changes[ rate.tax_rate_id ] = _.extend( changes[ rate.tax_rate_id ] || {}, { tax_rate_order : new_position } ); - } - } ); - - if ( _.size( changes ) ) { - model.logChanges( changes ); - } - }, sanitizePage: function( page_num ) { page_num = parseInt( page_num, 10 ); if ( page_num < 1 ) { diff --git a/assets/js/admin/settings-views-html-settings-tax.min.js b/assets/js/admin/settings-views-html-settings-tax.min.js index 13bf60693e9..39172b9bd62 100644 --- a/assets/js/admin/settings-views-html-settings-tax.min.js +++ b/assets/js/admin/settings-views-html-settings-tax.min.js @@ -1 +1 @@ -!function(a,b,c,d){a(function(){String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});var e=c.template("wc-tax-table-row"),f=c.template("wc-tax-table-row-empty"),g=c.template("wc-tax-table-pagination"),h=a(".wc_tax_rates"),i=a("#rates"),j=a('input[name="save"]'),k=a("#rates-pagination"),l=a("#rates-search .wc-tax-rates-search-field"),m=a(".submit .button-primary[type=submit]"),n=Backbone.Model.extend({changes:{},setRateAttribute:function(a,b,c){var d=_.indexBy(this.get("rates"),"tax_rate_id"),e={};d[a][b]!==c&&(e[a]={},e[a][b]=c,d[a][b]=c),this.logChanges(e)},logChanges:function(a){var b=this.changes||{};_.each(a,function(a,c){b[c]=_.extend(b[c]||{tax_rate_id:c},a)}),this.changes=b,this.trigger("change:rates")},getFilteredRates:function(){var a=this.get("rates"),b=l.val().toLowerCase();return b.length&&(a=_.filter(a,function(a){var c=_.toArray(a).join(" ").toLowerCase();return-1!==c.indexOf(b)})),a=_.sortBy(a,function(a){return parseInt(a.tax_rate_order,10)})},block:function(){a(".wc_tax_rates").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){a(".wc_tax_rates").unblock()},save:function(){var a=this;a.block(),Backbone.ajax({method:"POST",dataType:"json",url:d+(d.indexOf("?")>0?"&":"?")+"action=woocommerce_tax_rates_save_changes",data:{current_class:b.current_class,wc_tax_nonce:b.wc_tax_nonce,changes:a.changes},success:function(b,c){"success"===c&&(p.set("rates",b.data.rates),p.trigger("change:rates"),p.changes={},p.trigger("saved:rates"),q.render()),a.unblock()}})}}),o=Backbone.View.extend({rowTemplate:e,per_page:b.limit,page:b.page,initialize:function(){var c=Math.ceil(_.toArray(this.model.get("rates")).length/this.per_page);this.qty_pages=0===c?1:c,this.page=this.sanitizePage(b.page),this.listenTo(this.model,"change:rates",this.setUnloadConfirmation),this.listenTo(this.model,"saved:rates",this.clearUnloadConfirmation),i.on("change autocompletechange",":input",{view:this},this.updateModelOnChange),i.on("sortupdate",{view:this},this.updateModelOnSort),l.on("keyup search",{view:this},this.onSearchField),k.on("click","a",{view:this},this.onPageChange),k.on("change","input",{view:this},this.onPageChange),a(window).on("beforeunload",{view:this},this.unloadConfirmation),m.on("click",{view:this},this.onSubmit),j.attr("disabled","disabled"),h.find(".insert").on("click",{view:this},this.onAddNewRow),h.find(".remove_tax_rates").on("click",{view:this},this.onDeleteRow),h.find(".export").on("click",{view:this},this.onExport)},render:function(){var c=this.model.getFilteredRates(),d=_.size(c),e=Math.ceil(d/this.per_page),h=0===d?0:this.per_page*(this.page-1),j=this.per_page*this.page,m=_.toArray(c).slice(h,j),n=this;this.$el.empty(),m.length?a.each(m,function(a,b){n.$el.append(n.rowTemplate(b))}):n.$el.append(f()),this.$el.find("td.country input").autocomplete({source:b.countries,minLength:2}),this.$el.find("td.state input").autocomplete({source:b.states,minLength:3}),this.$el.find("td.postcode input, td.city input").change(function(){a(this).attr("name",a(this).data("name"))}),e>1?k.html(g({qty_rates:d,current_page:this.page,qty_pages:e})):(k.empty(),n.page=1),l.val()?i.sortable("disable"):i.sortable("enable")},updateUrl:function(){if(window.history.replaceState){var a=b.base_url,c=l.val();1e}),g=_.map(f,function(a){return a.tax_rate_order++,l[a.tax_rate_id]=_.extend(l[a.tax_rate_id]||{},{tax_rate_order:a.tax_rate_order}),a})):(n.tax_rate_order=1+_.max(_.pluck(k,"tax_rate_order"),function(a){return parseInt(a,10)}),h.page=h.qty_pages),k[n.tax_rate_id]=n,l[n.tax_rate_id]=n,j.set("rates",k),j.logChanges(l),h.render()},onDeleteRow:function(c){var d,e,f=c.data.view,g=f.model,h=_.indexBy(g.get("rates"),"tax_rate_id"),j={};c.preventDefault(),(d=i.children(".current"))?(d.each(function(){e=a(this).data("id"),delete h[e],j[e]=_.extend(j[e]||{},{deleted:"deleted"})}),g.set("rates",h),g.logChanges(j),f.render()):window.alert(b.strings.no_rows_selected)},onSearchField:function(a){a.data.view.updateUrl(),a.data.view.render()},onPageChange:function(b){var c=a(b.currentTarget);b.preventDefault(),b.data.view.page=c.data("goto")?c.data("goto"):c.val(),b.data.view.render(),b.data.view.updateUrl()},onExport:function(c){var d="data:application/csv;charset=utf-8,"+b.strings.csv_data_cols.join(",")+"\n";return a.each(c.data.view.model.getFilteredRates(),function(a,c){var e="";e+=c.tax_rate_country+",",e+=c.tax_rate_state+",",e+=(c.postcode?c.postcode.join("; "):"")+",",e+=(c.city?c.city.join("; "):"")+",",e+=c.tax_rate+",",e+=c.tax_rate_name+",",e+=c.tax_rate_priority+",",e+=c.tax_rate_compound+",",e+=c.tax_rate_shipping+",",e+=b.current_class,d+=e+"\n"}),a(this).attr("href",encodeURI(d)),!0},setUnloadConfirmation:function(){this.needsUnloadConfirm=!0,j.removeAttr("disabled")},clearUnloadConfirmation:function(){this.needsUnloadConfirm=!1,j.attr("disabled","disabled")},unloadConfirmation:function(a){if(a.data.view.needsUnloadConfirm)return a.returnValue=b.strings.unload_confirmation_msg,window.event.returnValue=b.strings.unload_confirmation_msg,b.strings.unload_confirmation_msg},updateModelOnChange:function(b){var c=b.data.view.model,d=a(b.target),e=d.closest("tr").data("id"),f=d.data("attribute"),g=d.val();"city"!==f&&"postcode"!==f||(g=g.split(";"),g=a.map(g,function(a){return a.trim()})),"tax_rate_compound"!==f&&"tax_rate_shipping"!==f||(g=d.is(":checked")?1:0),c.setRateAttribute(e,f,g)},updateModelOnSort:function(a){var b=a.data.view,c=b.model,d=_.indexBy(c.get("rates"),"tax_rate_id"),e={};_.each(d,function(a){var c=0,d=parseInt(a.tax_rate_order,10);c=h.find('tr[data-id="'+a.tax_rate_id+'"]').length?parseInt(h.find('tr[data-id="'+a.tax_rate_id+'"]').index(),10)+parseInt((b.page-1)*b.per_page,10):d,d!==c&&(e[a.tax_rate_id]=_.extend(e[a.tax_rate_id]||{},{tax_rate_order:c}))}),_.size(e)&&c.logChanges(e)},sanitizePage:function(a){return a=parseInt(a,10),a<1?a=1:a>this.qty_pages&&(a=this.qty_pages),a}}),p=new n({rates:b.rates}),q=new o({model:p,el:"#rates"});q.render()})}(jQuery,htmlSettingsTaxLocalizeScript,wp,ajaxurl); \ No newline at end of file +!function(a,b,c,d){a(function(){String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});var e=c.template("wc-tax-table-row"),f=c.template("wc-tax-table-row-empty"),g=c.template("wc-tax-table-pagination"),h=a(".wc_tax_rates"),i=a("#rates"),j=a('input[name="save"]'),k=a("#rates-pagination"),l=a("#rates-search .wc-tax-rates-search-field"),m=a(".submit .button-primary[type=submit]"),n=Backbone.Model.extend({changes:{},setRateAttribute:function(a,b,c){var d=_.indexBy(this.get("rates"),"tax_rate_id"),e={};d[a][b]!==c&&(e[a]={},e[a][b]=c,d[a][b]=c),this.logChanges(e)},logChanges:function(a){var b=this.changes||{};_.each(a,function(a,c){b[c]=_.extend(b[c]||{tax_rate_id:c},a)}),this.changes=b,this.trigger("change:rates")},getFilteredRates:function(){var a=this.get("rates"),b=l.val().toLowerCase();return b.length&&(a=_.filter(a,function(a){var c=_.toArray(a).join(" ").toLowerCase();return-1!==c.indexOf(b)})),a=_.sortBy(a,function(a){return parseInt(a.tax_rate_order,10)})},block:function(){a(".wc_tax_rates").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){a(".wc_tax_rates").unblock()},save:function(){var a=this;a.block(),Backbone.ajax({method:"POST",dataType:"json",url:d+(d.indexOf("?")>0?"&":"?")+"action=woocommerce_tax_rates_save_changes",data:{current_class:b.current_class,wc_tax_nonce:b.wc_tax_nonce,changes:a.changes},success:function(b,c){"success"===c&&(p.set("rates",b.data.rates),p.trigger("change:rates"),p.changes={},p.trigger("saved:rates"),q.render()),a.unblock()}})}}),o=Backbone.View.extend({rowTemplate:e,per_page:b.limit,page:b.page,initialize:function(){var c=Math.ceil(_.toArray(this.model.get("rates")).length/this.per_page);this.qty_pages=0===c?1:c,this.page=this.sanitizePage(b.page),this.listenTo(this.model,"change:rates",this.setUnloadConfirmation),this.listenTo(this.model,"saved:rates",this.clearUnloadConfirmation),i.on("change autocompletechange",":input",{view:this},this.updateModelOnChange),l.on("keyup search",{view:this},this.onSearchField),k.on("click","a",{view:this},this.onPageChange),k.on("change","input",{view:this},this.onPageChange),a(window).on("beforeunload",{view:this},this.unloadConfirmation),m.on("click",{view:this},this.onSubmit),j.attr("disabled","disabled"),h.find(".insert").on("click",{view:this},this.onAddNewRow),h.find(".remove_tax_rates").on("click",{view:this},this.onDeleteRow),h.find(".export").on("click",{view:this},this.onExport)},render:function(){var c=this.model.getFilteredRates(),d=_.size(c),e=Math.ceil(d/this.per_page),h=0===d?0:this.per_page*(this.page-1),i=this.per_page*this.page,j=_.toArray(c).slice(h,i),l=this;this.$el.empty(),j.length?a.each(j,function(a,b){l.$el.append(l.rowTemplate(b))}):l.$el.append(f()),this.$el.find("td.country input").autocomplete({source:b.countries,minLength:2}),this.$el.find("td.state input").autocomplete({source:b.states,minLength:3}),this.$el.find("td.postcode input, td.city input").change(function(){a(this).attr("name",a(this).data("name"))}),e>1?k.html(g({qty_rates:d,current_page:this.page,qty_pages:e})):(k.empty(),l.page=1)},updateUrl:function(){if(window.history.replaceState){var a=b.base_url,c=l.val();1e}),g=_.map(f,function(a){return a.tax_rate_order++,l[a.tax_rate_id]=_.extend(l[a.tax_rate_id]||{},{tax_rate_order:a.tax_rate_order}),a})):(n.tax_rate_order=1+_.max(_.pluck(k,"tax_rate_order"),function(a){return parseInt(a,10)}),h.page=h.qty_pages),k[n.tax_rate_id]=n,l[n.tax_rate_id]=n,j.set("rates",k),j.logChanges(l),h.render()},onDeleteRow:function(c){var d,e,f=c.data.view,g=f.model,h=_.indexBy(g.get("rates"),"tax_rate_id"),j={};c.preventDefault(),(d=i.children(".current"))?(d.each(function(){e=a(this).data("id"),delete h[e],j[e]=_.extend(j[e]||{},{deleted:"deleted"})}),g.set("rates",h),g.logChanges(j),f.render()):window.alert(b.strings.no_rows_selected)},onSearchField:function(a){a.data.view.updateUrl(),a.data.view.render()},onPageChange:function(b){var c=a(b.currentTarget);b.preventDefault(),b.data.view.page=c.data("goto")?c.data("goto"):c.val(),b.data.view.render(),b.data.view.updateUrl()},onExport:function(c){var d="data:application/csv;charset=utf-8,"+b.strings.csv_data_cols.join(",")+"\n";return a.each(c.data.view.model.getFilteredRates(),function(a,c){var e="";e+=c.tax_rate_country+",",e+=c.tax_rate_state+",",e+=(c.postcode?c.postcode.join("; "):"")+",",e+=(c.city?c.city.join("; "):"")+",",e+=c.tax_rate+",",e+=c.tax_rate_name+",",e+=c.tax_rate_priority+",",e+=c.tax_rate_compound+",",e+=c.tax_rate_shipping+",",e+=b.current_class,d+=e+"\n"}),a(this).attr("href",encodeURI(d)),!0},setUnloadConfirmation:function(){this.needsUnloadConfirm=!0,j.removeAttr("disabled")},clearUnloadConfirmation:function(){this.needsUnloadConfirm=!1,j.attr("disabled","disabled")},unloadConfirmation:function(a){if(a.data.view.needsUnloadConfirm)return a.returnValue=b.strings.unload_confirmation_msg,window.event.returnValue=b.strings.unload_confirmation_msg,b.strings.unload_confirmation_msg},updateModelOnChange:function(b){var c=b.data.view.model,d=a(b.target),e=d.closest("tr").data("id"),f=d.data("attribute"),g=d.val();"city"!==f&&"postcode"!==f||(g=g.split(";"),g=a.map(g,function(a){return a.trim()})),"tax_rate_compound"!==f&&"tax_rate_shipping"!==f||(g=d.is(":checked")?1:0),c.setRateAttribute(e,f,g)},sanitizePage:function(a){return a=parseInt(a,10),a<1?a=1:a>this.qty_pages&&(a=this.qty_pages),a}}),p=new n({rates:b.rates}),q=new o({model:p,el:"#rates"});q.render()})}(jQuery,htmlSettingsTaxLocalizeScript,wp,ajaxurl); \ No newline at end of file diff --git a/assets/js/admin/wc-enhanced-select.js b/assets/js/admin/wc-enhanced-select.js index 2cae8dd951d..4163f0532bf 100644 --- a/assets/js/admin/wc-enhanced-select.js +++ b/assets/js/admin/wc-enhanced-select.js @@ -146,8 +146,19 @@ jQuery( function( $ ) { select2_args = $.extend( select2_args, getEnhancedSelectFormatString() ); $( this ).select2( select2_args ).addClass( 'enhanced' ); + + if ( $( this ).data( 'sortable' ) ) { + $( this ).select2( 'container' ).find( 'ul.select2-choices' ).sortable({ + containment: 'parent', + start: function() { $( this ).select2( 'onSortStart' ); }, + update: function() { $( this ).select2( 'onSortEnd' ); } + }); + } + }); + + // Ajax customer search boxes $( ':input.wc-customer-search' ).filter( ':not(.enhanced)' ).each( function() { var select2_args = { @@ -215,6 +226,15 @@ jQuery( function( $ ) { select2_args = $.extend( select2_args, getEnhancedSelectFormatString() ); $( this ).select2( select2_args ).addClass( 'enhanced' ); + + if ( $( this ).data( 'sortable' ) ) { + $( this ).select2( 'container' ).find( 'ul.select2-choices' ).sortable({ + containment: 'parent', + start: function() { $( this ).select2( 'onSortStart' ); }, + update: function() { $( this ).select2( 'onSortEnd' ); } + }); + } + }); }) diff --git a/assets/js/admin/wc-enhanced-select.min.js b/assets/js/admin/wc-enhanced-select.min.js index ec8ce8f0f87..18e3f662003 100644 --- a/assets/js/admin/wc-enhanced-select.min.js +++ b/assets/js/admin/wc-enhanced-select.min.js @@ -1 +1 @@ -jQuery(function(a){function b(){var a={formatMatches:function(a){return 1===a?wc_enhanced_select_params.i18n_matches_1:wc_enhanced_select_params.i18n_matches_n.replace("%qty%",a)},formatNoMatches:function(){return wc_enhanced_select_params.i18n_no_matches},formatAjaxError:function(){return wc_enhanced_select_params.i18n_ajax_error},formatInputTooShort:function(a,b){var c=b-a.length;return 1===c?wc_enhanced_select_params.i18n_input_too_short_1:wc_enhanced_select_params.i18n_input_too_short_n.replace("%qty%",c)},formatInputTooLong:function(a,b){var c=a.length-b;return 1===c?wc_enhanced_select_params.i18n_input_too_long_1:wc_enhanced_select_params.i18n_input_too_long_n.replace("%qty%",c)},formatSelectionTooBig:function(a){return 1===a?wc_enhanced_select_params.i18n_selection_too_long_1:wc_enhanced_select_params.i18n_selection_too_long_n.replace("%qty%",a)},formatLoadMore:function(){return wc_enhanced_select_params.i18n_load_more},formatSearching:function(){return wc_enhanced_select_params.i18n_searching}};return a}a(document.body).on("wc-enhanced-select-init",function(){a(":input.wc-enhanced-select, :input.chosen_select").filter(":not(.enhanced)").each(function(){var c=a.extend({minimumResultsForSearch:10,allowClear:!!a(this).data("allow_clear"),placeholder:a(this).data("placeholder")},b());a(this).select2(c).addClass("enhanced")}),a(":input.wc-enhanced-select-nostd, :input.chosen_select_nostd").filter(":not(.enhanced)").each(function(){var c=a.extend({minimumResultsForSearch:10,allowClear:!0,placeholder:a(this).data("placeholder")},b());a(this).select2(c).addClass("enhanced")}),a(":input.wc-product-search").filter(":not(.enhanced)").each(function(){var c={allowClear:!!a(this).data("allow_clear"),placeholder:a(this).data("placeholder"),minimumInputLength:a(this).data("minimum_input_length")?a(this).data("minimum_input_length"):"3",escapeMarkup:function(a){return a},ajax:{url:wc_enhanced_select_params.ajax_url,dataType:"json",quietMillis:250,data:function(b){return{term:b,action:a(this).data("action")||"woocommerce_json_search_products_and_variations",security:wc_enhanced_select_params.search_products_nonce,exclude:a(this).data("exclude"),include:a(this).data("include"),limit:a(this).data("limit")}},results:function(b){var c=[];return b&&a.each(b,function(a,b){c.push({id:a,text:b})}),{results:c}},cache:!0}};a(this).data("multiple")===!0?(c.multiple=!0,c.initSelection=function(b,c){var d=a.parseJSON(b.attr("data-selected")),e=[];return a(b.val().split(",")).each(function(a,b){e.push({id:b,text:d[b]})}),c(e)},c.formatSelection=function(a){return'
'+a.text+"
"}):(c.multiple=!1,c.initSelection=function(a,b){var c={id:a.val(),text:a.attr("data-selected")};return b(c)}),c=a.extend(c,b()),a(this).select2(c).addClass("enhanced")}),a(":input.wc-customer-search").filter(":not(.enhanced)").each(function(){var c={allowClear:!!a(this).data("allow_clear"),placeholder:a(this).data("placeholder"),minimumInputLength:a(this).data("minimum_input_length")?a(this).data("minimum_input_length"):"3",escapeMarkup:function(a){return a},ajax:{url:wc_enhanced_select_params.ajax_url,dataType:"json",quietMillis:250,data:function(b){return{term:b,action:"woocommerce_json_search_customers",security:wc_enhanced_select_params.search_customers_nonce,exclude:a(this).data("exclude")}},results:function(b){var c=[];return b&&a.each(b,function(a,b){c.push({id:a,text:b})}),{results:c}},cache:!0}};a(this).data("multiple")===!0?(c.multiple=!0,c.initSelection=function(b,c){var d=a.parseJSON(b.attr("data-selected")),e=[];return a(b.val().split(",")).each(function(a,b){e.push({id:b,text:d[b]})}),c(e)},c.formatSelection=function(a){return'
'+a.text+"
"}):(c.multiple=!1,c.initSelection=function(a,b){var c={id:a.val(),text:a.attr("data-selected")};return b(c)}),c=a.extend(c,b()),a(this).select2(c).addClass("enhanced")})}).on("wc_backbone_modal_before_remove",function(){a(":input.wc-enhanced-select, :input.wc-product-search, :input.wc-customer-search").select2("close")}).trigger("wc-enhanced-select-init")}); \ No newline at end of file +jQuery(function(a){function b(){var a={formatMatches:function(a){return 1===a?wc_enhanced_select_params.i18n_matches_1:wc_enhanced_select_params.i18n_matches_n.replace("%qty%",a)},formatNoMatches:function(){return wc_enhanced_select_params.i18n_no_matches},formatAjaxError:function(){return wc_enhanced_select_params.i18n_ajax_error},formatInputTooShort:function(a,b){var c=b-a.length;return 1===c?wc_enhanced_select_params.i18n_input_too_short_1:wc_enhanced_select_params.i18n_input_too_short_n.replace("%qty%",c)},formatInputTooLong:function(a,b){var c=a.length-b;return 1===c?wc_enhanced_select_params.i18n_input_too_long_1:wc_enhanced_select_params.i18n_input_too_long_n.replace("%qty%",c)},formatSelectionTooBig:function(a){return 1===a?wc_enhanced_select_params.i18n_selection_too_long_1:wc_enhanced_select_params.i18n_selection_too_long_n.replace("%qty%",a)},formatLoadMore:function(){return wc_enhanced_select_params.i18n_load_more},formatSearching:function(){return wc_enhanced_select_params.i18n_searching}};return a}a(document.body).on("wc-enhanced-select-init",function(){a(":input.wc-enhanced-select, :input.chosen_select").filter(":not(.enhanced)").each(function(){var c=a.extend({minimumResultsForSearch:10,allowClear:!!a(this).data("allow_clear"),placeholder:a(this).data("placeholder")},b());a(this).select2(c).addClass("enhanced")}),a(":input.wc-enhanced-select-nostd, :input.chosen_select_nostd").filter(":not(.enhanced)").each(function(){var c=a.extend({minimumResultsForSearch:10,allowClear:!0,placeholder:a(this).data("placeholder")},b());a(this).select2(c).addClass("enhanced")}),a(":input.wc-product-search").filter(":not(.enhanced)").each(function(){var c={allowClear:!!a(this).data("allow_clear"),placeholder:a(this).data("placeholder"),minimumInputLength:a(this).data("minimum_input_length")?a(this).data("minimum_input_length"):"3",escapeMarkup:function(a){return a},ajax:{url:wc_enhanced_select_params.ajax_url,dataType:"json",quietMillis:250,data:function(b){return{term:b,action:a(this).data("action")||"woocommerce_json_search_products_and_variations",security:wc_enhanced_select_params.search_products_nonce,exclude:a(this).data("exclude"),include:a(this).data("include"),limit:a(this).data("limit")}},results:function(b){var c=[];return b&&a.each(b,function(a,b){c.push({id:a,text:b})}),{results:c}},cache:!0}};a(this).data("multiple")===!0?(c.multiple=!0,c.initSelection=function(b,c){var d=a.parseJSON(b.attr("data-selected")),e=[];return a(b.val().split(",")).each(function(a,b){e.push({id:b,text:d[b]})}),c(e)},c.formatSelection=function(a){return'
'+a.text+"
"}):(c.multiple=!1,c.initSelection=function(a,b){var c={id:a.val(),text:a.attr("data-selected")};return b(c)}),c=a.extend(c,b()),a(this).select2(c).addClass("enhanced"),a(this).data("sortable")===!0&&a(this).select2("container").find("ul.select2-choices").sortable({containment:"parent",start:function(){a(this).select2("onSortStart")},update:function(){a(this).select2("onSortEnd")}})}),a(":input.wc-customer-search").filter(":not(.enhanced)").each(function(){var c={allowClear:!!a(this).data("allow_clear"),placeholder:a(this).data("placeholder"),minimumInputLength:a(this).data("minimum_input_length")?a(this).data("minimum_input_length"):"3",escapeMarkup:function(a){return a},ajax:{url:wc_enhanced_select_params.ajax_url,dataType:"json",quietMillis:250,data:function(b){return{term:b,action:"woocommerce_json_search_customers",security:wc_enhanced_select_params.search_customers_nonce,exclude:a(this).data("exclude")}},results:function(b){var c=[];return b&&a.each(b,function(a,b){c.push({id:a,text:b})}),{results:c}},cache:!0}};a(this).data("multiple")===!0?(c.multiple=!0,c.initSelection=function(b,c){var d=a.parseJSON(b.attr("data-selected")),e=[];return a(b.val().split(",")).each(function(a,b){e.push({id:b,text:d[b]})}),c(e)},c.formatSelection=function(a){return'
'+a.text+"
"}):(c.multiple=!1,c.initSelection=function(a,b){var c={id:a.val(),text:a.attr("data-selected")};return b(c)}),c=a.extend(c,b()),a(this).select2(c).addClass("enhanced"),a(this).data("sortable")===!0&&a(this).select2("container").find("ul.select2-choices").sortable({containment:"parent",start:function(){a(this).select2("onSortStart")},update:function(){a(this).select2("onSortEnd")}})})}).on("wc_backbone_modal_before_remove",function(){a(":input.wc-enhanced-select, :input.wc-product-search, :input.wc-customer-search").select2("close")}).trigger("wc-enhanced-select-init")}); \ No newline at end of file diff --git a/assets/js/admin/wc-shipping-zones.js b/assets/js/admin/wc-shipping-zones.js index f32404941f9..2b98cb9da8b 100644 --- a/assets/js/admin/wc-shipping-zones.js +++ b/assets/js/admin/wc-shipping-zones.js @@ -213,14 +213,14 @@ return parseInt( method.method_order, 10 ); } ); - _.each( shipping_methods, function( shipping_method, instance_id ) { + _.each( shipping_methods, function( shipping_method ) { var class_name = 'method_disabled'; if ( 'yes' === shipping_method.enabled ) { class_name = 'method_enabled'; } - $method_list.append( '
  • ' + shipping_method.title + '
  • ' ); + $method_list.append( '
  • ' + shipping_method.title + '
  • ' ); } ); } else { $method_list.append( '
  • ' + data.strings.no_shipping_methods_offered + '
  • ' ); diff --git a/assets/js/admin/wc-shipping-zones.min.js b/assets/js/admin/wc-shipping-zones.min.js index 21506e4556b..53e3c280932 100644 --- a/assets/js/admin/wc-shipping-zones.min.js +++ b/assets/js/admin/wc-shipping-zones.min.js @@ -1 +1 @@ -!function(a,b,c,d){a(function(){function e(){var a={formatMatches:function(a){return 1===a?wc_enhanced_select_params.i18n_matches_1:wc_enhanced_select_params.i18n_matches_n.replace("%qty%",a)},formatNoMatches:function(){return wc_enhanced_select_params.i18n_no_matches},formatAjaxError:function(){return wc_enhanced_select_params.i18n_ajax_error},formatInputTooShort:function(a,b){var c=b-a.length;return 1===c?wc_enhanced_select_params.i18n_input_too_short_1:wc_enhanced_select_params.i18n_input_too_short_n.replace("%qty%",c)},formatInputTooLong:function(a,b){var c=a.length-b;return 1===c?wc_enhanced_select_params.i18n_input_too_long_1:wc_enhanced_select_params.i18n_input_too_long_n.replace("%qty%",c)},formatSelectionTooBig:function(a){return 1===a?wc_enhanced_select_params.i18n_selection_too_long_1:wc_enhanced_select_params.i18n_selection_too_long_n.replace("%qty%",a)},formatLoadMore:function(){return wc_enhanced_select_params.i18n_load_more},formatSearching:function(){return wc_enhanced_select_params.i18n_searching}};return a}var f=a(".wc-shipping-zones"),g=a(".wc-shipping-zone-rows"),h=a(".wc-shipping-zone-save"),i=c.template("wc-shipping-zone-row"),j=c.template("wc-shipping-zone-row-blank"),k=a.extend({minimumResultsForSearch:10,allowClear:!!a(this).data("allow_clear"),placeholder:a(this).data("placeholder"),matcher:function(a,b,c){return b.toUpperCase().indexOf(a.toUpperCase())>=0||c.attr("alt").toUpperCase().indexOf(a.toUpperCase())>=0}},e()),l=Backbone.Model.extend({changes:{},logChanges:function(a){var b=this.changes||{};_.each(a,function(a,c){b[c]=_.extend(b[c]||{zone_id:c},a)}),this.changes=b,this.trigger("change:zones")},discardChanges:function(a){var b=this.changes||{},c=null,d=_.indexBy(this.get("zones"),"zone_id");b[a]&&void 0!==b[a].zone_order&&(c=b[a].zone_order),delete b[a],null!==c&&d[a]&&d[a].zone_order!==c&&(b[a]=_.extend(b[a]||{},{zone_id:a,zone_order:c})),this.changes=b,0===_.size(this.changes)&&o.clearUnloadConfirmation()},save:function(){_.size(this.changes)?a.post(d+(d.indexOf("?")>0?"&":"?")+"action=woocommerce_shipping_zones_save_changes",{wc_shipping_zones_nonce:b.wc_shipping_zones_nonce,changes:this.changes},this.onSaveResponse,"json"):n.trigger("saved:zones")},onSaveResponse:function(a,c){"success"===c&&(a.success?(n.set("zones",a.data.zones),n.trigger("change:zones"),n.changes={},n.trigger("saved:zones")):window.alert(b.strings.save_failed))}}),m=Backbone.View.extend({rowTemplate:i,initialize:function(){this.listenTo(this.model,"change:zones",this.setUnloadConfirmation),this.listenTo(this.model,"saved:zones",this.clearUnloadConfirmation),this.listenTo(this.model,"saved:zones",this.render),g.on("change",{view:this},this.updateModelOnChange),g.on("sortupdate",{view:this},this.updateModelOnSort),a(window).on("beforeunload",{view:this},this.unloadConfirmation),h.on("click",{view:this},this.onSubmit),a(document.body).on("click",".add_shipping_method:not(.disabled)",{view:this},this.onAddShippingMethod),a(document.body).on("click",".wc-shipping-zone-add",{view:this},this.onAddNewRow),a(document.body).on("wc_backbone_modal_response",this.onAddShippingMethodSubmitted),a(document.body).on("change",".wc-shipping-zone-method-selector select",this.onChangeShippingMethodSelector)},block:function(){a(this.el).block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){a(this.el).unblock()},render:function(){var b=_.indexBy(this.model.get("zones"),"zone_id"),c=this;c.$el.empty(),c.unblock(),_.size(b)?(b=_.sortBy(b,function(a){return parseInt(a.zone_order,10)}),a.each(b,function(a,b){c.renderRow(b)})):c.$el.append(j),c.initRows()},renderRow:function(a){var b=this;b.$el.append(b.rowTemplate(a)),b.initRow(a)},initRow:function(a){var b=this,c=b.$el.find('tr[data-id="'+a.zone_id+'"]');_.each(a.zone_locations,function(a){if("string"===jQuery.type(a))c.find('option[value="'+a+'"]').prop("selected",!0);else if("postcode"===a.type){var b=c.find(".wc-shipping-zone-postcodes :input");b.val()?b.val(b.val()+"\n"+a.code):b.val(a.code),c.find(".wc-shipping-zone-postcodes").show(),c.find(".wc-shipping-zone-postcodes-toggle").hide()}else c.find('option[value="'+a.type+":"+a.code+'"]').prop("selected",!0)}),a.zone_postcodes&&_.each(a.zone_postcodes,function(a){var b=c.find(".wc-shipping-zone-postcodes :input");b.val()?b.val(b.val()+"\n"+a.code):b.val(a.code),c.find(".wc-shipping-zone-postcodes").show(),c.find(".wc-shipping-zone-postcodes-toggle").hide()}),b.renderShippingMethods(a.zone_id,a.shipping_methods),c.find(".view").show(),c.find(".edit").hide(),c.find(".wc-shipping-zone-edit").on("click",{view:this},this.onEditRow),c.find(".wc-shipping-zone-cancel-edit").on("click",{view:this},this.onCancelEditRow),c.find(".wc-shipping-zone-delete").on("click",{view:this},this.onDeleteRow),c.find(".wc-shipping-zone-postcodes-toggle").on("click",{view:this},this.onTogglePostcodes),!0===a.editing&&(c.addClass("editing"),c.find(".wc-shipping-zone-edit").trigger("click"))},initRows:function(){0===a("tbody.wc-shipping-zone-rows tr").length%2?f.find("tbody.wc-shipping-zone-rows").next("tbody").find("tr").addClass("odd"):f.find("tbody.wc-shipping-zone-rows").next("tbody").find("tr").removeClass("odd"),a("#tiptip_holder").removeAttr("style"),a("#tiptip_arrow").removeAttr("style"),a(".tips").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:50})},renderShippingMethods:function(c,d){var e=a('.wc-shipping-zones tr[data-id="'+c+'"]'),f=e.find(".wc-shipping-zone-methods ul");f.find(".wc-shipping-zone-method").remove(),_.size(d)?(d=_.sortBy(d,function(a){return parseInt(a.method_order,10)}),_.each(d,function(a,b){var c="method_disabled";"yes"===a.enabled&&(c="method_enabled"),f.append('
  • '+a.title+"
  • ")})):f.append('
  • '+b.strings.no_shipping_methods_offered+"
  • ")},onSubmit:function(a){a.data.view.block(),a.data.view.model.save(),a.preventDefault()},onAddNewRow:function(c){c.preventDefault();var d=c.data.view,e=d.model,f=_.indexBy(e.get("zones"),"zone_id"),g={},h=_.size(f),i=_.extend({},b.default_zone,{zone_id:"new-"+h+"-"+Date.now(),editing:!0});a(".wc-shipping-zones-blank-state").closest("tr").remove(),i.zone_order=1+_.max(_.pluck(f,"zone_order"),function(a){return parseInt(a,10)}),g[i.zone_id]=i,e.logChanges(g),d.renderRow(i),d.initRows()},onTogglePostcodes:function(b){b.preventDefault();var c=a(this).closest("tr");c.find(".wc-shipping-zone-postcodes").show(),c.find(".wc-shipping-zone-postcodes-toggle").hide()},onEditRow:function(b){b.preventDefault(),b.data.view.model.trigger("change:zones"),a(this).closest("tr").addClass("editing"),a(this).closest("tr").find(".view").hide(),a(this).closest("tr").find(".edit").show(),a(".wc-shipping-zone-region-select:not(.enhanced)").select2(k),a(".wc-shipping-zone-region-select:not(.enhanced)").addClass("enhanced");var c=a(this).closest("tr").find(".add_shipping_method");c.addClass("disabled"),c.tipTip({attribute:"data-disabled-tip",fadeIn:50,fadeOut:50,delay:50})},onCancelEditRow:function(b){var c=b.data.view,d=c.model,e=a(this).closest("tr"),f=e.data("id"),g=_.indexBy(d.get("zones"),"zone_id");b.preventDefault(),d.discardChanges(f),g[f]&&(g[f].editing=!1,e.after(c.rowTemplate(g[f])),c.initRow(g[f])),e.remove(),c.initRows()},onDeleteRow:function(b){var c=b.data.view,d=c.model,e=_.indexBy(d.get("zones"),"zone_id"),f={},g=a(this).closest("tr"),h=a(this).closest("tr").data("id");b.preventDefault(),e[h]&&(delete e[h],f[h]=_.extend(f[h]||{},{deleted:"deleted"}),d.set("zones",e),d.logChanges(f)),g.remove(),c.initRows()},setUnloadConfirmation:function(){this.needsUnloadConfirm=!0,h.prop("disabled",!1)},clearUnloadConfirmation:function(){this.needsUnloadConfirm=!1,h.prop("disabled",!0)},unloadConfirmation:function(a){if(a.data.view.needsUnloadConfirm)return a.returnValue=b.strings.unload_confirmation_msg,window.event.returnValue=b.strings.unload_confirmation_msg,b.strings.unload_confirmation_msg},updateModelOnChange:function(b){var c=b.data.view.model,d=a(b.target),e=d.closest("tr").data("id"),f=d.data("attribute"),g=d.val(),h=_.indexBy(c.get("zones"),"zone_id"),i={};h[e]&&h[e][f]===g||(i[e]={},i[e][f]=g),c.logChanges(i)},updateModelOnSort:function(b){var c=b.data.view,d=c.model,e=_.indexBy(d.get("zones"),"zone_id"),f=a("tbody.wc-shipping-zone-rows tr"),g={};_.each(f,function(b){var c=a(b).data("id"),d=null,f=parseInt(a(b).index(),10);e[c]&&(d=parseInt(e[c].zone_order,10)),d!==f&&(g[c]=_.extend(g[c]||{},{zone_order:f}))}),_.size(g)&&d.logChanges(g)},onAddShippingMethod:function(b){var c=a(this).closest("tr").data("id");b.preventDefault(),a(this).WCBackboneModal({template:"wc-modal-add-shipping-method",variable:{zone_id:c}}),a(".wc-shipping-zone-method-selector select").change()},onAddShippingMethodSubmitted:function(c,e,f){"wc-modal-add-shipping-method"===e&&(o.block(),a.post(d+(d.indexOf("?")>0?"&":"?")+"action=woocommerce_shipping_zone_add_method",{wc_shipping_zones_nonce:b.wc_shipping_zones_nonce,method_id:f.add_method_id,zone_id:f.zone_id},function(a,b){"success"===b&&a.success&&o.renderShippingMethods(f.zone_id,a.data.methods),o.unblock()},"json"))},onChangeShippingMethodSelector:function(){var b=a(this).find("option:selected").data("description");a(this).parent().find(".wc-shipping-zone-method-description").remove(),a(this).after('

    '+b+"

    "),a(this).closest("article").height(a(this).parent().height())}}),n=new l({zones:b.zones}),o=new m({model:n,el:g});o.render(),g.sortable({items:"tr",cursor:"move",axis:"y",handle:"td.wc-shipping-zone-sort",scrollSensitivity:40})})}(jQuery,shippingZonesLocalizeScript,wp,ajaxurl); \ No newline at end of file +!function(a,b,c,d){a(function(){function e(){var a={formatMatches:function(a){return 1===a?wc_enhanced_select_params.i18n_matches_1:wc_enhanced_select_params.i18n_matches_n.replace("%qty%",a)},formatNoMatches:function(){return wc_enhanced_select_params.i18n_no_matches},formatAjaxError:function(){return wc_enhanced_select_params.i18n_ajax_error},formatInputTooShort:function(a,b){var c=b-a.length;return 1===c?wc_enhanced_select_params.i18n_input_too_short_1:wc_enhanced_select_params.i18n_input_too_short_n.replace("%qty%",c)},formatInputTooLong:function(a,b){var c=a.length-b;return 1===c?wc_enhanced_select_params.i18n_input_too_long_1:wc_enhanced_select_params.i18n_input_too_long_n.replace("%qty%",c)},formatSelectionTooBig:function(a){return 1===a?wc_enhanced_select_params.i18n_selection_too_long_1:wc_enhanced_select_params.i18n_selection_too_long_n.replace("%qty%",a)},formatLoadMore:function(){return wc_enhanced_select_params.i18n_load_more},formatSearching:function(){return wc_enhanced_select_params.i18n_searching}};return a}var f=a(".wc-shipping-zones"),g=a(".wc-shipping-zone-rows"),h=a(".wc-shipping-zone-save"),i=c.template("wc-shipping-zone-row"),j=c.template("wc-shipping-zone-row-blank"),k=a.extend({minimumResultsForSearch:10,allowClear:!!a(this).data("allow_clear"),placeholder:a(this).data("placeholder"),matcher:function(a,b,c){return b.toUpperCase().indexOf(a.toUpperCase())>=0||c.attr("alt").toUpperCase().indexOf(a.toUpperCase())>=0}},e()),l=Backbone.Model.extend({changes:{},logChanges:function(a){var b=this.changes||{};_.each(a,function(a,c){b[c]=_.extend(b[c]||{zone_id:c},a)}),this.changes=b,this.trigger("change:zones")},discardChanges:function(a){var b=this.changes||{},c=null,d=_.indexBy(this.get("zones"),"zone_id");b[a]&&void 0!==b[a].zone_order&&(c=b[a].zone_order),delete b[a],null!==c&&d[a]&&d[a].zone_order!==c&&(b[a]=_.extend(b[a]||{},{zone_id:a,zone_order:c})),this.changes=b,0===_.size(this.changes)&&o.clearUnloadConfirmation()},save:function(){_.size(this.changes)?a.post(d+(d.indexOf("?")>0?"&":"?")+"action=woocommerce_shipping_zones_save_changes",{wc_shipping_zones_nonce:b.wc_shipping_zones_nonce,changes:this.changes},this.onSaveResponse,"json"):n.trigger("saved:zones")},onSaveResponse:function(a,c){"success"===c&&(a.success?(n.set("zones",a.data.zones),n.trigger("change:zones"),n.changes={},n.trigger("saved:zones")):window.alert(b.strings.save_failed))}}),m=Backbone.View.extend({rowTemplate:i,initialize:function(){this.listenTo(this.model,"change:zones",this.setUnloadConfirmation),this.listenTo(this.model,"saved:zones",this.clearUnloadConfirmation),this.listenTo(this.model,"saved:zones",this.render),g.on("change",{view:this},this.updateModelOnChange),g.on("sortupdate",{view:this},this.updateModelOnSort),a(window).on("beforeunload",{view:this},this.unloadConfirmation),h.on("click",{view:this},this.onSubmit),a(document.body).on("click",".add_shipping_method:not(.disabled)",{view:this},this.onAddShippingMethod),a(document.body).on("click",".wc-shipping-zone-add",{view:this},this.onAddNewRow),a(document.body).on("wc_backbone_modal_response",this.onAddShippingMethodSubmitted),a(document.body).on("change",".wc-shipping-zone-method-selector select",this.onChangeShippingMethodSelector)},block:function(){a(this.el).block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){a(this.el).unblock()},render:function(){var b=_.indexBy(this.model.get("zones"),"zone_id"),c=this;c.$el.empty(),c.unblock(),_.size(b)?(b=_.sortBy(b,function(a){return parseInt(a.zone_order,10)}),a.each(b,function(a,b){c.renderRow(b)})):c.$el.append(j),c.initRows()},renderRow:function(a){var b=this;b.$el.append(b.rowTemplate(a)),b.initRow(a)},initRow:function(a){var b=this,c=b.$el.find('tr[data-id="'+a.zone_id+'"]');_.each(a.zone_locations,function(a){if("string"===jQuery.type(a))c.find('option[value="'+a+'"]').prop("selected",!0);else if("postcode"===a.type){var b=c.find(".wc-shipping-zone-postcodes :input");b.val()?b.val(b.val()+"\n"+a.code):b.val(a.code),c.find(".wc-shipping-zone-postcodes").show(),c.find(".wc-shipping-zone-postcodes-toggle").hide()}else c.find('option[value="'+a.type+":"+a.code+'"]').prop("selected",!0)}),a.zone_postcodes&&_.each(a.zone_postcodes,function(a){var b=c.find(".wc-shipping-zone-postcodes :input");b.val()?b.val(b.val()+"\n"+a.code):b.val(a.code),c.find(".wc-shipping-zone-postcodes").show(),c.find(".wc-shipping-zone-postcodes-toggle").hide()}),b.renderShippingMethods(a.zone_id,a.shipping_methods),c.find(".view").show(),c.find(".edit").hide(),c.find(".wc-shipping-zone-edit").on("click",{view:this},this.onEditRow),c.find(".wc-shipping-zone-cancel-edit").on("click",{view:this},this.onCancelEditRow),c.find(".wc-shipping-zone-delete").on("click",{view:this},this.onDeleteRow),c.find(".wc-shipping-zone-postcodes-toggle").on("click",{view:this},this.onTogglePostcodes),!0===a.editing&&(c.addClass("editing"),c.find(".wc-shipping-zone-edit").trigger("click"))},initRows:function(){0===a("tbody.wc-shipping-zone-rows tr").length%2?f.find("tbody.wc-shipping-zone-rows").next("tbody").find("tr").addClass("odd"):f.find("tbody.wc-shipping-zone-rows").next("tbody").find("tr").removeClass("odd"),a("#tiptip_holder").removeAttr("style"),a("#tiptip_arrow").removeAttr("style"),a(".tips").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:50})},renderShippingMethods:function(c,d){var e=a('.wc-shipping-zones tr[data-id="'+c+'"]'),f=e.find(".wc-shipping-zone-methods ul");f.find(".wc-shipping-zone-method").remove(),_.size(d)?(d=_.sortBy(d,function(a){return parseInt(a.method_order,10)}),_.each(d,function(a){var b="method_disabled";"yes"===a.enabled&&(b="method_enabled"),f.append('
  • '+a.title+"
  • ")})):f.append('
  • '+b.strings.no_shipping_methods_offered+"
  • ")},onSubmit:function(a){a.data.view.block(),a.data.view.model.save(),a.preventDefault()},onAddNewRow:function(c){c.preventDefault();var d=c.data.view,e=d.model,f=_.indexBy(e.get("zones"),"zone_id"),g={},h=_.size(f),i=_.extend({},b.default_zone,{zone_id:"new-"+h+"-"+Date.now(),editing:!0});a(".wc-shipping-zones-blank-state").closest("tr").remove(),i.zone_order=1+_.max(_.pluck(f,"zone_order"),function(a){return parseInt(a,10)}),g[i.zone_id]=i,e.logChanges(g),d.renderRow(i),d.initRows()},onTogglePostcodes:function(b){b.preventDefault();var c=a(this).closest("tr");c.find(".wc-shipping-zone-postcodes").show(),c.find(".wc-shipping-zone-postcodes-toggle").hide()},onEditRow:function(b){b.preventDefault(),b.data.view.model.trigger("change:zones"),a(this).closest("tr").addClass("editing"),a(this).closest("tr").find(".view").hide(),a(this).closest("tr").find(".edit").show(),a(".wc-shipping-zone-region-select:not(.enhanced)").select2(k),a(".wc-shipping-zone-region-select:not(.enhanced)").addClass("enhanced");var c=a(this).closest("tr").find(".add_shipping_method");c.addClass("disabled"),c.tipTip({attribute:"data-disabled-tip",fadeIn:50,fadeOut:50,delay:50})},onCancelEditRow:function(b){var c=b.data.view,d=c.model,e=a(this).closest("tr"),f=e.data("id"),g=_.indexBy(d.get("zones"),"zone_id");b.preventDefault(),d.discardChanges(f),g[f]&&(g[f].editing=!1,e.after(c.rowTemplate(g[f])),c.initRow(g[f])),e.remove(),c.initRows()},onDeleteRow:function(b){var c=b.data.view,d=c.model,e=_.indexBy(d.get("zones"),"zone_id"),f={},g=a(this).closest("tr"),h=a(this).closest("tr").data("id");b.preventDefault(),e[h]&&(delete e[h],f[h]=_.extend(f[h]||{},{deleted:"deleted"}),d.set("zones",e),d.logChanges(f)),g.remove(),c.initRows()},setUnloadConfirmation:function(){this.needsUnloadConfirm=!0,h.prop("disabled",!1)},clearUnloadConfirmation:function(){this.needsUnloadConfirm=!1,h.prop("disabled",!0)},unloadConfirmation:function(a){if(a.data.view.needsUnloadConfirm)return a.returnValue=b.strings.unload_confirmation_msg,window.event.returnValue=b.strings.unload_confirmation_msg,b.strings.unload_confirmation_msg},updateModelOnChange:function(b){var c=b.data.view.model,d=a(b.target),e=d.closest("tr").data("id"),f=d.data("attribute"),g=d.val(),h=_.indexBy(c.get("zones"),"zone_id"),i={};h[e]&&h[e][f]===g||(i[e]={},i[e][f]=g),c.logChanges(i)},updateModelOnSort:function(b){var c=b.data.view,d=c.model,e=_.indexBy(d.get("zones"),"zone_id"),f=a("tbody.wc-shipping-zone-rows tr"),g={};_.each(f,function(b){var c=a(b).data("id"),d=null,f=parseInt(a(b).index(),10);e[c]&&(d=parseInt(e[c].zone_order,10)),d!==f&&(g[c]=_.extend(g[c]||{},{zone_order:f}))}),_.size(g)&&d.logChanges(g)},onAddShippingMethod:function(b){var c=a(this).closest("tr").data("id");b.preventDefault(),a(this).WCBackboneModal({template:"wc-modal-add-shipping-method",variable:{zone_id:c}}),a(".wc-shipping-zone-method-selector select").change()},onAddShippingMethodSubmitted:function(c,e,f){"wc-modal-add-shipping-method"===e&&(o.block(),a.post(d+(d.indexOf("?")>0?"&":"?")+"action=woocommerce_shipping_zone_add_method",{wc_shipping_zones_nonce:b.wc_shipping_zones_nonce,method_id:f.add_method_id,zone_id:f.zone_id},function(a,b){"success"===b&&a.success&&o.renderShippingMethods(f.zone_id,a.data.methods),o.unblock()},"json"))},onChangeShippingMethodSelector:function(){var b=a(this).find("option:selected").data("description");a(this).parent().find(".wc-shipping-zone-method-description").remove(),a(this).after('

    '+b+"

    "),a(this).closest("article").height(a(this).parent().height())}}),n=new l({zones:b.zones}),o=new m({model:n,el:g});o.render(),g.sortable({items:"tr",cursor:"move",axis:"y",handle:"td.wc-shipping-zone-sort",scrollSensitivity:40})})}(jQuery,shippingZonesLocalizeScript,wp,ajaxurl); \ No newline at end of file diff --git a/assets/js/frontend/cart.js b/assets/js/frontend/cart.js index bdd5cd608f6..bd9fca4ef6b 100644 --- a/assets/js/frontend/cart.js +++ b/assets/js/frontend/cart.js @@ -354,8 +354,9 @@ jQuery( function( $ ) { var $clicked = $( 'input[type=submit][clicked=true]' ); if ( 0 === $form.find( '.shop_table.cart' ).length ) { - return false; + return; } + if ( is_blocked( $form ) ) { return false; } diff --git a/assets/js/frontend/cart.min.js b/assets/js/frontend/cart.min.js index 9d3bf18662b..724d0b5bf88 100644 --- a/assets/js/frontend/cart.min.js +++ b/assets/js/frontend/cart.min.js @@ -1 +1 @@ -jQuery(function(a){if("undefined"==typeof wc_cart_params)return!1;var b=function(a){return wc_cart_params.wc_ajax_url.toString().replace("%%endpoint%%",a)},c=function(a){return a.is(".processing")||a.parents(".processing").length},d=function(a){c(a)||a.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},e=function(a){a.removeClass("processing").unblock()},f=function(b){var c=a.parseHTML(b),d=a(".shop_table.cart",c).closest("form"),e=a(".cart_totals",c),f=a(".woocommerce-error",c),i=a(".woocommerce-message",c);if(a(".woocommerce-error, .woocommerce-message").remove(),0===d.length){if(a(".woocommerce-checkout").length)return void window.location.reload();var j=a(".cart-empty",c).closest(".woocommerce");a(".shop_table.cart").closest(".woocommerce").replaceWith(j),f.length>0?h(f,a(".cart-empty").closest(".woocommerce")):i.length>0&&h(i,a(".cart-empty").closest(".woocommerce"))}else a(".woocommerce-checkout").length&&a(document.body).trigger("update_checkout"),a(".shop_table.cart").closest("form").replaceWith(d),a(".shop_table.cart").closest("form").find('input[name="update_cart"]').prop("disabled",!0),f.length>0?h(f):i.length>0&&h(i),g(e);a(document.body).trigger("updated_wc_div")},g=function(b){a(".cart_totals").replaceWith(b),a(document.body).trigger("updated_cart_totals")},h=function(b,c){c||(c=a(".shop_table.cart").closest("form")),a(".woocommerce-error, .woocommerce-message").remove(),c.before(b)},i={init:function(b){this.cart=b,this.toggle_shipping=this.toggle_shipping.bind(this),this.shipping_method_selected=this.shipping_method_selected.bind(this),this.shipping_calculator_submit=this.shipping_calculator_submit.bind(this),a(document).on("click",".shipping-calculator-button",this.toggle_shipping),a(document).on("change","select.shipping_method, input[name^=shipping_method]",this.shipping_method_selected),a(document).on("submit","form.woocommerce-shipping-calculator",this.shipping_calculator_submit),a(".shipping-calculator-form").hide()},toggle_shipping:function(){return a(".shipping-calculator-form").slideToggle("slow"),!1},shipping_method_selected:function(c){var f=c.currentTarget,h={};a("select.shipping_method, input[name^=shipping_method][type=radio]:checked, input[name^=shipping_method][type=hidden]").each(function(){h[a(f).data("index")]=a(f).val()}),d(a("div.cart_totals"));var i={security:wc_cart_params.update_shipping_method_nonce,shipping_method:h};a.ajax({type:"post",url:b("update_shipping_method"),data:i,dataType:"html",success:function(a){g(a)},complete:function(){e(a("div.cart_totals")),a(document.body).trigger("updated_shipping_method")}})},shipping_calculator_submit:function(b){b.preventDefault();var c=a(b.currentTarget);d(a("div.cart_totals")),d(c),a("").attr("type","hidden").attr("name","calc_shipping").attr("value","x").appendTo(c),a.ajax({type:c.attr("method"),url:c.attr("action"),data:c.serialize(),dataType:"html",success:function(a){f(a)},complete:function(){e(c),e(a("div.cart_totals"))}})}},j={init:function(){this.update_cart_totals=this.update_cart_totals.bind(this),this.cart_submit=this.cart_submit.bind(this),this.submit_click=this.submit_click.bind(this),this.apply_coupon=this.apply_coupon.bind(this),this.remove_coupon_clicked=this.remove_coupon_clicked.bind(this),this.quantity_update=this.quantity_update.bind(this),this.item_remove_clicked=this.item_remove_clicked.bind(this),this.update_cart=this.update_cart.bind(this),a(document).on("wc_update_cart",this.update_cart),a(document).on("click","div.woocommerce > form input[type=submit]",this.submit_click),a(document).on("submit","div.woocommerce:not(.widget_product_search) > form",this.cart_submit),a(document).on("click","a.woocommerce-remove-coupon",this.remove_coupon_clicked),a(document).on("click","td.product-remove > a",this.item_remove_clicked),a(document).on("change input","div.woocommerce > form .cart_item :input",this.input_changed),a('div.woocommerce > form input[name="update_cart"]').prop("disabled",!0)},input_changed:function(){a('div.woocommerce > form input[name="update_cart"]').prop("disabled",!1)},update_cart:function(){var b=a(".shop_table.cart").closest("form");d(b),d(a("div.cart_totals")),a.ajax({type:b.attr("method"),url:b.attr("action"),data:b.serialize(),dataType:"html",success:function(a){f(a)},complete:function(){e(b),e(a("div.cart_totals"))}})},update_cart_totals:function(){d(a("div.cart_totals")),a.ajax({url:b("get_cart_totals"),dataType:"html",success:function(a){g(a)},complete:function(){e(a("div.cart_totals"))}})},cart_submit:function(b){var d=a(b.currentTarget),e=a(document.activeElement),f=a("input[type=submit][clicked=true]");return 0!==d.find(".shop_table.cart").length&&(!c(d)&&void(f.is('[name="update_cart"]')||e.is("input.qty")?(b.preventDefault(),this.quantity_update(d)):(f.is('[name="apply_coupon"]')||e.is("#coupon_code"))&&(b.preventDefault(),this.apply_coupon(d))))},submit_click:function(b){a("input[type=submit]",a(b.target).parents("form")).removeAttr("clicked"),a(b.target).attr("clicked","true")},apply_coupon:function(c){d(c);var f=this,g=a("#coupon_code"),i=g.val(),j={security:wc_cart_params.apply_coupon_nonce,coupon_code:i};a.ajax({type:"POST",url:b("apply_coupon"),data:j,dataType:"html",success:function(b){h(b),a(document.body).trigger("applied_coupon")},complete:function(){e(c),g.val(""),f.update_cart_totals()}})},remove_coupon_clicked:function(c){c.preventDefault();var f=this,g=a(c.currentTarget).parents("tr"),i=a(c.currentTarget).attr("data-coupon");d(g.parents("table"));var j={security:wc_cart_params.remove_coupon_nonce,coupon:i};a.ajax({type:"POST",url:b("remove_coupon"),data:j,dataType:"html",success:function(b){h(b),a(document.body).trigger("removed_coupon"),e(g.parents("table"))},complete:function(){f.update_cart_totals()}})},quantity_update:function(b){a("").attr("type","hidden").attr("name","update_cart").attr("value","Update Cart").appendTo(b),d(b),d(a("div.cart_totals")),a.ajax({type:b.attr("method"),url:b.attr("action"),data:b.serialize(),dataType:"html",success:f,complete:function(){e(b),e(a("div.cart_totals"))}})},item_remove_clicked:function(b){b.preventDefault();var c=a(b.currentTarget),g=c.parents("form");d(g),d(a("div.cart_totals")),a.ajax({type:"GET",url:c.attr("href"),dataType:"html",success:f,complete:function(){e(g),e(a("div.cart_totals"))}})}};i.init(j),j.init()}); \ No newline at end of file +jQuery(function(a){if("undefined"==typeof wc_cart_params)return!1;var b=function(a){return wc_cart_params.wc_ajax_url.toString().replace("%%endpoint%%",a)},c=function(a){return a.is(".processing")||a.parents(".processing").length},d=function(a){c(a)||a.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},e=function(a){a.removeClass("processing").unblock()},f=function(b){var c=a.parseHTML(b),d=a(".shop_table.cart",c).closest("form"),e=a(".cart_totals",c),f=a(".woocommerce-error",c),i=a(".woocommerce-message",c);if(a(".woocommerce-error, .woocommerce-message").remove(),0===d.length){if(a(".woocommerce-checkout").length)return void window.location.reload();var j=a(".cart-empty",c).closest(".woocommerce");a(".shop_table.cart").closest(".woocommerce").replaceWith(j),f.length>0?h(f,a(".cart-empty").closest(".woocommerce")):i.length>0&&h(i,a(".cart-empty").closest(".woocommerce"))}else a(".woocommerce-checkout").length&&a(document.body).trigger("update_checkout"),a(".shop_table.cart").closest("form").replaceWith(d),a(".shop_table.cart").closest("form").find('input[name="update_cart"]').prop("disabled",!0),f.length>0?h(f):i.length>0&&h(i),g(e);a(document.body).trigger("updated_wc_div")},g=function(b){a(".cart_totals").replaceWith(b),a(document.body).trigger("updated_cart_totals")},h=function(b,c){c||(c=a(".shop_table.cart").closest("form")),a(".woocommerce-error, .woocommerce-message").remove(),c.before(b)},i={init:function(b){this.cart=b,this.toggle_shipping=this.toggle_shipping.bind(this),this.shipping_method_selected=this.shipping_method_selected.bind(this),this.shipping_calculator_submit=this.shipping_calculator_submit.bind(this),a(document).on("click",".shipping-calculator-button",this.toggle_shipping),a(document).on("change","select.shipping_method, input[name^=shipping_method]",this.shipping_method_selected),a(document).on("submit","form.woocommerce-shipping-calculator",this.shipping_calculator_submit),a(".shipping-calculator-form").hide()},toggle_shipping:function(){return a(".shipping-calculator-form").slideToggle("slow"),!1},shipping_method_selected:function(c){var f=c.currentTarget,h={};a("select.shipping_method, input[name^=shipping_method][type=radio]:checked, input[name^=shipping_method][type=hidden]").each(function(){h[a(f).data("index")]=a(f).val()}),d(a("div.cart_totals"));var i={security:wc_cart_params.update_shipping_method_nonce,shipping_method:h};a.ajax({type:"post",url:b("update_shipping_method"),data:i,dataType:"html",success:function(a){g(a)},complete:function(){e(a("div.cart_totals")),a(document.body).trigger("updated_shipping_method")}})},shipping_calculator_submit:function(b){b.preventDefault();var c=a(b.currentTarget);d(a("div.cart_totals")),d(c),a("").attr("type","hidden").attr("name","calc_shipping").attr("value","x").appendTo(c),a.ajax({type:c.attr("method"),url:c.attr("action"),data:c.serialize(),dataType:"html",success:function(a){f(a)},complete:function(){e(c),e(a("div.cart_totals"))}})}},j={init:function(){this.update_cart_totals=this.update_cart_totals.bind(this),this.cart_submit=this.cart_submit.bind(this),this.submit_click=this.submit_click.bind(this),this.apply_coupon=this.apply_coupon.bind(this),this.remove_coupon_clicked=this.remove_coupon_clicked.bind(this),this.quantity_update=this.quantity_update.bind(this),this.item_remove_clicked=this.item_remove_clicked.bind(this),this.update_cart=this.update_cart.bind(this),a(document).on("wc_update_cart",this.update_cart),a(document).on("click","div.woocommerce > form input[type=submit]",this.submit_click),a(document).on("submit","div.woocommerce:not(.widget_product_search) > form",this.cart_submit),a(document).on("click","a.woocommerce-remove-coupon",this.remove_coupon_clicked),a(document).on("click","td.product-remove > a",this.item_remove_clicked),a(document).on("change input","div.woocommerce > form .cart_item :input",this.input_changed),a('div.woocommerce > form input[name="update_cart"]').prop("disabled",!0)},input_changed:function(){a('div.woocommerce > form input[name="update_cart"]').prop("disabled",!1)},update_cart:function(){var b=a(".shop_table.cart").closest("form");d(b),d(a("div.cart_totals")),a.ajax({type:b.attr("method"),url:b.attr("action"),data:b.serialize(),dataType:"html",success:function(a){f(a)},complete:function(){e(b),e(a("div.cart_totals"))}})},update_cart_totals:function(){d(a("div.cart_totals")),a.ajax({url:b("get_cart_totals"),dataType:"html",success:function(a){g(a)},complete:function(){e(a("div.cart_totals"))}})},cart_submit:function(b){var d=a(b.currentTarget),e=a(document.activeElement),f=a("input[type=submit][clicked=true]");if(0!==d.find(".shop_table.cart").length)return!c(d)&&void(f.is('[name="update_cart"]')||e.is("input.qty")?(b.preventDefault(),this.quantity_update(d)):(f.is('[name="apply_coupon"]')||e.is("#coupon_code"))&&(b.preventDefault(),this.apply_coupon(d)))},submit_click:function(b){a("input[type=submit]",a(b.target).parents("form")).removeAttr("clicked"),a(b.target).attr("clicked","true")},apply_coupon:function(c){d(c);var f=this,g=a("#coupon_code"),i=g.val(),j={security:wc_cart_params.apply_coupon_nonce,coupon_code:i};a.ajax({type:"POST",url:b("apply_coupon"),data:j,dataType:"html",success:function(b){h(b),a(document.body).trigger("applied_coupon")},complete:function(){e(c),g.val(""),f.update_cart_totals()}})},remove_coupon_clicked:function(c){c.preventDefault();var f=this,g=a(c.currentTarget).parents("tr"),i=a(c.currentTarget).attr("data-coupon");d(g.parents("table"));var j={security:wc_cart_params.remove_coupon_nonce,coupon:i};a.ajax({type:"POST",url:b("remove_coupon"),data:j,dataType:"html",success:function(b){h(b),a(document.body).trigger("removed_coupon"),e(g.parents("table"))},complete:function(){f.update_cart_totals()}})},quantity_update:function(b){a("").attr("type","hidden").attr("name","update_cart").attr("value","Update Cart").appendTo(b),d(b),d(a("div.cart_totals")),a.ajax({type:b.attr("method"),url:b.attr("action"),data:b.serialize(),dataType:"html",success:f,complete:function(){e(b),e(a("div.cart_totals"))}})},item_remove_clicked:function(b){b.preventDefault();var c=a(b.currentTarget),g=c.parents("form");d(g),d(a("div.cart_totals")),a.ajax({type:"GET",url:c.attr("href"),dataType:"html",success:f,complete:function(){e(g),e(a("div.cart_totals"))}})}};i.init(j),j.init()}); \ No newline at end of file diff --git a/assets/js/frontend/checkout.js b/assets/js/frontend/checkout.js index 8eb88ea597e..97c2684449f 100644 --- a/assets/js/frontend/checkout.js +++ b/assets/js/frontend/checkout.js @@ -55,7 +55,7 @@ jQuery( function( $ ) { $( 'input#createaccount' ).change( this.toggle_create_account ).change(); } }, - init_payment_methods: function() { + init_payment_methods: function( selectedPaymentMethod ) { var $payment_methods = $( '.woocommerce-checkout' ).find( 'input[name="payment_method"]' ); // If there is one method, we can hide the radio input @@ -63,6 +63,11 @@ jQuery( function( $ ) { $payment_methods.eq(0).hide(); } + // If there was a previously selected method, check that one. + if ( selectedPaymentMethod ) { + $( '#' + selectedPaymentMethod ).prop( 'checked', true ); + } + // If there are none selected, select the first. if ( 0 === $payment_methods.filter( ':checked' ).length ) { $payment_methods.eq(0).prop( 'checked', true ); @@ -271,6 +276,9 @@ jQuery( function( $ ) { url: wc_checkout_params.wc_ajax_url.toString().replace( '%%endpoint%%', 'update_order_review' ), data: data, success: function( data ) { + + var selectedPaymentMethod = $( '.woocommerce-checkout input[name="payment_method"]:checked' ).attr( 'id' ); + // Reload the page if requested if ( 'true' === data.reload ) { window.location.reload(); @@ -321,7 +329,7 @@ jQuery( function( $ ) { } // Re-init methods - wc_checkout_form.init_payment_methods(); + wc_checkout_form.init_payment_methods( selectedPaymentMethod ); // Fire updated_checkout e $( document.body ).trigger( 'updated_checkout' ); diff --git a/assets/js/frontend/checkout.min.js b/assets/js/frontend/checkout.min.js index 2f3c15b07ff..cccd6795e65 100644 --- a/assets/js/frontend/checkout.min.js +++ b/assets/js/frontend/checkout.min.js @@ -1 +1 @@ -jQuery(function(a){if("undefined"==typeof wc_checkout_params)return!1;a.blockUI.defaults.overlayCSS.cursor="default";var b={updateTimer:!1,dirtyInput:!1,xhr:!1,$order_review:a("#order_review"),$checkout_form:a("form.checkout"),init:function(){a(document.body).bind("update_checkout",this.update_checkout),a(document.body).bind("init_checkout",this.init_checkout),this.$checkout_form.on("click",'input[name="payment_method"]',this.payment_method_selected),a(document.body).hasClass("woocommerce-order-pay")&&this.$order_review.on("click",'input[name="payment_method"]',this.payment_method_selected),this.$checkout_form.on("submit",this.submit),this.$checkout_form.on("blur change",".input-text, select, input:checkbox",this.validate_field),this.$checkout_form.on("update",this.trigger_update_checkout),this.$checkout_form.on("change",'select.shipping_method, input[name^="shipping_method"], #ship-to-different-address input, .update_totals_on_change select, .update_totals_on_change input[type="radio"]',this.trigger_update_checkout),this.$checkout_form.on("change",".address-field select",this.input_changed),this.$checkout_form.on("change",".address-field input.input-text, .update_totals_on_change input.input-text",this.maybe_input_changed),this.$checkout_form.on("change keydown",".address-field input.input-text, .update_totals_on_change input.input-text",this.queue_update_checkout),this.$checkout_form.on("change","#ship-to-different-address input",this.ship_to_different_address),this.$checkout_form.find("#ship-to-different-address input").change(),this.init_payment_methods(),"1"===wc_checkout_params.is_checkout&&a(document.body).trigger("init_checkout"),"yes"===wc_checkout_params.option_guest_checkout&&a("input#createaccount").change(this.toggle_create_account).change()},init_payment_methods:function(){var b=a(".woocommerce-checkout").find('input[name="payment_method"]');1===b.length&&b.eq(0).hide(),0===b.filter(":checked").length&&b.eq(0).prop("checked",!0),b.filter(":checked").eq(0).trigger("click")},get_payment_method:function(){return b.$order_review.find('input[name="payment_method"]:checked').val()},payment_method_selected:function(){if(a(".payment_methods input.input-radio").length>1){var b=a("div.payment_box."+a(this).attr("ID"));a(this).is(":checked")&&!b.is(":visible")&&(a("div.payment_box").filter(":visible").slideUp(250),a(this).is(":checked")&&a("div.payment_box."+a(this).attr("ID")).slideDown(250))}else a("div.payment_box").show();a(this).data("order_button_text")?a("#place_order").val(a(this).data("order_button_text")):a("#place_order").val(a("#place_order").data("value"))},toggle_create_account:function(){a("div.create-account").hide(),a(this).is(":checked")&&a("div.create-account").slideDown()},init_checkout:function(){a("#billing_country, #shipping_country, .country_to_state").change(),a(document.body).trigger("update_checkout")},maybe_input_changed:function(a){b.dirtyInput&&b.input_changed(a)},input_changed:function(a){b.dirtyInput=a.target,b.maybe_update_checkout()},queue_update_checkout:function(a){var c=a.keyCode||a.which||0;return 9===c||(b.dirtyInput=this,b.reset_update_checkout_timer(),void(b.updateTimer=setTimeout(b.maybe_update_checkout,"1000")))},trigger_update_checkout:function(){b.reset_update_checkout_timer(),b.dirtyInput=!1,a(document.body).trigger("update_checkout")},maybe_update_checkout:function(){var c=!0;if(a(b.dirtyInput).length){var d=a(b.dirtyInput).closest("div").find(".address-field.validate-required");d.length&&d.each(function(){""===a(this).find("input.input-text").val()&&(c=!1)})}c&&b.trigger_update_checkout()},ship_to_different_address:function(){a("div.shipping_address").hide(),a(this).is(":checked")&&a("div.shipping_address").slideDown()},reset_update_checkout_timer:function(){clearTimeout(b.updateTimer)},validate_field:function(){var b=a(this),c=b.closest(".form-row"),d=!0;if(c.is(".validate-required")&&("checkbox"!==b.attr("type")||b.is(":checked")?""===b.val()&&(c.removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-required-field"),d=!1):(c.removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-required-field"),d=!1)),c.is(".validate-email")&&b.val()){var e=new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);e.test(b.val())||(c.removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-email"),d=!1)}d&&c.removeClass("woocommerce-invalid woocommerce-invalid-required-field").addClass("woocommerce-validated")},update_checkout:function(a,c){b.reset_update_checkout_timer(),b.updateTimer=setTimeout(b.update_checkout_action,"5",c)},update_checkout_action:function(c){if(b.xhr&&b.xhr.abort(),0!==a("form.checkout").length){c="undefined"!=typeof c?c:{update_shipping_method:!0};var d=a("#billing_country").val(),e=a("#billing_state").val(),f=a("input#billing_postcode").val(),g=a("#billing_city").val(),h=a("input#billing_address_1").val(),i=a("input#billing_address_2").val(),j=d,k=e,l=f,m=g,n=h,o=i;a("#ship-to-different-address").find("input").is(":checked")&&(j=a("#shipping_country").val(),k=a("#shipping_state").val(),l=a("input#shipping_postcode").val(),m=a("#shipping_city").val(),n=a("input#shipping_address_1").val(),o=a("input#shipping_address_2").val());var p={security:wc_checkout_params.update_order_review_nonce,payment_method:b.get_payment_method(),country:d,state:e,postcode:f,city:g,address:h,address_2:i,s_country:j,s_state:k,s_postcode:l,s_city:m,s_address:n,s_address_2:o,post_data:a("form.checkout").serialize()};if(!1!==c.update_shipping_method){var q={};a('select.shipping_method, input[name^="shipping_method"][type="radio"]:checked, input[name^="shipping_method"][type="hidden"]').each(function(){q[a(this).data("index")]=a(this).val()}),p.shipping_method=q}a(".woocommerce-checkout-payment, .woocommerce-checkout-review-order-table").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),b.xhr=a.ajax({type:"POST",url:wc_checkout_params.wc_ajax_url.toString().replace("%%endpoint%%","update_order_review"),data:p,success:function(c){if("true"===c.reload)return void window.location.reload();a(".woocommerce-NoticeGroup-updateOrderReview").remove();var d=a("#terms").prop("checked");if(c&&c.fragments&&a.each(c.fragments,function(b,c){a(b).replaceWith(c),a(b).unblock()}),d&&a("#terms").prop("checked",!0),"failure"===c.result){var e=a("form.checkout");a(".woocommerce-error, .woocommerce-message").remove(),c.messages?e.prepend('
    '+c.messages+"
    "):e.prepend(c),e.find(".input-text, select, input:checkbox").blur(),a("html, body").animate({scrollTop:a("form.checkout").offset().top-100},1e3)}b.init_payment_methods(),a(document.body).trigger("updated_checkout")}})}},submit:function(){b.reset_update_checkout_timer();var c=a(this);if(c.is(".processing"))return!1;if(c.triggerHandler("checkout_place_order")!==!1&&c.triggerHandler("checkout_place_order_"+b.get_payment_method())!==!1){c.addClass("processing");var d=c.data();1!==d["blockUI.isBlocked"]&&c.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),a.ajaxSetup({dataFilter:function(b,c){if("json"!==c)return b;try{var d=a.parseJSON(b);if(d&&"object"==typeof d)return b}catch(e){var f=b.match(/{"result.*"}/);null===f?console.log("Unable to fix malformed JSON"):(console.log("Fixed malformed JSON. Original:"),console.log(b),b=f[0])}return b}}),a.ajax({type:"POST",url:wc_checkout_params.checkout_url,data:c.serialize(),dataType:"json",success:function(c){try{if("success"!==c.result)throw"failure"===c.result?"Result failure":"Invalid response";-1===c.redirect.indexOf("https://")||-1===c.redirect.indexOf("http://")?window.location=c.redirect:window.location=decodeURI(c.redirect)}catch(d){if("true"===c.reload)return void window.location.reload();"true"===c.refresh&&a(document.body).trigger("update_checkout"),c.messages?b.submit_error(c.messages):b.submit_error('
    '+wc_checkout_params.i18n_checkout_error+"
    ")}},error:function(a,c,d){b.submit_error('
    '+d+"
    ")}})}return!1},submit_error:function(c){a(".woocommerce-error, .woocommerce-message").remove(),b.$checkout_form.prepend(c),b.$checkout_form.removeClass("processing").unblock(),b.$checkout_form.find(".input-text, select, input:checkbox").blur(),a("html, body").animate({scrollTop:a("form.checkout").offset().top-100},1e3),a(document.body).trigger("checkout_error")}},c={init:function(){a(document.body).on("click","a.showcoupon",this.show_coupon_form),a(document.body).on("click",".woocommerce-remove-coupon",this.remove_coupon),a("form.checkout_coupon").hide().submit(this.submit)},show_coupon_form:function(){return a(".checkout_coupon").slideToggle(400,function(){a(".checkout_coupon").find(":input:eq(0)").focus()}),!1},submit:function(){var b=a(this);if(b.is(".processing"))return!1;b.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var c={security:wc_checkout_params.apply_coupon_nonce,coupon_code:b.find('input[name="coupon_code"]').val()};return a.ajax({type:"POST",url:wc_checkout_params.wc_ajax_url.toString().replace("%%endpoint%%","apply_coupon"),data:c,success:function(c){a(".woocommerce-error, .woocommerce-message").remove(),b.removeClass("processing").unblock(),c&&(b.before(c),b.slideUp(),a(document.body).trigger("update_checkout",{update_shipping_method:!1}))},dataType:"html"}),!1},remove_coupon:function(b){b.preventDefault();var c=a(this).parents(".woocommerce-checkout-review-order"),d=a(this).data("coupon");c.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var e={security:wc_checkout_params.remove_coupon_nonce,coupon:d};a.ajax({type:"POST",url:wc_checkout_params.wc_ajax_url.toString().replace("%%endpoint%%","remove_coupon"),data:e,success:function(b){a(".woocommerce-error, .woocommerce-message").remove(),c.removeClass("processing").unblock(),b&&(a("form.woocommerce-checkout").before(b),a(document.body).trigger("update_checkout",{update_shipping_method:!1}),a("form.checkout_coupon").find('input[name="coupon_code"]').val(""))},error:function(a){wc_checkout_params.debug_mode&&console.log(a.responseText)},dataType:"html"})}},d={init:function(){a(document.body).on("click","a.showlogin",this.show_login_form)},show_login_form:function(){return a("form.login").slideToggle(),!1}};b.init(),c.init(),d.init()}); \ No newline at end of file +jQuery(function(a){if("undefined"==typeof wc_checkout_params)return!1;a.blockUI.defaults.overlayCSS.cursor="default";var b={updateTimer:!1,dirtyInput:!1,xhr:!1,$order_review:a("#order_review"),$checkout_form:a("form.checkout"),init:function(){a(document.body).bind("update_checkout",this.update_checkout),a(document.body).bind("init_checkout",this.init_checkout),this.$checkout_form.on("click",'input[name="payment_method"]',this.payment_method_selected),a(document.body).hasClass("woocommerce-order-pay")&&this.$order_review.on("click",'input[name="payment_method"]',this.payment_method_selected),this.$checkout_form.on("submit",this.submit),this.$checkout_form.on("blur change",".input-text, select, input:checkbox",this.validate_field),this.$checkout_form.on("update",this.trigger_update_checkout),this.$checkout_form.on("change",'select.shipping_method, input[name^="shipping_method"], #ship-to-different-address input, .update_totals_on_change select, .update_totals_on_change input[type="radio"]',this.trigger_update_checkout),this.$checkout_form.on("change",".address-field select",this.input_changed),this.$checkout_form.on("change",".address-field input.input-text, .update_totals_on_change input.input-text",this.maybe_input_changed),this.$checkout_form.on("change keydown",".address-field input.input-text, .update_totals_on_change input.input-text",this.queue_update_checkout),this.$checkout_form.on("change","#ship-to-different-address input",this.ship_to_different_address),this.$checkout_form.find("#ship-to-different-address input").change(),this.init_payment_methods(),"1"===wc_checkout_params.is_checkout&&a(document.body).trigger("init_checkout"),"yes"===wc_checkout_params.option_guest_checkout&&a("input#createaccount").change(this.toggle_create_account).change()},init_payment_methods:function(b){var c=a(".woocommerce-checkout").find('input[name="payment_method"]');1===c.length&&c.eq(0).hide(),b&&a("#"+b).prop("checked",!0),0===c.filter(":checked").length&&c.eq(0).prop("checked",!0),c.filter(":checked").eq(0).trigger("click")},get_payment_method:function(){return b.$order_review.find('input[name="payment_method"]:checked').val()},payment_method_selected:function(){if(a(".payment_methods input.input-radio").length>1){var b=a("div.payment_box."+a(this).attr("ID"));a(this).is(":checked")&&!b.is(":visible")&&(a("div.payment_box").filter(":visible").slideUp(250),a(this).is(":checked")&&a("div.payment_box."+a(this).attr("ID")).slideDown(250))}else a("div.payment_box").show();a(this).data("order_button_text")?a("#place_order").val(a(this).data("order_button_text")):a("#place_order").val(a("#place_order").data("value"))},toggle_create_account:function(){a("div.create-account").hide(),a(this).is(":checked")&&a("div.create-account").slideDown()},init_checkout:function(){a("#billing_country, #shipping_country, .country_to_state").change(),a(document.body).trigger("update_checkout")},maybe_input_changed:function(a){b.dirtyInput&&b.input_changed(a)},input_changed:function(a){b.dirtyInput=a.target,b.maybe_update_checkout()},queue_update_checkout:function(a){var c=a.keyCode||a.which||0;return 9===c||(b.dirtyInput=this,b.reset_update_checkout_timer(),void(b.updateTimer=setTimeout(b.maybe_update_checkout,"1000")))},trigger_update_checkout:function(){b.reset_update_checkout_timer(),b.dirtyInput=!1,a(document.body).trigger("update_checkout")},maybe_update_checkout:function(){var c=!0;if(a(b.dirtyInput).length){var d=a(b.dirtyInput).closest("div").find(".address-field.validate-required");d.length&&d.each(function(){""===a(this).find("input.input-text").val()&&(c=!1)})}c&&b.trigger_update_checkout()},ship_to_different_address:function(){a("div.shipping_address").hide(),a(this).is(":checked")&&a("div.shipping_address").slideDown()},reset_update_checkout_timer:function(){clearTimeout(b.updateTimer)},validate_field:function(){var b=a(this),c=b.closest(".form-row"),d=!0;if(c.is(".validate-required")&&("checkbox"!==b.attr("type")||b.is(":checked")?""===b.val()&&(c.removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-required-field"),d=!1):(c.removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-required-field"),d=!1)),c.is(".validate-email")&&b.val()){var e=new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);e.test(b.val())||(c.removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-email"),d=!1)}d&&c.removeClass("woocommerce-invalid woocommerce-invalid-required-field").addClass("woocommerce-validated")},update_checkout:function(a,c){b.reset_update_checkout_timer(),b.updateTimer=setTimeout(b.update_checkout_action,"5",c)},update_checkout_action:function(c){if(b.xhr&&b.xhr.abort(),0!==a("form.checkout").length){c="undefined"!=typeof c?c:{update_shipping_method:!0};var d=a("#billing_country").val(),e=a("#billing_state").val(),f=a("input#billing_postcode").val(),g=a("#billing_city").val(),h=a("input#billing_address_1").val(),i=a("input#billing_address_2").val(),j=d,k=e,l=f,m=g,n=h,o=i;a("#ship-to-different-address").find("input").is(":checked")&&(j=a("#shipping_country").val(),k=a("#shipping_state").val(),l=a("input#shipping_postcode").val(),m=a("#shipping_city").val(),n=a("input#shipping_address_1").val(),o=a("input#shipping_address_2").val());var p={security:wc_checkout_params.update_order_review_nonce,payment_method:b.get_payment_method(),country:d,state:e,postcode:f,city:g,address:h,address_2:i,s_country:j,s_state:k,s_postcode:l,s_city:m,s_address:n,s_address_2:o,post_data:a("form.checkout").serialize()};if(!1!==c.update_shipping_method){var q={};a('select.shipping_method, input[name^="shipping_method"][type="radio"]:checked, input[name^="shipping_method"][type="hidden"]').each(function(){q[a(this).data("index")]=a(this).val()}),p.shipping_method=q}a(".woocommerce-checkout-payment, .woocommerce-checkout-review-order-table").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),b.xhr=a.ajax({type:"POST",url:wc_checkout_params.wc_ajax_url.toString().replace("%%endpoint%%","update_order_review"),data:p,success:function(c){var d=a('.woocommerce-checkout input[name="payment_method"]:checked').attr("id");if("true"===c.reload)return void window.location.reload();a(".woocommerce-NoticeGroup-updateOrderReview").remove();var e=a("#terms").prop("checked");if(c&&c.fragments&&a.each(c.fragments,function(b,c){a(b).replaceWith(c),a(b).unblock()}),e&&a("#terms").prop("checked",!0),"failure"===c.result){var f=a("form.checkout");a(".woocommerce-error, .woocommerce-message").remove(),c.messages?f.prepend('
    '+c.messages+"
    "):f.prepend(c),f.find(".input-text, select, input:checkbox").blur(),a("html, body").animate({scrollTop:a("form.checkout").offset().top-100},1e3)}b.init_payment_methods(d),a(document.body).trigger("updated_checkout")}})}},submit:function(){b.reset_update_checkout_timer();var c=a(this);if(c.is(".processing"))return!1;if(c.triggerHandler("checkout_place_order")!==!1&&c.triggerHandler("checkout_place_order_"+b.get_payment_method())!==!1){c.addClass("processing");var d=c.data();1!==d["blockUI.isBlocked"]&&c.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),a.ajaxSetup({dataFilter:function(b,c){if("json"!==c)return b;try{var d=a.parseJSON(b);if(d&&"object"==typeof d)return b}catch(e){var f=b.match(/{"result.*"}/);null===f?console.log("Unable to fix malformed JSON"):(console.log("Fixed malformed JSON. Original:"),console.log(b),b=f[0])}return b}}),a.ajax({type:"POST",url:wc_checkout_params.checkout_url,data:c.serialize(),dataType:"json",success:function(c){try{if("success"!==c.result)throw"failure"===c.result?"Result failure":"Invalid response";-1===c.redirect.indexOf("https://")||-1===c.redirect.indexOf("http://")?window.location=c.redirect:window.location=decodeURI(c.redirect)}catch(d){if("true"===c.reload)return void window.location.reload();"true"===c.refresh&&a(document.body).trigger("update_checkout"),c.messages?b.submit_error(c.messages):b.submit_error('
    '+wc_checkout_params.i18n_checkout_error+"
    ")}},error:function(a,c,d){b.submit_error('
    '+d+"
    ")}})}return!1},submit_error:function(c){a(".woocommerce-error, .woocommerce-message").remove(),b.$checkout_form.prepend(c),b.$checkout_form.removeClass("processing").unblock(),b.$checkout_form.find(".input-text, select, input:checkbox").blur(),a("html, body").animate({scrollTop:a("form.checkout").offset().top-100},1e3),a(document.body).trigger("checkout_error")}},c={init:function(){a(document.body).on("click","a.showcoupon",this.show_coupon_form),a(document.body).on("click",".woocommerce-remove-coupon",this.remove_coupon),a("form.checkout_coupon").hide().submit(this.submit)},show_coupon_form:function(){return a(".checkout_coupon").slideToggle(400,function(){a(".checkout_coupon").find(":input:eq(0)").focus()}),!1},submit:function(){var b=a(this);if(b.is(".processing"))return!1;b.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var c={security:wc_checkout_params.apply_coupon_nonce,coupon_code:b.find('input[name="coupon_code"]').val()};return a.ajax({type:"POST",url:wc_checkout_params.wc_ajax_url.toString().replace("%%endpoint%%","apply_coupon"),data:c,success:function(c){a(".woocommerce-error, .woocommerce-message").remove(),b.removeClass("processing").unblock(),c&&(b.before(c),b.slideUp(),a(document.body).trigger("update_checkout",{update_shipping_method:!1}))},dataType:"html"}),!1},remove_coupon:function(b){b.preventDefault();var c=a(this).parents(".woocommerce-checkout-review-order"),d=a(this).data("coupon");c.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var e={security:wc_checkout_params.remove_coupon_nonce,coupon:d};a.ajax({type:"POST",url:wc_checkout_params.wc_ajax_url.toString().replace("%%endpoint%%","remove_coupon"),data:e,success:function(b){a(".woocommerce-error, .woocommerce-message").remove(),c.removeClass("processing").unblock(),b&&(a("form.woocommerce-checkout").before(b),a(document.body).trigger("update_checkout",{update_shipping_method:!1}),a("form.checkout_coupon").find('input[name="coupon_code"]').val(""))},error:function(a){wc_checkout_params.debug_mode&&console.log(a.responseText)},dataType:"html"})}},d={init:function(){a(document.body).on("click","a.showlogin",this.show_login_form)},show_login_form:function(){return a("form.login").slideToggle(),!1}};b.init(),c.init(),d.init()}); \ No newline at end of file diff --git a/i18n/languages/woocommerce.pot b/i18n/languages/woocommerce.pot index 513c96e07df..721b54f3560 100644 --- a/i18n/languages/woocommerce.pot +++ b/i18n/languages/woocommerce.pot @@ -2,9 +2,9 @@ # This file is distributed under the same license as the WooCommerce package. msgid "" msgstr "" -"Project-Id-Version: WooCommerce 2.6.3\n" +"Project-Id-Version: WooCommerce 2.7.0-dev\n" "Report-Msgid-Bugs-To: https://github.com/woothemes/woocommerce/issues\n" -"POT-Creation-Date: 2016-07-19 18:28:19+00:00\n" +"POT-Creation-Date: 2016-08-02 13:43:08+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -673,7 +673,7 @@ msgstr "" msgid "Nicaragua" msgstr "" -#: i18n/countries.php:177 +#: i18n/countries.php:177 i18n/states/NG.php:40 msgid "Niger" msgstr "" @@ -3385,6 +3385,150 @@ msgstr "" msgid "Kuala Lumpur" msgstr "" +#: i18n/states/NG.php:14 +msgid "Abia" +msgstr "" + +#: i18n/states/NG.php:15 +msgid "Abuja" +msgstr "" + +#: i18n/states/NG.php:16 +msgid "Adamawa" +msgstr "" + +#: i18n/states/NG.php:17 +msgid "Akwa Ibom" +msgstr "" + +#: i18n/states/NG.php:18 +msgid "Anambra" +msgstr "" + +#: i18n/states/NG.php:19 +msgid "Bauchi" +msgstr "" + +#: i18n/states/NG.php:20 +msgid "Bayelsa" +msgstr "" + +#: i18n/states/NG.php:21 +msgid "Benue" +msgstr "" + +#: i18n/states/NG.php:22 +msgid "Borno" +msgstr "" + +#: i18n/states/NG.php:23 +msgid "Cross River" +msgstr "" + +#: i18n/states/NG.php:24 +msgid "Delta" +msgstr "" + +#: i18n/states/NG.php:25 +msgid "Ebonyi" +msgstr "" + +#: i18n/states/NG.php:26 +msgid "Edo" +msgstr "" + +#: i18n/states/NG.php:27 +msgid "Ekiti" +msgstr "" + +#: i18n/states/NG.php:28 +msgid "Enugu" +msgstr "" + +#: i18n/states/NG.php:29 +msgid "Gombe" +msgstr "" + +#: i18n/states/NG.php:30 +msgid "Imo" +msgstr "" + +#: i18n/states/NG.php:31 +msgid "Jigawa" +msgstr "" + +#: i18n/states/NG.php:32 +msgid "Kaduna" +msgstr "" + +#: i18n/states/NG.php:33 +msgid "Kano" +msgstr "" + +#: i18n/states/NG.php:34 +msgid "Katsina" +msgstr "" + +#: i18n/states/NG.php:35 +msgid "Kebbi" +msgstr "" + +#: i18n/states/NG.php:36 +msgid "Kogi" +msgstr "" + +#: i18n/states/NG.php:37 +msgid "Kwara" +msgstr "" + +#: i18n/states/NG.php:38 +msgid "Lagos" +msgstr "" + +#: i18n/states/NG.php:39 +msgid "Nasarawa" +msgstr "" + +#: i18n/states/NG.php:41 +msgid "Ogun" +msgstr "" + +#: i18n/states/NG.php:42 +msgid "Ondo" +msgstr "" + +#: i18n/states/NG.php:43 +msgid "Osun" +msgstr "" + +#: i18n/states/NG.php:44 +msgid "Oyo" +msgstr "" + +#: i18n/states/NG.php:45 +msgid "Plateau" +msgstr "" + +#: i18n/states/NG.php:46 +msgid "Rivers" +msgstr "" + +#: i18n/states/NG.php:47 +msgid "Sokoto" +msgstr "" + +#: i18n/states/NG.php:48 +msgid "Taraba" +msgstr "" + +#: i18n/states/NG.php:49 +msgid "Yobe" +msgstr "" + +#: i18n/states/NG.php:50 +msgid "Zamfara" +msgstr "" + #: i18n/states/NP.php:13 msgid "Bagmati" msgstr "" @@ -4868,12 +5012,12 @@ msgstr "" #: includes/abstracts/abstract-wc-order.php:1708 #: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:94 #: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:689 -#: includes/admin/meta-boxes/views/html-order-items.php:156 +#: includes/admin/meta-boxes/views/html-order-items.php:157 #: includes/admin/meta-boxes/views/html-order-shipping.php:18 #: includes/admin/settings/class-wc-settings-shipping.php:27 #: includes/admin/settings/class-wc-settings-tax.php:185 #: includes/admin/settings/views/html-settings-tax.php:27 -#: includes/wc-cart-functions.php:210 templates/cart/cart-totals.php:55 +#: includes/wc-cart-functions.php:217 templates/cart/cart-totals.php:55 #: templates/cart/cart-totals.php:56 msgid "Shipping" msgstr "" @@ -4883,11 +5027,11 @@ msgid "via %s" msgstr "" #: includes/abstracts/abstract-wc-order.php:1870 -#: includes/abstracts/abstract-wc-product.php:1035 -#: includes/abstracts/abstract-wc-product.php:1041 -#: includes/class-wc-cart.php:1612 includes/class-wc-product-grouped.php:156 -#: includes/class-wc-product-variable.php:362 -#: includes/class-wc-product-variation.php:326 +#: includes/abstracts/abstract-wc-product.php:1022 +#: includes/abstracts/abstract-wc-product.php:1028 +#: includes/class-wc-cart.php:1608 includes/class-wc-product-grouped.php:156 +#: includes/class-wc-product-variable.php:363 +#: includes/class-wc-product-variation.php:331 msgid "Free!" msgstr "" @@ -4916,7 +5060,7 @@ msgid "Payment Method:" msgstr "" #: includes/abstracts/abstract-wc-order.php:2009 -#: includes/admin/meta-boxes/views/html-order-items.php:229 +#: includes/admin/meta-boxes/views/html-order-items.php:230 #: includes/admin/meta-boxes/views/html-order-refund.php:16 msgid "Refund" msgstr "" @@ -4974,18 +5118,18 @@ msgstr "" #: includes/abstracts/abstract-wc-product.php:584 #: includes/class-wc-product-simple.php:48 -#: includes/class-wc-product-variation.php:206 +#: includes/class-wc-product-variation.php:211 msgid "Add to cart" msgstr "" #: includes/abstracts/abstract-wc-product.php:593 #: includes/class-wc-embed.php:112 includes/class-wc-product-simple.php:48 #: includes/class-wc-product-variable.php:43 -#: includes/class-wc-product-variation.php:206 +#: includes/class-wc-product-variation.php:211 msgid "Read more" msgstr "" -#: includes/abstracts/abstract-wc-product.php:692 +#: includes/abstracts/abstract-wc-product.php:679 #: includes/admin/class-wc-admin-post-types.php:407 #: includes/admin/class-wc-admin-reports.php:100 #: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:329 @@ -4996,13 +5140,13 @@ msgstr "" msgid "Out of stock" msgstr "" -#: includes/abstracts/abstract-wc-product.php:694 templates/cart/cart.php:92 +#: includes/abstracts/abstract-wc-product.php:681 templates/cart/cart.php:92 msgid "Available on backorder" msgstr "" -#: includes/abstracts/abstract-wc-product.php:694 -#: includes/abstracts/abstract-wc-product.php:698 -#: includes/abstracts/abstract-wc-product.php:708 +#: includes/abstracts/abstract-wc-product.php:681 +#: includes/abstracts/abstract-wc-product.php:685 +#: includes/abstracts/abstract-wc-product.php:695 #: includes/admin/class-wc-admin-post-types.php:405 #: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:328 #: includes/admin/reports/class-wc-report-stock.php:115 @@ -5012,25 +5156,25 @@ msgstr "" msgid "In stock" msgstr "" -#: includes/abstracts/abstract-wc-product.php:702 +#: includes/abstracts/abstract-wc-product.php:689 msgid "Only %s left in stock" msgstr "" -#: includes/abstracts/abstract-wc-product.php:705 -#: includes/abstracts/abstract-wc-product.php:715 +#: includes/abstracts/abstract-wc-product.php:692 +#: includes/abstracts/abstract-wc-product.php:702 msgid "(also available on backorder)" msgstr "" -#: includes/abstracts/abstract-wc-product.php:712 +#: includes/abstracts/abstract-wc-product.php:699 msgid "%s in stock" msgstr "" -#: includes/abstracts/abstract-wc-product.php:1196 +#: includes/abstracts/abstract-wc-product.php:1183 #: includes/class-wc-embed.php:127 templates/single-product/rating.php:36 msgid "Rated %s out of 5" msgstr "" -#: includes/abstracts/abstract-wc-product.php:1198 +#: includes/abstracts/abstract-wc-product.php:1185 #: includes/admin/class-wc-admin-dashboard.php:192 #: templates/single-product/review-rating.php:29 msgid "out of 5" @@ -5061,6 +5205,8 @@ msgstr "" #: includes/api/class-wc-rest-product-reviews-controller.php:74 #: includes/api/class-wc-rest-report-sales-controller.php:69 #: includes/api/class-wc-rest-reports-controller.php:62 +#: includes/api/class-wc-rest-settings-controller.php:173 +#: includes/api/class-wc-rest-settings-options-controller.php:285 #: includes/api/class-wc-rest-tax-classes-controller.php:83 #: includes/api/class-wc-rest-taxes-controller.php:107 #: includes/api/class-wc-rest-webhook-deliveries.php:74 @@ -5109,7 +5255,7 @@ msgid "Sorry, you are not allowed to manipule this resource." msgstr "" #: includes/abstracts/abstract-wc-rest-posts-controller.php:155 -msgid "Invalid id." +msgid "Invalid ID." msgstr "" #: includes/abstracts/abstract-wc-rest-posts-controller.php:176 @@ -5127,8 +5273,6 @@ msgid "ID is invalid." msgstr "" #: includes/abstracts/abstract-wc-rest-posts-controller.php:418 -#: includes/api/class-wc-rest-products-controller.php:1735 -#: includes/api/class-wc-rest-webhooks-controller.php:305 msgid "Invalid post id." msgstr "" @@ -5154,57 +5298,54 @@ msgstr "" msgid "The %s cannot be deleted." msgstr "" -#: includes/abstracts/abstract-wc-rest-posts-controller.php:609 +#: includes/abstracts/abstract-wc-rest-posts-controller.php:613 msgid "Limit response to resources published after a given ISO8601 compliant date." msgstr "" -#: includes/abstracts/abstract-wc-rest-posts-controller.php:615 +#: includes/abstracts/abstract-wc-rest-posts-controller.php:619 msgid "Limit response to resources published before a given ISO8601 compliant date." msgstr "" -#: includes/abstracts/abstract-wc-rest-posts-controller.php:621 -#: includes/abstracts/abstract-wc-rest-terms-controller.php:684 +#: includes/abstracts/abstract-wc-rest-posts-controller.php:625 #: includes/api/class-wc-rest-customers-controller.php:840 #: includes/api/class-wc-rest-taxes-controller.php:650 -msgid "Ensure result set excludes specific ids." +msgid "Ensure result set excludes specific IDs." msgstr "" -#: includes/abstracts/abstract-wc-rest-posts-controller.php:627 +#: includes/abstracts/abstract-wc-rest-posts-controller.php:631 #: includes/abstracts/abstract-wc-rest-terms-controller.php:690 -#: includes/api/class-wc-rest-customers-controller.php:846 -#: includes/api/class-wc-rest-taxes-controller.php:656 msgid "Limit result set to specific ids." msgstr "" -#: includes/abstracts/abstract-wc-rest-posts-controller.php:633 +#: includes/abstracts/abstract-wc-rest-posts-controller.php:637 #: includes/abstracts/abstract-wc-rest-terms-controller.php:697 #: includes/api/class-wc-rest-customers-controller.php:852 #: includes/api/class-wc-rest-taxes-controller.php:662 msgid "Offset the result set by a specific number of items." msgstr "" -#: includes/abstracts/abstract-wc-rest-posts-controller.php:639 +#: includes/abstracts/abstract-wc-rest-posts-controller.php:643 #: includes/abstracts/abstract-wc-rest-terms-controller.php:704 #: includes/api/class-wc-rest-customers-controller.php:859 #: includes/api/class-wc-rest-taxes-controller.php:669 msgid "Order sort attribute ascending or descending." msgstr "" -#: includes/abstracts/abstract-wc-rest-posts-controller.php:646 +#: includes/abstracts/abstract-wc-rest-posts-controller.php:650 #: includes/api/class-wc-rest-customers-controller.php:867 #: includes/api/class-wc-rest-taxes-controller.php:677 msgid "Sort collection by object attribute." msgstr "" -#: includes/abstracts/abstract-wc-rest-posts-controller.php:662 -msgid "Limit result set to those of particular parent ids." +#: includes/abstracts/abstract-wc-rest-posts-controller.php:666 +msgid "Limit result set to those of particular parent IDs." msgstr "" -#: includes/abstracts/abstract-wc-rest-posts-controller.php:668 -msgid "Limit result set to all items except those of a particular parent id." +#: includes/abstracts/abstract-wc-rest-posts-controller.php:672 +msgid "Limit result set to all items except those of a particular parent ID." msgstr "" -#: includes/abstracts/abstract-wc-rest-posts-controller.php:676 +#: includes/abstracts/abstract-wc-rest-posts-controller.php:680 msgid "" "Use WP Query arguments to modify the response; private query vars require " "appropriate authorization." @@ -5228,6 +5369,7 @@ msgstr "" #: includes/abstracts/abstract-wc-rest-terms-controller.php:165 #: includes/api/class-wc-rest-product-attributes-controller.php:168 +#: includes/api/class-wc-rest-settings-options-controller.php:300 msgid "Sorry, you cannot update resource." msgstr "" @@ -5271,6 +5413,10 @@ msgstr "" msgid "The resource cannot be deleted." msgstr "" +#: includes/abstracts/abstract-wc-rest-terms-controller.php:684 +msgid "Ensure result set excludes specific ids." +msgstr "" + #: includes/abstracts/abstract-wc-rest-terms-controller.php:715 msgid "Sort collection by resource attribute." msgstr "" @@ -5336,10 +5482,10 @@ msgstr "" #: includes/admin/settings/views/html-keys-edit.php:16 #: includes/gateways/bacs/class-wc-gateway-bacs.php:86 #: includes/gateways/cheque/class-wc-gateway-cheque.php:67 -#: includes/gateways/cod/class-wc-gateway-cod.php:75 +#: includes/gateways/cod/class-wc-gateway-cod.php:76 #: includes/gateways/paypal/includes/settings-paypal.php:25 #: includes/gateways/simplify-commerce/class-wc-gateway-simplify-commerce.php:202 -#: includes/wc-template-functions.php:1106 +#: includes/wc-template-functions.php:1137 msgid "Description" msgstr "" @@ -5569,12 +5715,12 @@ msgid "Remove this attribute?" msgstr "" #: includes/admin/class-wc-admin-assets.php:242 -#: includes/admin/class-wc-admin-attributes.php:276 +#: includes/admin/class-wc-admin-attributes.php:277 #: includes/admin/class-wc-admin-attributes.php:331 -#: includes/admin/class-wc-admin-attributes.php:365 +#: includes/admin/class-wc-admin-attributes.php:366 #: includes/admin/class-wc-admin-attributes.php:388 -#: includes/admin/class-wc-admin-attributes.php:444 -#: includes/admin/class-wc-admin-attributes.php:485 +#: includes/admin/class-wc-admin-attributes.php:446 +#: includes/admin/class-wc-admin-attributes.php:487 #: includes/admin/class-wc-admin-post-types.php:224 #: includes/admin/class-wc-admin-setup-wizard.php:467 #: includes/admin/class-wc-admin-webhooks-table-list.php:40 @@ -5582,7 +5728,7 @@ msgstr "" #: includes/admin/meta-boxes/views/html-product-attribute.php:12 #: includes/admin/meta-boxes/views/html-variation-admin.php:258 #: includes/admin/settings/views/html-webhooks-edit.php:15 -#: includes/admin/views/html-admin-page-status-report.php:646 +#: includes/admin/views/html-admin-page-status-report.php:658 #: includes/class-wc-ajax.php:1435 #: includes/widgets/class-wc-widget-product-categories.php:52 #: templates/single-product-reviews.php:73 @@ -5594,7 +5740,7 @@ msgstr "" #: includes/admin/meta-boxes/views/html-variation-admin.php:17 #: includes/admin/settings/views/html-admin-page-shipping-classes.php:48 #: includes/admin/settings/views/html-admin-page-shipping-zone-methods.php:52 -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:87 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:88 msgid "Remove" msgstr "" @@ -5699,14 +5845,14 @@ msgid "Copying to clipboard failed. Please press Ctrl/Cmd+C to copy." msgstr "" #: includes/admin/class-wc-admin-attributes.php:98 -#: includes/api/legacy/v2/class-wc-api-products.php:2087 -#: includes/api/legacy/v3/class-wc-api-products.php:2668 +#: includes/api/legacy/v2/class-wc-api-products.php:2095 +#: includes/api/legacy/v3/class-wc-api-products.php:2676 msgid "Slug \"%s\" is too long (28 characters max). Shorten it, please." msgstr "" #: includes/admin/class-wc-admin-attributes.php:100 -#: includes/api/legacy/v2/class-wc-api-products.php:2089 -#: includes/api/legacy/v3/class-wc-api-products.php:2670 +#: includes/api/legacy/v2/class-wc-api-products.php:2097 +#: includes/api/legacy/v3/class-wc-api-products.php:2678 msgid "Slug \"%s\" is not allowed because it is a reserved term. Change it, please." msgstr "" @@ -5717,8 +5863,8 @@ msgstr "" #: includes/admin/class-wc-admin-attributes.php:121 #: includes/admin/class-wc-admin-attributes.php:154 -#: includes/api/legacy/v2/class-wc-api-products.php:2091 -#: includes/api/legacy/v3/class-wc-api-products.php:2672 +#: includes/api/legacy/v2/class-wc-api-products.php:2099 +#: includes/api/legacy/v3/class-wc-api-products.php:2680 msgid "Slug \"%s\" is already in use. Change it, please." msgstr "" @@ -5734,46 +5880,46 @@ msgstr "" msgid "Error: non-existing attribute ID." msgstr "" -#: includes/admin/class-wc-admin-attributes.php:280 -#: includes/admin/class-wc-admin-attributes.php:446 +#: includes/admin/class-wc-admin-attributes.php:281 +#: includes/admin/class-wc-admin-attributes.php:448 msgid "Name for the attribute (shown on the front-end)." msgstr "" -#: includes/admin/class-wc-admin-attributes.php:285 -#: includes/admin/class-wc-admin-attributes.php:366 -#: includes/admin/class-wc-admin-attributes.php:450 +#: includes/admin/class-wc-admin-attributes.php:286 +#: includes/admin/class-wc-admin-attributes.php:367 +#: includes/admin/class-wc-admin-attributes.php:452 #: includes/admin/settings/class-wc-settings-shipping.php:306 #: includes/admin/settings/views/html-admin-page-shipping-classes.php:62 msgid "Slug" msgstr "" -#: includes/admin/class-wc-admin-attributes.php:289 -#: includes/admin/class-wc-admin-attributes.php:452 +#: includes/admin/class-wc-admin-attributes.php:290 +#: includes/admin/class-wc-admin-attributes.php:454 msgid "Unique slug/reference for the attribute; must be shorter than 28 characters." msgstr "" -#: includes/admin/class-wc-admin-attributes.php:294 -#: includes/admin/class-wc-admin-attributes.php:456 +#: includes/admin/class-wc-admin-attributes.php:295 +#: includes/admin/class-wc-admin-attributes.php:458 msgid "Enable Archives?" msgstr "" -#: includes/admin/class-wc-admin-attributes.php:298 -#: includes/admin/class-wc-admin-attributes.php:458 +#: includes/admin/class-wc-admin-attributes.php:299 +#: includes/admin/class-wc-admin-attributes.php:460 msgid "" "Enable this if you want this attribute to have product archives in your " "store." msgstr "" -#: includes/admin/class-wc-admin-attributes.php:303 -#: includes/admin/class-wc-admin-attributes.php:367 -#: includes/admin/class-wc-admin-attributes.php:462 +#: includes/admin/class-wc-admin-attributes.php:304 +#: includes/admin/class-wc-admin-attributes.php:368 +#: includes/admin/class-wc-admin-attributes.php:464 #: includes/admin/class-wc-admin-post-types.php:238 #: includes/admin/settings/views/html-admin-page-shipping-zone-methods.php:21 msgid "Type" msgstr "" #: includes/admin/class-wc-admin-attributes.php:321 -#: includes/admin/class-wc-admin-attributes.php:478 +#: includes/admin/class-wc-admin-attributes.php:480 msgid "" "Determines how you select attributes for products. Under admin panel -> " "products -> product data -> attributes -> values, Text " @@ -5782,52 +5928,52 @@ msgid "" msgstr "" #: includes/admin/class-wc-admin-attributes.php:326 -#: includes/admin/class-wc-admin-attributes.php:482 +#: includes/admin/class-wc-admin-attributes.php:484 msgid "Default sort order" msgstr "" #: includes/admin/class-wc-admin-attributes.php:330 #: includes/admin/class-wc-admin-attributes.php:397 -#: includes/admin/class-wc-admin-attributes.php:484 +#: includes/admin/class-wc-admin-attributes.php:486 msgid "Custom ordering" msgstr "" #: includes/admin/class-wc-admin-attributes.php:332 #: includes/admin/class-wc-admin-attributes.php:391 -#: includes/admin/class-wc-admin-attributes.php:486 +#: includes/admin/class-wc-admin-attributes.php:488 msgid "Name (numeric)" msgstr "" #: includes/admin/class-wc-admin-attributes.php:333 #: includes/admin/class-wc-admin-attributes.php:394 -#: includes/admin/class-wc-admin-attributes.php:487 +#: includes/admin/class-wc-admin-attributes.php:489 msgid "Term ID" msgstr "" #: includes/admin/class-wc-admin-attributes.php:335 -#: includes/admin/class-wc-admin-attributes.php:489 +#: includes/admin/class-wc-admin-attributes.php:491 msgid "" "Determines the sort order of the terms on the frontend shop product pages. " "If using custom ordering, you can drag and drop the terms in this attribute." msgstr "" -#: includes/admin/class-wc-admin-attributes.php:340 +#: includes/admin/class-wc-admin-attributes.php:341 msgid "Update" msgstr "" -#: includes/admin/class-wc-admin-attributes.php:357 +#: includes/admin/class-wc-admin-attributes.php:358 #: includes/admin/class-wc-admin-menus.php:62 #: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:104 msgid "Attributes" msgstr "" -#: includes/admin/class-wc-admin-attributes.php:368 +#: includes/admin/class-wc-admin-attributes.php:369 #: includes/widgets/class-wc-widget-product-categories.php:49 #: includes/widgets/class-wc-widget-products.php:53 msgid "Order by" msgstr "" -#: includes/admin/class-wc-admin-attributes.php:369 +#: includes/admin/class-wc-admin-attributes.php:370 msgid "Terms" msgstr "" @@ -5841,7 +5987,7 @@ msgstr "" #: includes/admin/reports/class-wc-report-customer-list.php:159 #: includes/admin/reports/class-wc-report-stock.php:134 #: includes/admin/settings/views/html-admin-page-shipping-classes.php:48 -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:87 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:88 #: includes/class-wc-post-types.php:246 includes/class-wc-post-types.php:303 #: includes/class-wc-post-types.php:365 includes/class-wc-post-types.php:406 #: templates/myaccount/my-address.php:51 @@ -5880,11 +6026,11 @@ msgid "" "widgets. Please note: you cannot rename an attribute later on." msgstr "" -#: includes/admin/class-wc-admin-attributes.php:492 +#: includes/admin/class-wc-admin-attributes.php:496 msgid "Add Attribute" msgstr "" -#: includes/admin/class-wc-admin-attributes.php:503 +#: includes/admin/class-wc-admin-attributes.php:507 msgid "Are you sure you want to delete this attribute?" msgstr "" @@ -6022,7 +6168,7 @@ msgstr "" #: includes/admin/class-wc-admin-help.php:81 #: includes/admin/class-wc-admin-setup-wizard.php:614 #: includes/gateways/cod/class-wc-gateway-cod.php:26 -#: includes/gateways/cod/class-wc-gateway-cod.php:71 +#: includes/gateways/cod/class-wc-gateway-cod.php:72 msgid "Cash on Delivery" msgstr "" @@ -6064,7 +6210,6 @@ msgstr "" #: includes/admin/class-wc-admin-help.php:117 #: includes/admin/class-wc-admin-pointers.php:192 -#: includes/class-wc-post-types.php:63 includes/class-wc-post-types.php:65 #: includes/widgets/class-wc-widget-product-categories.php:43 msgid "Product Categories" msgstr "" @@ -6163,7 +6308,7 @@ msgstr "" #: includes/admin/class-wc-admin-help.php:215 msgid "" "If you would like to learn about using WooCommerce from an expert, consider " -"following a WooCommerce course ran by one of our educational partners." +"following a WooCommerce course offered by one of our educational partners." msgstr "" #: includes/admin/class-wc-admin-help.php:216 @@ -6225,7 +6370,7 @@ msgstr "" #: includes/admin/class-wc-admin-menus.php:80 #: includes/admin/settings/class-wc-settings-api.php:45 #: includes/admin/settings/views/html-admin-page-shipping-zone-methods.php:52 -#: includes/admin/views/html-admin-page-status-report.php:476 +#: includes/admin/views/html-admin-page-status-report.php:488 #: includes/class-wc-install.php:832 msgid "Settings" msgstr "" @@ -6297,7 +6442,7 @@ msgid "Coupon Data" msgstr "" #: includes/admin/class-wc-admin-meta-boxes.php:164 -#: includes/admin/settings/class-wc-settings-products.php:462 +#: includes/admin/settings/class-wc-settings-products.php:464 #: templates/single-product-reviews.php:35 msgid "Reviews" msgstr "" @@ -6411,7 +6556,7 @@ msgstr "" #: includes/admin/class-wc-admin-pointers.php:124 #: includes/admin/settings/class-wc-settings-products.php:47 -#: includes/admin/settings/class-wc-settings-products.php:363 +#: includes/admin/settings/class-wc-settings-products.php:365 msgid "Downloadable Products" msgstr "" @@ -6447,7 +6592,7 @@ msgid "" msgstr "" #: includes/admin/class-wc-admin-pointers.php:180 -#: includes/class-wc-post-types.php:99 includes/class-wc-post-types.php:101 +#: includes/class-wc-post-types.php:99 #: includes/widgets/class-wc-widget-product-tag-cloud.php:29 msgid "Product Tags" msgstr "" @@ -6706,10 +6851,12 @@ msgstr "" #: includes/admin/class-wc-admin-post-types.php:235 #: includes/admin/reports/class-wc-report-sales-by-category.php:192 +#: includes/class-wc-post-types.php:63 includes/class-wc-post-types.php:65 msgid "Categories" msgstr "" #: includes/admin/class-wc-admin-post-types.php:236 +#: includes/class-wc-post-types.php:101 msgid "Tags" msgstr "" @@ -6933,8 +7080,8 @@ msgstr "" #: includes/admin/class-wc-admin-post-types.php:797 #: includes/admin/reports/class-wc-report-stock.php:141 #: includes/admin/settings/views/html-admin-page-shipping-zones.php:36 -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:87 -#: includes/admin/views/html-admin-page-status-logs.php:23 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:88 +#: includes/admin/views/html-admin-page-status-logs.php:28 #: templates/myaccount/my-orders.php:76 templates/myaccount/orders.php:72 msgid "View" msgstr "" @@ -7118,8 +7265,8 @@ msgstr "" #: includes/admin/class-wc-admin-post-types.php:2136 #: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:157 #: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:735 -#: includes/admin/meta-boxes/views/html-order-items.php:245 -#: includes/admin/meta-boxes/views/html-order-items.php:291 +#: includes/admin/meta-boxes/views/html-order-items.php:246 +#: includes/admin/meta-boxes/views/html-order-items.php:292 #: templates/myaccount/my-orders.php:80 templates/myaccount/orders.php:76 msgid "Cancel" msgstr "" @@ -7222,7 +7369,7 @@ msgstr "" #: includes/admin/class-wc-admin-profile.php:129 #: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:75 #: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:124 -#: includes/wc-template-functions.php:1839 +#: includes/wc-template-functions.php:1892 #: templates/cart/shipping-calculator.php:39 msgid "Select a country…" msgstr "" @@ -7258,6 +7405,7 @@ msgstr "" #: includes/admin/class-wc-admin-reports.php:45 #: includes/admin/reports/class-wc-report-customer-list.php:212 #: includes/admin/settings/class-wc-settings-accounts.php:113 +#: includes/admin/settings/class-wc-settings-accounts.php:114 #: includes/class-wc-post-types.php:299 includes/class-wc-query.php:100 #: includes/wc-account-functions.php:90 msgid "Orders" @@ -7477,7 +7625,7 @@ msgstr "" #: includes/admin/class-wc-admin-setup-wizard.php:320 #: includes/admin/settings/class-wc-settings-general.php:179 -#: includes/admin/views/html-admin-page-status-report.php:491 +#: includes/admin/views/html-admin-page-status-report.php:503 msgid "Currency Position" msgstr "" @@ -7503,19 +7651,19 @@ msgstr "" #: includes/admin/class-wc-admin-setup-wizard.php:331 #: includes/admin/settings/class-wc-settings-general.php:196 -#: includes/admin/views/html-admin-page-status-report.php:496 +#: includes/admin/views/html-admin-page-status-report.php:508 msgid "Thousand Separator" msgstr "" #: includes/admin/class-wc-admin-setup-wizard.php:337 #: includes/admin/settings/class-wc-settings-general.php:206 -#: includes/admin/views/html-admin-page-status-report.php:501 +#: includes/admin/views/html-admin-page-status-report.php:513 msgid "Decimal Separator" msgstr "" #: includes/admin/class-wc-admin-setup-wizard.php:343 #: includes/admin/settings/class-wc-settings-general.php:216 -#: includes/admin/views/html-admin-page-status-report.php:506 +#: includes/admin/views/html-admin-page-status-report.php:518 msgid "Number of Decimals" msgstr "" @@ -7524,22 +7672,22 @@ msgid "Which unit should be used for product weights?" msgstr "" #: includes/admin/class-wc-admin-setup-wizard.php:352 -#: includes/admin/settings/class-wc-settings-products.php:430 +#: includes/admin/settings/class-wc-settings-products.php:432 msgid "kg" msgstr "" #: includes/admin/class-wc-admin-setup-wizard.php:353 -#: includes/admin/settings/class-wc-settings-products.php:431 +#: includes/admin/settings/class-wc-settings-products.php:433 msgid "g" msgstr "" #: includes/admin/class-wc-admin-setup-wizard.php:354 -#: includes/admin/settings/class-wc-settings-products.php:432 +#: includes/admin/settings/class-wc-settings-products.php:434 msgid "lbs" msgstr "" #: includes/admin/class-wc-admin-setup-wizard.php:355 -#: includes/admin/settings/class-wc-settings-products.php:433 +#: includes/admin/settings/class-wc-settings-products.php:435 msgid "oz" msgstr "" @@ -7549,27 +7697,27 @@ msgstr "" #: includes/admin/class-wc-admin-setup-wizard.php:363 #: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:200 -#: includes/admin/settings/class-wc-settings-products.php:447 +#: includes/admin/settings/class-wc-settings-products.php:449 msgid "m" msgstr "" #: includes/admin/class-wc-admin-setup-wizard.php:364 -#: includes/admin/settings/class-wc-settings-products.php:448 +#: includes/admin/settings/class-wc-settings-products.php:450 msgid "cm" msgstr "" #: includes/admin/class-wc-admin-setup-wizard.php:365 -#: includes/admin/settings/class-wc-settings-products.php:449 +#: includes/admin/settings/class-wc-settings-products.php:451 msgid "mm" msgstr "" #: includes/admin/class-wc-admin-setup-wizard.php:366 -#: includes/admin/settings/class-wc-settings-products.php:450 +#: includes/admin/settings/class-wc-settings-products.php:452 msgid "in" msgstr "" #: includes/admin/class-wc-admin-setup-wizard.php:367 -#: includes/admin/settings/class-wc-settings-products.php:451 +#: includes/admin/settings/class-wc-settings-products.php:453 msgid "yd" msgstr "" @@ -7628,9 +7776,9 @@ msgstr "" #: includes/admin/class-wc-admin-setup-wizard.php:486 msgid "" -"You may you need to add/edit rates based on your products or business " -"location which can be done from the %1$stax settings%2$s screen. If in " -"doubt, speak to an accountant." +"You may need to add/edit rates based on your products or business location " +"which can be done from the %1$stax settings%2$s screen. If in doubt, speak " +"to an accountant." msgstr "" #: includes/admin/class-wc-admin-setup-wizard.php:569 @@ -7664,11 +7812,11 @@ msgid "A simple offline gateway that lets you accept a check as method of paymen msgstr "" #: includes/admin/class-wc-admin-setup-wizard.php:609 -msgid "An simple offline gateway that lets you accept BACS payment." +msgid "A simple offline gateway that lets you accept BACS payment." msgstr "" #: includes/admin/class-wc-admin-setup-wizard.php:615 -msgid "An simple offline gateway that lets you accept cash on delivery." +msgid "A simple offline gateway that lets you accept cash on delivery." msgstr "" #: includes/admin/class-wc-admin-setup-wizard.php:646 @@ -8228,7 +8376,7 @@ msgstr "" #: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:480 #: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:497 #: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:517 -#: includes/admin/meta-boxes/views/html-order-items.php:309 +#: includes/admin/meta-boxes/views/html-order-items.php:310 #: includes/admin/reports/class-wc-report-sales-by-product.php:202 msgid "Search for a product…" msgstr "" @@ -8529,8 +8677,8 @@ msgstr "" #: includes/admin/meta-boxes/class-wc-meta-box-order-notes.php:82 #: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:428 -#: includes/admin/meta-boxes/views/html-order-items.php:314 -#: includes/admin/meta-boxes/views/html-order-items.php:371 +#: includes/admin/meta-boxes/views/html-order-items.php:315 +#: includes/admin/meta-boxes/views/html-order-items.php:372 msgid "Add" msgstr "" @@ -8724,7 +8872,7 @@ msgid "Standard" msgstr "" #: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:260 -#: includes/admin/meta-boxes/views/html-order-items.php:340 +#: includes/admin/meta-boxes/views/html-order-items.php:341 #: includes/admin/meta-boxes/views/html-variation-admin.php:223 msgid "Tax class" msgstr "" @@ -9033,7 +9181,7 @@ msgid "Downloadable products" msgstr "" #: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:701 -#: includes/admin/views/html-report-by-date.php:44 +#: includes/admin/views/html-report-by-date.php:48 msgid "Go" msgstr "" @@ -9230,135 +9378,135 @@ msgstr "" msgid "Increase stock" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:131 +#: includes/admin/meta-boxes/views/html-order-items.php:132 msgid "Coupon(s) Used" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:146 +#: includes/admin/meta-boxes/views/html-order-items.php:147 msgid "This is the total discount. Discounts are defined per line item." msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:146 +#: includes/admin/meta-boxes/views/html-order-items.php:147 msgid "Discount" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:156 +#: includes/admin/meta-boxes/views/html-order-items.php:157 msgid "This is the shipping and handling total costs for the order." msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:188 +#: includes/admin/meta-boxes/views/html-order-items.php:189 msgid "Order Total" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:208 +#: includes/admin/meta-boxes/views/html-order-items.php:209 msgid "Refunded" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:221 +#: includes/admin/meta-boxes/views/html-order-items.php:222 msgid "Add item(s)" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:223 +#: includes/admin/meta-boxes/views/html-order-items.php:224 msgid "To edit this order change the status back to \"Pending\"" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:223 +#: includes/admin/meta-boxes/views/html-order-items.php:224 msgid "This order is no longer editable." msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:226 -#: includes/admin/meta-boxes/views/html-order-items.php:328 +#: includes/admin/meta-boxes/views/html-order-items.php:227 +#: includes/admin/meta-boxes/views/html-order-items.php:329 msgid "Add tax" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:236 +#: includes/admin/meta-boxes/views/html-order-items.php:237 msgid "Calculate Taxes" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:237 +#: includes/admin/meta-boxes/views/html-order-items.php:238 msgid "Calculate Total" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:242 +#: includes/admin/meta-boxes/views/html-order-items.php:243 msgid "Add product(s)" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:243 +#: includes/admin/meta-boxes/views/html-order-items.php:244 msgid "Add fee" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:244 +#: includes/admin/meta-boxes/views/html-order-items.php:245 msgid "Add shipping cost" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:246 +#: includes/admin/meta-boxes/views/html-order-items.php:247 #: templates/myaccount/form-reset-password.php:47 msgid "Save" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:256 +#: includes/admin/meta-boxes/views/html-order-items.php:257 msgid "Restock refunded items" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:260 +#: includes/admin/meta-boxes/views/html-order-items.php:261 msgid "Amount already refunded" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:264 +#: includes/admin/meta-boxes/views/html-order-items.php:265 msgid "Total available to refund" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:268 +#: includes/admin/meta-boxes/views/html-order-items.php:269 #: includes/admin/reports/class-wc-report-sales-by-date.php:635 msgid "Refund amount" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:275 +#: includes/admin/meta-boxes/views/html-order-items.php:276 msgid "Note: the refund reason will be visible by the customer." msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:275 +#: includes/admin/meta-boxes/views/html-order-items.php:276 msgid "Reason for refund (optional)" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:287 +#: includes/admin/meta-boxes/views/html-order-items.php:288 msgid "Payment Gateway" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:289 +#: includes/admin/meta-boxes/views/html-order-items.php:290 msgid "" "The payment gateway used to place this order does not support automatic " "refunds." msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:290 +#: includes/admin/meta-boxes/views/html-order-items.php:291 msgid "" "You will need to manually issue a refund through your payment gateway after " "using this." msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:302 +#: includes/admin/meta-boxes/views/html-order-items.php:303 msgid "Add products" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:339 +#: includes/admin/meta-boxes/views/html-order-items.php:340 msgid "Rate name" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:341 +#: includes/admin/meta-boxes/views/html-order-items.php:342 msgid "Rate code" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:342 +#: includes/admin/meta-boxes/views/html-order-items.php:343 #: includes/admin/settings/class-wc-settings-tax.php:181 msgid "Rate %" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:363 +#: includes/admin/meta-boxes/views/html-order-items.php:364 msgid "Or, enter tax rate ID:" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:364 +#: includes/admin/meta-boxes/views/html-order-items.php:365 #: includes/gateways/paypal/includes/settings-paypal.php:113 #: includes/gateways/paypal/includes/settings-paypal.php:126 #: includes/gateways/paypal/includes/settings-paypal.php:134 @@ -9419,7 +9567,7 @@ msgid "Drag and drop, or click to set admin variation order" msgstr "" #: includes/admin/meta-boxes/views/html-variation-admin.php:33 -#: includes/class-wc-product-variation.php:652 +#: includes/class-wc-product-variation.php:644 msgid "Any" msgstr "" @@ -10034,62 +10182,50 @@ msgid "" msgstr "" #: includes/admin/settings/class-wc-settings-accounts.php:114 -msgid "Endpoint for the My Account → Orders page" +#: includes/admin/settings/class-wc-settings-accounts.php:123 +#: includes/admin/settings/class-wc-settings-accounts.php:132 +#: includes/admin/settings/class-wc-settings-accounts.php:141 +#: includes/admin/settings/class-wc-settings-accounts.php:150 +#: includes/admin/settings/class-wc-settings-accounts.php:159 +#: includes/admin/settings/class-wc-settings-accounts.php:168 +msgid "Endpoint for the My Account → %s page" msgstr "" #: includes/admin/settings/class-wc-settings-accounts.php:122 +#: includes/admin/settings/class-wc-settings-accounts.php:123 #: includes/class-wc-post-types.php:306 includes/class-wc-post-types.php:307 msgid "View Order" msgstr "" -#: includes/admin/settings/class-wc-settings-accounts.php:123 -msgid "Endpoint for the My Account → View Order page" -msgstr "" - #: includes/admin/settings/class-wc-settings-accounts.php:131 +#: includes/admin/settings/class-wc-settings-accounts.php:132 #: includes/class-wc-query.php:108 includes/wc-account-functions.php:91 msgid "Downloads" msgstr "" -#: includes/admin/settings/class-wc-settings-accounts.php:132 -msgid "Endpoint for the My Account → Downloads page" -msgstr "" - #: includes/admin/settings/class-wc-settings-accounts.php:140 +#: includes/admin/settings/class-wc-settings-accounts.php:141 msgid "Edit Account" msgstr "" -#: includes/admin/settings/class-wc-settings-accounts.php:141 -msgid "Endpoint for the My Account → Edit Account page" -msgstr "" - #: includes/admin/settings/class-wc-settings-accounts.php:149 +#: includes/admin/settings/class-wc-settings-accounts.php:150 #: includes/class-wc-query.php:114 includes/wc-account-functions.php:92 msgid "Addresses" msgstr "" -#: includes/admin/settings/class-wc-settings-accounts.php:150 -msgid "Endpoint for the My Account → Addresses page" -msgstr "" - #: includes/admin/settings/class-wc-settings-accounts.php:158 +#: includes/admin/settings/class-wc-settings-accounts.php:159 #: includes/class-wc-query.php:117 includes/wc-account-functions.php:93 msgid "Payment Methods" msgstr "" -#: includes/admin/settings/class-wc-settings-accounts.php:159 -msgid "Endpoint for the My Account → Payment Methods page" -msgstr "" - #: includes/admin/settings/class-wc-settings-accounts.php:167 +#: includes/admin/settings/class-wc-settings-accounts.php:168 #: includes/class-wc-query.php:123 msgid "Lost Password" msgstr "" -#: includes/admin/settings/class-wc-settings-accounts.php:168 -msgid "Endpoint for the My Account → Lost Password page" -msgstr "" - #: includes/admin/settings/class-wc-settings-accounts.php:176 #: includes/wc-account-functions.php:95 templates/auth/form-grant-access.php:39 msgid "Logout" @@ -10103,7 +10239,7 @@ msgstr "" #: includes/admin/settings/class-wc-settings-api.php:27 #: includes/admin/settings/class-wc-settings-api.php:68 -#: includes/admin/views/html-admin-page-status-report.php:515 +#: includes/admin/views/html-admin-page-status-report.php:527 msgid "API" msgstr "" @@ -10517,7 +10653,7 @@ msgid "Store Notice Text" msgstr "" #: includes/admin/settings/class-wc-settings-general.php:156 -#: includes/wc-template-functions.php:448 +#: includes/wc-template-functions.php:474 msgid "" "This is a demo store for testing purposes — no orders shall be " "fulfilled." @@ -10532,7 +10668,7 @@ msgid "The following options affect how prices are displayed on the frontend." msgstr "" #: includes/admin/settings/class-wc-settings-general.php:167 -#: includes/admin/views/html-admin-page-status-report.php:486 +#: includes/admin/views/html-admin-page-status-report.php:498 msgid "Currency" msgstr "" @@ -10681,7 +10817,7 @@ msgid "Catalog Images" msgstr "" #: includes/admin/settings/class-wc-settings-products.php:184 -msgid "This size is usually used in product listings" +msgid "This size is usually used in product listings. (W x H)" msgstr "" #: includes/admin/settings/class-wc-settings-products.php:197 @@ -10689,7 +10825,7 @@ msgid "Single Product Image" msgstr "" #: includes/admin/settings/class-wc-settings-products.php:198 -msgid "This is the size used by the main image on the product page." +msgid "This is the size used by the main image on the product page. (W x H)" msgstr "" #: includes/admin/settings/class-wc-settings-products.php:211 @@ -10697,7 +10833,9 @@ msgid "Product Thumbnails" msgstr "" #: includes/admin/settings/class-wc-settings-products.php:212 -msgid "This size is usually used for the gallery of images on the product page." +msgid "" +"This size is usually used for the gallery of images on the product page. (W " +"x H)" msgstr "" #: includes/admin/settings/class-wc-settings-products.php:225 @@ -10756,43 +10894,54 @@ msgstr "" msgid "Low Stock Threshold" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:317 +#: includes/admin/settings/class-wc-settings-products.php:304 +msgid "When product stock reaches this amount you will be notified via email." +msgstr "" + +#: includes/admin/settings/class-wc-settings-products.php:318 msgid "Out Of Stock Threshold" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:330 +#: includes/admin/settings/class-wc-settings-products.php:319 +msgid "" +"When product stock reaches this amount the stock status will change to " +"\"out of stock\" and you will be notified via email. This setting does not " +"affect existing \"in stock\" products." +msgstr "" + +#: includes/admin/settings/class-wc-settings-products.php:332 msgid "Out Of Stock Visibility" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:331 +#: includes/admin/settings/class-wc-settings-products.php:333 msgid "Hide out of stock items from the catalog" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:338 +#: includes/admin/settings/class-wc-settings-products.php:340 msgid "Stock Display Format" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:339 +#: includes/admin/settings/class-wc-settings-products.php:341 msgid "This controls how stock is displayed on the frontend." msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:346 +#: includes/admin/settings/class-wc-settings-products.php:348 msgid "Always show stock e.g. \"12 in stock\"" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:347 +#: includes/admin/settings/class-wc-settings-products.php:349 msgid "Only show stock when low e.g. \"Only 2 left in stock\" vs. \"In Stock\"" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:348 +#: includes/admin/settings/class-wc-settings-products.php:350 msgid "Never show stock amount" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:369 +#: includes/admin/settings/class-wc-settings-products.php:371 msgid "File Download Method" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:370 +#: includes/admin/settings/class-wc-settings-products.php:372 msgid "" "Forcing downloads will keep URLs hidden, but some servers may serve large " "files unreliably. If supported, X-Accel-Redirect/ " @@ -10800,77 +10949,77 @@ msgid "" "requires mod_xsendfile)." msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:378 +#: includes/admin/settings/class-wc-settings-products.php:380 msgid "Force Downloads" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:379 +#: includes/admin/settings/class-wc-settings-products.php:381 msgid "X-Accel-Redirect/X-Sendfile" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:380 +#: includes/admin/settings/class-wc-settings-products.php:382 msgid "Redirect only" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:386 +#: includes/admin/settings/class-wc-settings-products.php:388 msgid "Access Restriction" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:387 +#: includes/admin/settings/class-wc-settings-products.php:389 msgid "Downloads require login" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:391 +#: includes/admin/settings/class-wc-settings-products.php:393 msgid "This setting does not apply to guest purchases." msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:397 +#: includes/admin/settings/class-wc-settings-products.php:399 msgid "Grant access to downloadable products after payment" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:401 +#: includes/admin/settings/class-wc-settings-products.php:403 msgid "" "Enable this option to grant access to downloads when orders are " "\"processing\", rather than \"completed\"." msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:416 +#: includes/admin/settings/class-wc-settings-products.php:418 msgid "Measurements" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:422 +#: includes/admin/settings/class-wc-settings-products.php:424 msgid "Weight Unit" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:423 +#: includes/admin/settings/class-wc-settings-products.php:425 msgid "This controls what unit you will define weights in." msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:439 +#: includes/admin/settings/class-wc-settings-products.php:441 msgid "Dimensions Unit" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:440 +#: includes/admin/settings/class-wc-settings-products.php:442 msgid "This controls what unit you will define lengths in." msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:469 +#: includes/admin/settings/class-wc-settings-products.php:471 msgid "Product Ratings" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:470 +#: includes/admin/settings/class-wc-settings-products.php:472 msgid "Enable ratings on reviews" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:479 +#: includes/admin/settings/class-wc-settings-products.php:481 msgid "Ratings are required to leave a review" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:489 +#: includes/admin/settings/class-wc-settings-products.php:491 msgid "Show \"verified owner\" label for customer reviews" msgstr "" -#: includes/admin/settings/class-wc-settings-products.php:499 +#: includes/admin/settings/class-wc-settings-products.php:501 msgid "Only allow reviews from \"verified owners\"" msgstr "" @@ -10935,7 +11084,7 @@ msgid "Shipping method could not be added. Please retry." msgstr "" #: includes/admin/settings/class-wc-settings-shipping.php:244 -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:52 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:54 msgid "No shipping methods offered to this zone." msgstr "" @@ -11034,7 +11183,7 @@ msgid "Shipping Class Name" msgstr "" #: includes/admin/settings/views/html-admin-page-shipping-classes.php:54 -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:93 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:94 msgid "Cancel changes" msgstr "" @@ -11057,7 +11206,7 @@ msgstr "" #: includes/admin/settings/views/html-admin-page-shipping-zone-methods.php:19 #: includes/gateways/bacs/class-wc-gateway-bacs.php:79 #: includes/gateways/cheque/class-wc-gateway-cheque.php:60 -#: includes/gateways/cod/class-wc-gateway-cod.php:68 +#: includes/gateways/cod/class-wc-gateway-cod.php:69 #: includes/gateways/paypal/includes/settings-paypal.php:18 #: includes/gateways/simplify-commerce/class-wc-gateway-simplify-commerce.php:195 #: includes/shipping/free-shipping/class-wc-shipping-free-shipping.php:74 @@ -11082,10 +11231,10 @@ msgstr "" #: includes/admin/settings/views/html-admin-page-shipping-zone-methods.php:29 #: includes/admin/settings/views/html-admin-page-shipping-zone-methods.php:93 #: includes/admin/settings/views/html-admin-page-shipping-zone-methods.php:119 -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:55 -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:129 -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:141 -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:167 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:42 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:130 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:142 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:168 msgid "Add shipping method" msgstr "" @@ -11105,19 +11254,19 @@ msgstr "" #: includes/admin/settings/views/html-admin-page-shipping-zone-methods.php:68 #: includes/admin/settings/views/html-admin-page-shipping-zone-methods.php:95 -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:143 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:144 msgid "Close modal panel" msgstr "" #: includes/admin/settings/views/html-admin-page-shipping-zone-methods.php:101 -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:149 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:150 msgid "" "Choose the shipping method you wish to add. Only shipping methods which " "support zones are listed." msgstr "" #: includes/admin/settings/views/html-admin-page-shipping-zones.php:9 -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:66 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:67 msgid "" "A shipping zone is a geographic region where a certain set of shipping " "methods and rates apply." @@ -11137,7 +11286,7 @@ msgid "" msgstr "" #: includes/admin/settings/views/html-admin-page-shipping-zones.php:16 -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:91 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:92 msgid "Zone Name" msgstr "" @@ -11150,7 +11299,7 @@ msgid "Shipping Method(s)" msgstr "" #: includes/admin/settings/views/html-admin-page-shipping-zones.php:25 -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:74 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:75 msgid "Add shipping zone" msgstr "" @@ -11165,46 +11314,46 @@ msgid "" "other shipping zone. Adding shipping methods to this zone is optional." msgstr "" -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:55 -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:129 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:42 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:130 msgid "Save changes to continue adding shipping methods to this zone" msgstr "" -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:67 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:68 msgid "For example:" msgstr "" -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:69 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:70 msgid "Local Zone = California ZIP 90210 = Local pickup" msgstr "" -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:70 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:71 msgid "US Domestic Zone = All US states = Flat rate shipping" msgstr "" -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:71 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:72 msgid "Europe Zone = Any country in Europe = Flat rate shipping" msgstr "" -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:73 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:74 msgid "" "Add as many zones as you need – customers will only see the methods " "available for their address." msgstr "" -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:100 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:101 msgid "Select regions within this zone" msgstr "" -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:119 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:120 msgid "Limit to specific ZIP/postcodes" msgstr "" -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:121 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:122 msgid "List 1 postcode per line" msgstr "" -#: includes/admin/settings/views/html-admin-page-shipping-zones.php:122 +#: includes/admin/settings/views/html-admin-page-shipping-zones.php:123 msgid "" "Postcodes containing wildcards (e.g. CB23*) and fully numeric ranges (e.g. " "90210...99000) are also supported." @@ -11679,11 +11828,11 @@ msgstr "" msgid "Download & install" msgstr "" -#: includes/admin/views/html-admin-page-status-logs.php:14 -msgid "Log file: %s (%s)" +#: includes/admin/views/html-admin-page-status-logs.php:17 +msgid "Delete Log" msgstr "" -#: includes/admin/views/html-admin-page-status-logs.php:32 +#: includes/admin/views/html-admin-page-status-logs.php:37 msgid "There are currently no logs to view." msgstr "" @@ -12039,227 +12188,242 @@ msgid "" "be the same as your WooCommerce Version." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:376 +#: includes/admin/views/html-admin-page-status-report.php:350 +msgid "Database Prefix" +msgstr "" + +#: includes/admin/views/html-admin-page-status-report.php:354 +msgid "%s - We recommend using a prefix with less than 20 characters. See: %s" +msgstr "" + +#: includes/admin/views/html-admin-page-status-report.php:354 +msgid "How to update your database table prefix" +msgstr "" + +#: includes/admin/views/html-admin-page-status-report.php:388 msgid "Table does not exist" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:384 +#: includes/admin/views/html-admin-page-status-report.php:396 msgid "MaxMind GeoIP Database" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:385 +#: includes/admin/views/html-admin-page-status-report.php:397 msgid "The GeoIP database from MaxMind is used to geolocate customers." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:390 +#: includes/admin/views/html-admin-page-status-report.php:402 msgid "" "The MaxMind GeoIP Database does not exist - Geolocation will not function. " -"You can download and install it manually from %1$s to the path: %2$s" +"You can download and install it manually from %1$s to the path: %2$s. " +"Scroll down to \\\"Downloads\\\" and download the \\\"Binary / gzip\\\" " +"file next to \\\"GeoLite Country\\\". Please remember to uncompress " +"GeoIP.dat.gz and upload the GeoIP.dat file only." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:404 +#: includes/admin/views/html-admin-page-status-report.php:416 msgid "Active Plugins" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:429 +#: includes/admin/views/html-admin-page-status-report.php:441 msgid "Visit plugin homepage" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:457 +#: includes/admin/views/html-admin-page-status-report.php:469 msgid "Network enabled" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:481 +#: includes/admin/views/html-admin-page-status-report.php:493 msgid "Force SSL" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:482 +#: includes/admin/views/html-admin-page-status-report.php:494 msgid "Does your site force a SSL Certificate for transactions?" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:487 +#: includes/admin/views/html-admin-page-status-report.php:499 msgid "" "What currency prices are listed at in the catalog and which currency " "gateways will take payments in." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:492 +#: includes/admin/views/html-admin-page-status-report.php:504 msgid "The position of the currency symbol." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:497 +#: includes/admin/views/html-admin-page-status-report.php:509 msgid "The thousand separator of displayed prices." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:502 +#: includes/admin/views/html-admin-page-status-report.php:514 msgid "The decimal separator of displayed prices." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:507 +#: includes/admin/views/html-admin-page-status-report.php:519 msgid "The number of decimal points shown in displayed prices." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:520 +#: includes/admin/views/html-admin-page-status-report.php:532 msgid "API Enabled" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:521 +#: includes/admin/views/html-admin-page-status-report.php:533 msgid "Does your site have REST API enabled?" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:529 +#: includes/admin/views/html-admin-page-status-report.php:541 msgid "WC Pages" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:538 +#: includes/admin/views/html-admin-page-status-report.php:550 msgid "The URL of your WooCommerce shop's homepage (along with the Page ID)." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:543 +#: includes/admin/views/html-admin-page-status-report.php:555 msgid "The URL of your WooCommerce shop's cart (along with the page ID)." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:548 +#: includes/admin/views/html-admin-page-status-report.php:560 msgid "The URL of your WooCommerce shop's checkout (along with the page ID)." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:553 +#: includes/admin/views/html-admin-page-status-report.php:565 msgid "" "The URL of your WooCommerce shop's “My Account” Page (along with the page " "ID)." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:574 +#: includes/admin/views/html-admin-page-status-report.php:586 msgid "Page not set" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:577 +#: includes/admin/views/html-admin-page-status-report.php:589 msgid "Page ID is set, but the page does not exist" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:580 +#: includes/admin/views/html-admin-page-status-report.php:592 msgid "Page visibility should be %spublic%s" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:590 +#: includes/admin/views/html-admin-page-status-report.php:602 msgid "Page does not exist" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:595 +#: includes/admin/views/html-admin-page-status-report.php:607 msgid "Page does not contain the shortcode: %s" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:613 +#: includes/admin/views/html-admin-page-status-report.php:625 msgid "Taxonomies" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:613 +#: includes/admin/views/html-admin-page-status-report.php:625 msgid "" "A list of taxonomy terms that can be used in regard to order/product " "statuses." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:618 +#: includes/admin/views/html-admin-page-status-report.php:630 msgid "Product Types" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:634 +#: includes/admin/views/html-admin-page-status-report.php:646 msgid "Theme" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:647 +#: includes/admin/views/html-admin-page-status-report.php:659 msgid "The name of the current active theme." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:651 +#: includes/admin/views/html-admin-page-status-report.php:663 msgid "Version" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:652 +#: includes/admin/views/html-admin-page-status-report.php:664 msgid "The installed version of the current active theme." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:657 -#: includes/admin/views/html-admin-page-status-report.php:690 +#: includes/admin/views/html-admin-page-status-report.php:669 +#: includes/admin/views/html-admin-page-status-report.php:702 msgid "%s is available" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:662 +#: includes/admin/views/html-admin-page-status-report.php:674 msgid "Author URL" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:663 +#: includes/admin/views/html-admin-page-status-report.php:675 msgid "The theme developers URL." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:667 +#: includes/admin/views/html-admin-page-status-report.php:679 msgid "Child Theme" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:668 +#: includes/admin/views/html-admin-page-status-report.php:680 msgid "Displays whether or not the current theme is a child theme." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:670 +#: includes/admin/views/html-admin-page-status-report.php:682 msgid "" "If you're modifying WooCommerce on a parent theme you didn't build " "personally, then we recommend using a child theme. See: How to create a child theme" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:679 +#: includes/admin/views/html-admin-page-status-report.php:691 msgid "Parent Theme Name" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:680 +#: includes/admin/views/html-admin-page-status-report.php:692 msgid "The name of the parent theme." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:684 +#: includes/admin/views/html-admin-page-status-report.php:696 msgid "Parent Theme Version" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:685 +#: includes/admin/views/html-admin-page-status-report.php:697 msgid "The installed version of the parent theme." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:695 +#: includes/admin/views/html-admin-page-status-report.php:707 msgid "Parent Theme Author URL" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:696 +#: includes/admin/views/html-admin-page-status-report.php:708 msgid "The parent theme developers URL." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:701 +#: includes/admin/views/html-admin-page-status-report.php:713 msgid "WooCommerce Support" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:702 +#: includes/admin/views/html-admin-page-status-report.php:714 msgid "" "Displays whether or not the current active theme declares WooCommerce " "support." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:705 +#: includes/admin/views/html-admin-page-status-report.php:717 msgid "Not Declared" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:716 +#: includes/admin/views/html-admin-page-status-report.php:728 msgid "Templates" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:716 +#: includes/admin/views/html-admin-page-status-report.php:728 msgid "" "This section shows any files that are overriding the default WooCommerce " "template pages." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:722 +#: includes/admin/views/html-admin-page-status-report.php:734 msgid "Archive Template" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:724 +#: includes/admin/views/html-admin-page-status-report.php:736 msgid "" "Your theme has a woocommerce.php file, you will not be able to override the " "woocommerce/archive-product.php custom template since woocommerce.php has " @@ -12267,18 +12431,18 @@ msgid "" "issues." msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:758 +#: includes/admin/views/html-admin-page-status-report.php:770 msgid "" "%s version %s is out of " "date. The core version is %s" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:770 -#: includes/admin/views/html-admin-page-status-report.php:779 +#: includes/admin/views/html-admin-page-status-report.php:782 +#: includes/admin/views/html-admin-page-status-report.php:791 msgid "Overrides" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:791 +#: includes/admin/views/html-admin-page-status-report.php:803 msgid "Learn how to update outdated templates" msgstr "" @@ -12595,7 +12759,7 @@ msgstr "" msgid "Sale Price" msgstr "" -#: includes/admin/views/html-report-by-date.php:26 +#: includes/admin/views/html-report-by-date.php:30 msgid "Custom:" msgstr "" @@ -12815,16 +12979,14 @@ msgstr "" #: includes/api/class-wc-rest-customers-controller.php:356 #: includes/api/class-wc-rest-customers-controller.php:376 -#: includes/api/class-wc-rest-customers-controller.php:435 #: includes/api/class-wc-rest-order-notes-controller.php:253 #: includes/api/class-wc-rest-order-notes-controller.php:286 #: includes/api/class-wc-rest-product-reviews-controller.php:137 -#: includes/api/class-wc-rest-tax-classes-controller.php:236 #: includes/api/class-wc-rest-taxes-controller.php:392 #: includes/api/class-wc-rest-taxes-controller.php:412 #: includes/api/class-wc-rest-taxes-controller.php:455 #: includes/api/class-wc-rest-webhook-deliveries.php:138 -msgid "Invalid resource id." +msgid "Invalid resource ID." msgstr "" #: includes/api/class-wc-rest-customers-controller.php:380 @@ -12839,6 +13001,11 @@ msgstr "" msgid "Customers do not support trashing." msgstr "" +#: includes/api/class-wc-rest-customers-controller.php:435 +#: includes/api/class-wc-rest-tax-classes-controller.php:236 +msgid "Invalid resource id." +msgstr "" + #: includes/api/class-wc-rest-customers-controller.php:440 msgid "Invalid resource id for reassignment." msgstr "" @@ -12993,6 +13160,11 @@ msgstr "" msgid "List of shipping address data." msgstr "" +#: includes/api/class-wc-rest-customers-controller.php:846 +#: includes/api/class-wc-rest-taxes-controller.php:656 +msgid "Limit result set to specific IDs." +msgstr "" + #: includes/api/class-wc-rest-customers-controller.php:879 msgid "Limit result set to resources with a specific email." msgstr "" @@ -13005,7 +13177,8 @@ msgstr "" #: includes/api/class-wc-rest-order-notes-controller.php:203 #: includes/api/class-wc-rest-order-notes-controller.php:247 #: includes/api/class-wc-rest-order-notes-controller.php:280 -msgid "Invalid order id." +#: includes/api/class-wc-rest-order-refunds-controller.php:112 +msgid "Invalid order ID." msgstr "" #: includes/api/class-wc-rest-order-notes-controller.php:212 @@ -13031,10 +13204,6 @@ msgid "" "user will be notified)." msgstr "" -#: includes/api/class-wc-rest-order-refunds-controller.php:112 -msgid "Invalid order ID." -msgstr "" - #: includes/api/class-wc-rest-order-refunds-controller.php:118 msgid "Invalid order refund ID." msgstr "" @@ -13534,8 +13703,8 @@ msgid "Number of published products for the resource." msgstr "" #: includes/api/class-wc-rest-product-attributes-controller.php:363 -#: includes/api/legacy/v2/class-wc-api-products.php:2254 -#: includes/api/legacy/v3/class-wc-api-products.php:2836 +#: includes/api/legacy/v2/class-wc-api-products.php:2262 +#: includes/api/legacy/v3/class-wc-api-products.php:2844 msgid "Could not edit the attribute" msgstr "" @@ -13576,7 +13745,7 @@ msgid "Category name." msgstr "" #: includes/api/class-wc-rest-product-categories-controller.php:185 -msgid "The id for the parent of the resource." +msgid "The ID for the parent of the resource." msgstr "" #: includes/api/class-wc-rest-product-categories-controller.php:198 @@ -13625,7 +13794,7 @@ msgstr "" #: includes/api/class-wc-rest-product-reviews-controller.php:106 #: includes/api/class-wc-rest-product-reviews-controller.php:131 -msgid "Invalid product id." +msgid "Invalid product ID." msgstr "" #: includes/api/class-wc-rest-product-reviews-controller.php:226 @@ -13677,6 +13846,11 @@ msgstr "" msgid "The SKU already exists on another product." msgstr "" +#: includes/api/class-wc-rest-products-controller.php:1735 +#: includes/api/class-wc-rest-webhooks-controller.php:305 +msgid "Invalid post ID." +msgstr "" + #: includes/api/class-wc-rest-products-controller.php:1841 msgid "Product slug." msgstr "" @@ -14201,6 +14375,78 @@ msgstr "" msgid "A human-readable description of the resource." msgstr "" +#: includes/api/class-wc-rest-settings-controller.php:56 +msgid "No setting groups have been registered." +msgstr "" + +#: includes/api/class-wc-rest-settings-controller.php:192 +msgid "A unique identifier that can be used to link settings together." +msgstr "" + +#: includes/api/class-wc-rest-settings-controller.php:199 +#: includes/api/class-wc-rest-settings-options-controller.php:376 +msgid "A human readable translation wrapped label. Meant to be used in interfaces." +msgstr "" + +#: includes/api/class-wc-rest-settings-controller.php:206 +msgid "" +"A human readable translation wrapped description. Meant to be used in " +"interfaces" +msgstr "" + +#: includes/api/class-wc-rest-settings-controller.php:213 +msgid "ID of parent grouping." +msgstr "" + +#: includes/api/class-wc-rest-settings-controller.php:220 +msgid "IDs for settings sub groups." +msgstr "" + +#: includes/api/class-wc-rest-settings-options-controller.php:124 +#: includes/api/class-wc-rest-settings-options-controller.php:130 +msgid "Invalid setting group." +msgstr "" + +#: includes/api/class-wc-rest-settings-options-controller.php:156 +#: includes/api/class-wc-rest-settings-options-controller.php:168 +#: includes/api/class-wc-rest-settings-options-controller.php:174 +msgid "Invalid setting." +msgstr "" + +#: includes/api/class-wc-rest-settings-options-controller.php:369 +msgid "A unique identifier for the setting." +msgstr "" + +#: includes/api/class-wc-rest-settings-options-controller.php:383 +msgid "" +"A human readable translation wrapped description. Meant to be used in " +"interfaces." +msgstr "" + +#: includes/api/class-wc-rest-settings-options-controller.php:390 +msgid "Default value for the setting." +msgstr "" + +#: includes/api/class-wc-rest-settings-options-controller.php:394 +msgid "Extra help text explaining the setting." +msgstr "" + +#: includes/api/class-wc-rest-settings-options-controller.php:401 +msgid "Placeholder text to be displayed in text inputs." +msgstr "" + +#: includes/api/class-wc-rest-settings-options-controller.php:408 +msgid "" +"Type of setting. Allowed values: text, email, number, color, password, " +"textarea, select, multiselect, radio, image_width, checkbox." +msgstr "" + +#: includes/api/class-wc-rest-settings-options-controller.php:415 +msgid "" +"Array of options (key value pairs) for inputs such as select, multiselect, " +"and radio buttons." +msgstr "" + #: includes/api/class-wc-rest-tax-classes-controller.php:129 #: includes/api/legacy/v3/class-wc-api-taxes.php:534 #: includes/cli/class-wc-cli-tax.php:434 @@ -14258,7 +14504,7 @@ msgstr "" #: includes/api/class-wc-rest-webhook-deliveries.php:106 #: includes/api/class-wc-rest-webhook-deliveries.php:132 -msgid "Invalid webhook id." +msgid "Invalid webhook ID." msgstr "" #: includes/api/class-wc-rest-webhook-deliveries.php:224 @@ -14577,7 +14823,7 @@ msgstr "" #: includes/api/legacy/v2/class-wc-api-products.php:437 #: includes/api/legacy/v2/class-wc-api-resource.php:378 #: includes/api/legacy/v3/class-wc-api-products.php:492 -#: includes/api/legacy/v3/class-wc-api-products.php:3166 +#: includes/api/legacy/v3/class-wc-api-products.php:3174 #: includes/api/legacy/v3/class-wc-api-resource.php:377 msgid "This %s cannot be deleted" msgstr "" @@ -14592,14 +14838,14 @@ msgstr "" #: includes/api/legacy/v1/class-wc-api-resource.php:325 #: includes/api/legacy/v2/class-wc-api-products.php:450 -#: includes/api/legacy/v2/class-wc-api-products.php:2321 +#: includes/api/legacy/v2/class-wc-api-products.php:2329 #: includes/api/legacy/v2/class-wc-api-resource.php:386 #: includes/api/legacy/v3/class-wc-api-products.php:505 #: includes/api/legacy/v3/class-wc-api-products.php:845 #: includes/api/legacy/v3/class-wc-api-products.php:1033 -#: includes/api/legacy/v3/class-wc-api-products.php:2905 -#: includes/api/legacy/v3/class-wc-api-products.php:3173 -#: includes/api/legacy/v3/class-wc-api-products.php:3479 +#: includes/api/legacy/v3/class-wc-api-products.php:2913 +#: includes/api/legacy/v3/class-wc-api-products.php:3181 +#: includes/api/legacy/v3/class-wc-api-products.php:3487 #: includes/api/legacy/v3/class-wc-api-resource.php:386 #: includes/api/legacy/v3/class-wc-api-taxes.php:354 #: includes/api/legacy/v3/class-wc-api-taxes.php:665 @@ -14634,13 +14880,13 @@ msgstr "" #: includes/api/legacy/v2/class-wc-api-coupons.php:227 #: includes/api/legacy/v2/class-wc-api-customers.php:361 #: includes/api/legacy/v2/class-wc-api-products.php:224 -#: includes/api/legacy/v2/class-wc-api-products.php:2083 +#: includes/api/legacy/v2/class-wc-api-products.php:2091 #: includes/api/legacy/v2/class-wc-api-server.php:427 #: includes/api/legacy/v3/class-wc-api-coupons.php:227 #: includes/api/legacy/v3/class-wc-api-customers.php:362 #: includes/api/legacy/v3/class-wc-api-products.php:269 -#: includes/api/legacy/v3/class-wc-api-products.php:2664 -#: includes/api/legacy/v3/class-wc-api-products.php:3051 +#: includes/api/legacy/v3/class-wc-api-products.php:2672 +#: includes/api/legacy/v3/class-wc-api-products.php:3059 #: includes/api/legacy/v3/class-wc-api-server.php:427 #: includes/api/legacy/v3/class-wc-api-taxes.php:575 #: includes/class-wc-auth.php:176 includes/cli/class-wc-cli-coupon.php:63 @@ -14655,7 +14901,7 @@ msgstr "" #: includes/api/legacy/v2/class-wc-api-orders.php:1285 #: includes/api/legacy/v2/class-wc-api-orders.php:1574 #: includes/api/legacy/v2/class-wc-api-products.php:210 -#: includes/api/legacy/v2/class-wc-api-products.php:2119 +#: includes/api/legacy/v2/class-wc-api-products.php:2127 #: includes/api/legacy/v2/class-wc-api-webhooks.php:169 #: includes/api/legacy/v3/class-wc-api-coupons.php:213 #: includes/api/legacy/v3/class-wc-api-customers.php:348 @@ -14665,9 +14911,9 @@ msgstr "" #: includes/api/legacy/v3/class-wc-api-products.php:255 #: includes/api/legacy/v3/class-wc-api-products.php:681 #: includes/api/legacy/v3/class-wc-api-products.php:934 -#: includes/api/legacy/v3/class-wc-api-products.php:2700 -#: includes/api/legacy/v3/class-wc-api-products.php:3031 -#: includes/api/legacy/v3/class-wc-api-products.php:3365 +#: includes/api/legacy/v3/class-wc-api-products.php:2708 +#: includes/api/legacy/v3/class-wc-api-products.php:3039 +#: includes/api/legacy/v3/class-wc-api-products.php:3373 #: includes/api/legacy/v3/class-wc-api-taxes.php:184 #: includes/api/legacy/v3/class-wc-api-taxes.php:564 #: includes/api/legacy/v3/class-wc-api-webhooks.php:169 @@ -14694,7 +14940,7 @@ msgstr "" #: includes/api/legacy/v2/class-wc-api-orders.php:1342 #: includes/api/legacy/v2/class-wc-api-orders.php:1651 #: includes/api/legacy/v2/class-wc-api-products.php:312 -#: includes/api/legacy/v2/class-wc-api-products.php:2200 +#: includes/api/legacy/v2/class-wc-api-products.php:2208 #: includes/api/legacy/v2/class-wc-api-webhooks.php:245 #: includes/api/legacy/v3/class-wc-api-coupons.php:329 #: includes/api/legacy/v3/class-wc-api-customers.php:403 @@ -14704,9 +14950,9 @@ msgstr "" #: includes/api/legacy/v3/class-wc-api-products.php:362 #: includes/api/legacy/v3/class-wc-api-products.php:758 #: includes/api/legacy/v3/class-wc-api-products.php:979 -#: includes/api/legacy/v3/class-wc-api-products.php:2782 -#: includes/api/legacy/v3/class-wc-api-products.php:3094 -#: includes/api/legacy/v3/class-wc-api-products.php:3423 +#: includes/api/legacy/v3/class-wc-api-products.php:2790 +#: includes/api/legacy/v3/class-wc-api-products.php:3102 +#: includes/api/legacy/v3/class-wc-api-products.php:3431 #: includes/api/legacy/v3/class-wc-api-taxes.php:254 #: includes/api/legacy/v3/class-wc-api-webhooks.php:245 msgid "No %1$s data specified to edit %1$s" @@ -14723,11 +14969,11 @@ msgstr "" #: includes/api/legacy/v2/class-wc-api-coupons.php:526 #: includes/api/legacy/v2/class-wc-api-customers.php:791 #: includes/api/legacy/v2/class-wc-api-orders.php:1764 -#: includes/api/legacy/v2/class-wc-api-products.php:2387 +#: includes/api/legacy/v2/class-wc-api-products.php:2395 #: includes/api/legacy/v3/class-wc-api-coupons.php:526 #: includes/api/legacy/v3/class-wc-api-customers.php:780 #: includes/api/legacy/v3/class-wc-api-orders.php:1809 -#: includes/api/legacy/v3/class-wc-api-products.php:3215 +#: includes/api/legacy/v3/class-wc-api-products.php:3223 #: includes/api/legacy/v3/class-wc-api-taxes.php:457 msgid "No %1$s data specified to create/edit %1$s" msgstr "" @@ -14735,11 +14981,11 @@ msgstr "" #: includes/api/legacy/v2/class-wc-api-coupons.php:534 #: includes/api/legacy/v2/class-wc-api-customers.php:799 #: includes/api/legacy/v2/class-wc-api-orders.php:1772 -#: includes/api/legacy/v2/class-wc-api-products.php:2395 +#: includes/api/legacy/v2/class-wc-api-products.php:2403 #: includes/api/legacy/v3/class-wc-api-coupons.php:534 #: includes/api/legacy/v3/class-wc-api-customers.php:788 #: includes/api/legacy/v3/class-wc-api-orders.php:1817 -#: includes/api/legacy/v3/class-wc-api-products.php:3223 +#: includes/api/legacy/v3/class-wc-api-products.php:3231 #: includes/api/legacy/v3/class-wc-api-taxes.php:465 msgid "Unable to accept more than %s items for this request" msgstr "" @@ -15062,96 +15308,103 @@ msgstr "" msgid "The SKU already exists on another product" msgstr "" -#: includes/api/legacy/v2/class-wc-api-products.php:1813 -#: includes/api/legacy/v3/class-wc-api-products.php:2369 -#: includes/cli/class-wc-cli-product.php:2010 +#: includes/api/legacy/v2/class-wc-api-products.php:1812 +#: includes/api/legacy/v3/class-wc-api-products.php:2368 +#: includes/cli/class-wc-cli-product.php:2025 msgid "Invalid URL %s" msgstr "" -#: includes/api/legacy/v2/class-wc-api-products.php:1825 -#: includes/api/legacy/v2/class-wc-api-products.php:1827 -#: includes/api/legacy/v3/class-wc-api-products.php:2381 -#: includes/api/legacy/v3/class-wc-api-products.php:2383 -#: includes/cli/class-wc-cli-product.php:2022 -#: includes/cli/class-wc-cli-product.php:2024 includes/wc-rest-functions.php:68 -#: includes/wc-rest-functions.php:70 +#: includes/api/legacy/v2/class-wc-api-products.php:1824 +#: includes/api/legacy/v2/class-wc-api-products.php:1826 +#: includes/api/legacy/v3/class-wc-api-products.php:2380 +#: includes/api/legacy/v3/class-wc-api-products.php:2382 +#: includes/cli/class-wc-cli-product.php:2037 +#: includes/cli/class-wc-cli-product.php:2039 includes/wc-rest-functions.php:83 +#: includes/wc-rest-functions.php:85 msgid "Error getting remote image %s." msgstr "" -#: includes/api/legacy/v2/class-wc-api-products.php:1825 -#: includes/api/legacy/v3/class-wc-api-products.php:2381 -#: includes/cli/class-wc-cli-product.php:2022 includes/wc-rest-functions.php:68 +#: includes/api/legacy/v2/class-wc-api-products.php:1824 +#: includes/api/legacy/v3/class-wc-api-products.php:2380 +#: includes/cli/class-wc-cli-product.php:2037 includes/wc-rest-functions.php:83 msgid "Error: %s." msgstr "" -#: includes/api/legacy/v2/class-wc-api-products.php:1856 -#: includes/api/legacy/v3/class-wc-api-products.php:2412 -#: includes/cli/class-wc-cli-product.php:2053 +#: includes/api/legacy/v2/class-wc-api-products.php:1847 +#: includes/api/legacy/v3/class-wc-api-products.php:2403 +#: includes/cli/class-wc-cli-product.php:2060 +#: includes/wc-rest-functions.php:106 +msgid "Invalid image type." +msgstr "" + +#: includes/api/legacy/v2/class-wc-api-products.php:1864 +#: includes/api/legacy/v3/class-wc-api-products.php:2420 +#: includes/cli/class-wc-cli-product.php:2077 msgid "Zero size file downloaded" msgstr "" -#: includes/api/legacy/v2/class-wc-api-products.php:1997 -#: includes/api/legacy/v2/class-wc-api-products.php:2041 -#: includes/api/legacy/v3/class-wc-api-products.php:2578 -#: includes/api/legacy/v3/class-wc-api-products.php:2622 +#: includes/api/legacy/v2/class-wc-api-products.php:2005 +#: includes/api/legacy/v2/class-wc-api-products.php:2049 +#: includes/api/legacy/v3/class-wc-api-products.php:2586 +#: includes/api/legacy/v3/class-wc-api-products.php:2630 msgid "You do not have permission to read product attributes" msgstr "" -#: includes/api/legacy/v2/class-wc-api-products.php:2036 -#: includes/api/legacy/v3/class-wc-api-products.php:2617 -#: includes/api/legacy/v3/class-wc-api-products.php:2985 +#: includes/api/legacy/v2/class-wc-api-products.php:2044 +#: includes/api/legacy/v3/class-wc-api-products.php:2625 +#: includes/api/legacy/v3/class-wc-api-products.php:2993 msgid "Invalid product attribute ID" msgstr "" -#: includes/api/legacy/v2/class-wc-api-products.php:2051 -#: includes/api/legacy/v2/class-wc-api-products.php:2293 -#: includes/api/legacy/v3/class-wc-api-products.php:2632 -#: includes/api/legacy/v3/class-wc-api-products.php:2876 -#: includes/api/legacy/v3/class-wc-api-products.php:2929 -#: includes/api/legacy/v3/class-wc-api-products.php:2996 -#: includes/api/legacy/v3/class-wc-api-products.php:3044 -#: includes/api/legacy/v3/class-wc-api-products.php:3108 -#: includes/api/legacy/v3/class-wc-api-products.php:3159 +#: includes/api/legacy/v2/class-wc-api-products.php:2059 +#: includes/api/legacy/v2/class-wc-api-products.php:2301 +#: includes/api/legacy/v3/class-wc-api-products.php:2640 +#: includes/api/legacy/v3/class-wc-api-products.php:2884 +#: includes/api/legacy/v3/class-wc-api-products.php:2937 +#: includes/api/legacy/v3/class-wc-api-products.php:3004 +#: includes/api/legacy/v3/class-wc-api-products.php:3052 +#: includes/api/legacy/v3/class-wc-api-products.php:3116 +#: includes/api/legacy/v3/class-wc-api-products.php:3167 msgid "A product attribute with the provided ID could not be found" msgstr "" -#: includes/api/legacy/v2/class-wc-api-products.php:2096 -#: includes/api/legacy/v3/class-wc-api-products.php:2677 +#: includes/api/legacy/v2/class-wc-api-products.php:2104 +#: includes/api/legacy/v3/class-wc-api-products.php:2685 msgid "" "Invalid product attribute type - the product attribute type must be any of " "these: %s" msgstr "" -#: includes/api/legacy/v2/class-wc-api-products.php:2101 -#: includes/api/legacy/v3/class-wc-api-products.php:2682 +#: includes/api/legacy/v2/class-wc-api-products.php:2109 +#: includes/api/legacy/v3/class-wc-api-products.php:2690 msgid "" "Invalid product attribute order_by type - the product attribute order_by " "type must be any of these: %s" msgstr "" -#: includes/api/legacy/v2/class-wc-api-products.php:2126 -#: includes/api/legacy/v3/class-wc-api-products.php:2707 -#: includes/api/legacy/v3/class-wc-api-products.php:3038 +#: includes/api/legacy/v2/class-wc-api-products.php:2134 +#: includes/api/legacy/v3/class-wc-api-products.php:2715 +#: includes/api/legacy/v3/class-wc-api-products.php:3046 msgid "You do not have permission to create product attributes" msgstr "" -#: includes/api/legacy/v2/class-wc-api-products.php:2208 -#: includes/api/legacy/v3/class-wc-api-products.php:2790 -#: includes/api/legacy/v3/class-wc-api-products.php:3102 +#: includes/api/legacy/v2/class-wc-api-products.php:2216 +#: includes/api/legacy/v3/class-wc-api-products.php:2798 +#: includes/api/legacy/v3/class-wc-api-products.php:3110 msgid "You do not have permission to edit product attributes" msgstr "" -#: includes/api/legacy/v2/class-wc-api-products.php:2281 -#: includes/api/legacy/v3/class-wc-api-products.php:2864 +#: includes/api/legacy/v2/class-wc-api-products.php:2289 +#: includes/api/legacy/v3/class-wc-api-products.php:2872 msgid "You do not have permission to delete product attributes" msgstr "" -#: includes/api/legacy/v2/class-wc-api-products.php:2303 -#: includes/api/legacy/v3/class-wc-api-products.php:2886 +#: includes/api/legacy/v2/class-wc-api-products.php:2311 +#: includes/api/legacy/v3/class-wc-api-products.php:2894 msgid "Could not delete the attribute" msgstr "" -#: includes/api/legacy/v2/class-wc-api-products.php:2342 +#: includes/api/legacy/v2/class-wc-api-products.php:2350 msgid "Invalid product SKU" msgstr "" @@ -15265,53 +15518,53 @@ msgstr "" msgid "Could not delete the tag" msgstr "" -#: includes/api/legacy/v3/class-wc-api-products.php:2923 -#: includes/api/legacy/v3/class-wc-api-products.php:2990 +#: includes/api/legacy/v3/class-wc-api-products.php:2931 +#: includes/api/legacy/v3/class-wc-api-products.php:2998 msgid "You do not have permission to read product attribute terms" msgstr "" -#: includes/api/legacy/v3/class-wc-api-products.php:3002 +#: includes/api/legacy/v3/class-wc-api-products.php:3010 msgid "A product attribute term with the provided ID could not be found" msgstr "" -#: includes/api/legacy/v3/class-wc-api-products.php:3153 +#: includes/api/legacy/v3/class-wc-api-products.php:3161 msgid "You do not have permission to delete product attribute terms" msgstr "" -#: includes/api/legacy/v3/class-wc-api-products.php:3291 -#: includes/api/legacy/v3/class-wc-api-products.php:3326 +#: includes/api/legacy/v3/class-wc-api-products.php:3299 +#: includes/api/legacy/v3/class-wc-api-products.php:3334 msgid "You do not have permission to read product shipping classes" msgstr "" -#: includes/api/legacy/v3/class-wc-api-products.php:3321 +#: includes/api/legacy/v3/class-wc-api-products.php:3329 msgid "Invalid product shipping class ID" msgstr "" -#: includes/api/legacy/v3/class-wc-api-products.php:3332 +#: includes/api/legacy/v3/class-wc-api-products.php:3340 msgid "A product shipping class with the provided ID could not be found" msgstr "" -#: includes/api/legacy/v3/class-wc-api-products.php:3370 +#: includes/api/legacy/v3/class-wc-api-products.php:3378 msgid "You do not have permission to create product shipping classes" msgstr "" -#: includes/api/legacy/v3/class-wc-api-products.php:3388 +#: includes/api/legacy/v3/class-wc-api-products.php:3396 msgid "Product shipping class parent is invalid" msgstr "" -#: includes/api/legacy/v3/class-wc-api-products.php:3431 +#: includes/api/legacy/v3/class-wc-api-products.php:3439 msgid "You do not have permission to edit product shipping classes" msgstr "" -#: includes/api/legacy/v3/class-wc-api-products.php:3443 +#: includes/api/legacy/v3/class-wc-api-products.php:3451 msgid "Could not edit the shipping class" msgstr "" -#: includes/api/legacy/v3/class-wc-api-products.php:3468 +#: includes/api/legacy/v3/class-wc-api-products.php:3476 msgid "You do not have permission to delete product shipping classes" msgstr "" -#: includes/api/legacy/v3/class-wc-api-products.php:3474 +#: includes/api/legacy/v3/class-wc-api-products.php:3482 msgid "Could not delete the shipping class" msgstr "" @@ -15601,33 +15854,33 @@ msgstr "" msgid "Get cart should not be called before the wp_loaded action." msgstr "" -#: includes/class-wc-cart.php:930 includes/class-wc-cart.php:965 +#: includes/class-wc-cart.php:926 includes/class-wc-cart.php:961 #: includes/class-wc-frontend-scripts.php:312 -#: includes/wc-cart-functions.php:115 templates/cart/mini-cart.php:85 +#: includes/wc-cart-functions.php:116 includes/wc-template-functions.php:1401 msgid "View Cart" msgstr "" -#: includes/class-wc-cart.php:930 +#: includes/class-wc-cart.php:926 msgid "You cannot add another "%s" to your cart." msgstr "" -#: includes/class-wc-cart.php:936 +#: includes/class-wc-cart.php:932 msgid "Sorry, this product cannot be purchased." msgstr "" -#: includes/class-wc-cart.php:941 +#: includes/class-wc-cart.php:937 msgid "" "You cannot add "%s" to the cart because the product is out of " "stock." msgstr "" -#: includes/class-wc-cart.php:945 +#: includes/class-wc-cart.php:941 msgid "" "You cannot add that amount of "%s" to the cart because there is " "not enough stock (%s remaining)." msgstr "" -#: includes/class-wc-cart.php:966 +#: includes/class-wc-cart.php:962 msgid "" "You cannot add that amount to the cart — we have %s in stock and you " "already have %s in your cart." @@ -15890,7 +16143,7 @@ msgstr "" #: includes/class-wc-download-handler.php:100 #: includes/class-wc-form-handler.php:676 #: includes/shortcodes/class-wc-shortcode-checkout.php:176 -#: includes/shortcodes/class-wc-shortcode-my-account.php:113 +#: includes/shortcodes/class-wc-shortcode-my-account.php:118 msgid "Invalid order." msgstr "" @@ -16129,7 +16382,7 @@ msgid "Error processing checkout. Please try again." msgstr "" #: includes/class-wc-frontend-scripts.php:289 -#: includes/wc-template-functions.php:1789 +#: includes/wc-template-functions.php:1842 msgid "required" msgstr "" @@ -16207,96 +16460,96 @@ msgid "" "manually by clicking here.%3$s" msgstr "" -#: includes/class-wc-order.php:46 includes/wc-cart-functions.php:303 +#: includes/class-wc-order.php:46 includes/wc-cart-functions.php:310 msgid "(includes %s)" msgstr "" #: includes/class-wc-post-types.php:66 -msgid "Product Category" +msgid "Category" msgstr "" #: includes/class-wc-post-types.php:68 -msgid "Search Product Categories" +msgid "Search Categories" msgstr "" #: includes/class-wc-post-types.php:69 -msgid "All Product Categories" +msgid "All Categories" msgstr "" #: includes/class-wc-post-types.php:70 -msgid "Parent Product Category" +msgid "Parent Category" msgstr "" #: includes/class-wc-post-types.php:71 -msgid "Parent Product Category:" +msgid "Parent Category:" msgstr "" #: includes/class-wc-post-types.php:72 -msgid "Edit Product Category" +msgid "Edit Category" msgstr "" #: includes/class-wc-post-types.php:73 -msgid "Update Product Category" +msgid "Update Category" msgstr "" #: includes/class-wc-post-types.php:74 -msgid "Add New Product Category" +msgid "Add New Category" msgstr "" #: includes/class-wc-post-types.php:75 -msgid "New Product Category Name" +msgid "New Category Name" msgstr "" #: includes/class-wc-post-types.php:76 -msgid "No Product Category found" +msgid "No categories found" msgstr "" #: includes/class-wc-post-types.php:102 -msgid "Product Tag" +msgid "Tag" msgstr "" #: includes/class-wc-post-types.php:104 -msgid "Search Product Tags" +msgid "Search Tags" msgstr "" #: includes/class-wc-post-types.php:105 -msgid "All Product Tags" +msgid "All Tags" msgstr "" #: includes/class-wc-post-types.php:106 -msgid "Edit Product Tag" +msgid "Edit Tag" msgstr "" #: includes/class-wc-post-types.php:107 -msgid "Update Product Tag" +msgid "Update Tag" msgstr "" #: includes/class-wc-post-types.php:108 -msgid "Add New Product Tag" +msgid "Add New Tag" msgstr "" #: includes/class-wc-post-types.php:109 -msgid "New Product Tag Name" +msgid "New Tag Name" msgstr "" #: includes/class-wc-post-types.php:110 -msgid "Popular Product Tags" +msgid "Popular Tags" msgstr "" #: includes/class-wc-post-types.php:111 -msgid "Separate Product Tags with commas" +msgid "Separate Tags with commas" msgstr "" #: includes/class-wc-post-types.php:112 -msgid "Add or remove Product Tags" +msgid "Add or remove Tags" msgstr "" #: includes/class-wc-post-types.php:113 -msgid "Choose from the most used Product tags" +msgid "Choose from the most used tags" msgstr "" #: includes/class-wc-post-types.php:114 -msgid "No Product Tags found" +msgid "No tags found" msgstr "" #: includes/class-wc-post-types.php:141 @@ -16642,13 +16895,13 @@ msgstr "" msgid "Select options" msgstr "" -#: includes/class-wc-product-variable.php:745 +#: includes/class-wc-product-variable.php:746 msgid "" "This variable product has no active variations. Add or enable variations to " "allow this product to be purchased." msgstr "" -#: includes/class-wc-product-variation.php:721 +#: includes/class-wc-product-variation.php:713 msgid "%s – %s%s" msgstr "" @@ -16688,11 +16941,11 @@ msgstr[1] "" msgid "Everywhere" msgstr "" -#: includes/class-wc-webhook.php:610 +#: includes/class-wc-webhook.php:611 msgid "Error: Delivery URL cannot be reached: %s" msgstr "" -#: includes/class-wc-webhook.php:614 +#: includes/class-wc-webhook.php:615 msgid "Error: Delivery URL returned response code: %s" msgstr "" @@ -17189,7 +17442,7 @@ msgstr "" #: includes/gateways/bacs/class-wc-gateway-bacs.php:88 #: includes/gateways/cheque/class-wc-gateway-cheque.php:69 -#: includes/gateways/cod/class-wc-gateway-cod.php:70 +#: includes/gateways/cod/class-wc-gateway-cod.php:71 msgid "Payment method description that the customer will see on your checkout." msgstr "" @@ -17202,7 +17455,7 @@ msgstr "" #: includes/gateways/bacs/class-wc-gateway-bacs.php:93 #: includes/gateways/cheque/class-wc-gateway-cheque.php:74 -#: includes/gateways/cod/class-wc-gateway-cod.php:82 +#: includes/gateways/cod/class-wc-gateway-cod.php:83 msgid "Instructions" msgstr "" @@ -17331,50 +17584,50 @@ msgstr "" msgid "Have your customers pay with cash (or by other means) upon delivery." msgstr "" -#: includes/gateways/cod/class-wc-gateway-cod.php:61 +#: includes/gateways/cod/class-wc-gateway-cod.php:62 msgid "Enable COD" msgstr "" -#: includes/gateways/cod/class-wc-gateway-cod.php:62 +#: includes/gateways/cod/class-wc-gateway-cod.php:63 msgid "Enable Cash on Delivery" msgstr "" -#: includes/gateways/cod/class-wc-gateway-cod.php:77 +#: includes/gateways/cod/class-wc-gateway-cod.php:78 msgid "Payment method description that the customer will see on your website." msgstr "" -#: includes/gateways/cod/class-wc-gateway-cod.php:78 -#: includes/gateways/cod/class-wc-gateway-cod.php:85 +#: includes/gateways/cod/class-wc-gateway-cod.php:79 +#: includes/gateways/cod/class-wc-gateway-cod.php:86 msgid "Pay with cash upon delivery." msgstr "" -#: includes/gateways/cod/class-wc-gateway-cod.php:84 +#: includes/gateways/cod/class-wc-gateway-cod.php:85 msgid "Instructions that will be added to the thank you page." msgstr "" -#: includes/gateways/cod/class-wc-gateway-cod.php:89 +#: includes/gateways/cod/class-wc-gateway-cod.php:90 msgid "Enable for shipping methods" msgstr "" -#: includes/gateways/cod/class-wc-gateway-cod.php:94 +#: includes/gateways/cod/class-wc-gateway-cod.php:95 msgid "" "If COD is only available for certain methods, set it up here. Leave blank " "to enable for all methods." msgstr "" -#: includes/gateways/cod/class-wc-gateway-cod.php:98 +#: includes/gateways/cod/class-wc-gateway-cod.php:99 msgid "Select shipping methods" msgstr "" -#: includes/gateways/cod/class-wc-gateway-cod.php:102 +#: includes/gateways/cod/class-wc-gateway-cod.php:103 msgid "Accept for virtual orders" msgstr "" -#: includes/gateways/cod/class-wc-gateway-cod.php:103 +#: includes/gateways/cod/class-wc-gateway-cod.php:104 msgid "Accept COD if the order is virtual" msgstr "" -#: includes/gateways/cod/class-wc-gateway-cod.php:202 +#: includes/gateways/cod/class-wc-gateway-cod.php:203 msgid "Payment to be made upon delivery." msgstr "" @@ -17394,30 +17647,42 @@ msgid "" "statuses after payment. Check the %ssystem status%s page for more details." msgstr "" -#: includes/gateways/paypal/class-wc-gateway-paypal.php:95 +#: includes/gateways/paypal/class-wc-gateway-paypal.php:97 msgid "PayPal Acceptance Mark" msgstr "" -#: includes/gateways/paypal/class-wc-gateway-paypal.php:98 +#: includes/gateways/paypal/class-wc-gateway-paypal.php:100 msgid "What is PayPal?" msgstr "" -#: includes/gateways/paypal/class-wc-gateway-paypal.php:207 +#: includes/gateways/paypal/class-wc-gateway-paypal.php:209 msgid "Gateway Disabled" msgstr "" -#: includes/gateways/paypal/class-wc-gateway-paypal.php:207 +#: includes/gateways/paypal/class-wc-gateway-paypal.php:209 msgid "PayPal does not support your store currency." msgstr "" -#: includes/gateways/paypal/class-wc-gateway-paypal.php:271 +#: includes/gateways/paypal/class-wc-gateway-paypal.php:285 msgid "Refund Failed: No transaction ID" msgstr "" -#: includes/gateways/paypal/class-wc-gateway-paypal.php:292 +#: includes/gateways/paypal/class-wc-gateway-paypal.php:302 msgid "Refunded %s - Refund ID: %s" msgstr "" +#: includes/gateways/paypal/class-wc-gateway-paypal.php:324 +msgid "Payment could not captured: %s" +msgstr "" + +#: includes/gateways/paypal/class-wc-gateway-paypal.php:333 +msgid "Payment of %s was captured - Auth ID: %s, Transaction ID: %s" +msgstr "" + +#: includes/gateways/paypal/class-wc-gateway-paypal.php:338 +msgid "Payment could not captured - Auth ID: %s, Status: %s" +msgstr "" + #: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:133 msgid "Validation error: PayPal currencies do not match (code %s)." msgstr "" @@ -17434,47 +17699,55 @@ msgstr "" msgid "IPN payment completed" msgstr "" -#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:195 -msgid "Payment pending: %s" +#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:196 +#: includes/gateways/paypal/includes/class-wc-gateway-paypal-pdt-handler.php:123 +msgid "" +"Payment authorized. Change payment status to processing or complete to " +"capture funds." msgstr "" -#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:214 -#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:254 -#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:269 +#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:198 +#: includes/gateways/paypal/includes/class-wc-gateway-paypal-pdt-handler.php:125 +msgid "Payment pending (%s)." +msgstr "" + +#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:218 +#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:258 +#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:273 msgid "Payment %s via IPN." msgstr "" -#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:257 +#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:261 msgid "Payment for order %s refunded" msgstr "" -#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:258 +#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:262 msgid "Order #%s has been marked as refunded - PayPal reason code: %s" msgstr "" -#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:272 +#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:276 msgid "Payment for order %s reversed" msgstr "" -#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:273 +#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:277 msgid "Order #%s has been marked on-hold due to a reversal - PayPal reason code: %s" msgstr "" -#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:284 +#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:288 msgid "Reversal cancelled for order #%s" msgstr "" -#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:285 +#: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php:289 msgid "" "Order #%s has had a reversal cancelled. Please check the status of payment " "and update the order status accordingly here: %s" msgstr "" -#: includes/gateways/paypal/includes/class-wc-gateway-paypal-pdt-handler.php:94 +#: includes/gateways/paypal/includes/class-wc-gateway-paypal-pdt-handler.php:100 msgid "Validation error: PayPal amounts do not match (amt %s)." msgstr "" -#: includes/gateways/paypal/includes/class-wc-gateway-paypal-pdt-handler.php:96 +#: includes/gateways/paypal/includes/class-wc-gateway-paypal-pdt-handler.php:102 msgid "PDT payment completed" msgstr "" @@ -18228,7 +18501,7 @@ msgid "Invalid order. If you have an account please log in and try again." msgstr "" #: includes/shortcodes/class-wc-shortcode-checkout.php:89 -#: includes/shortcodes/class-wc-shortcode-my-account.php:113 +#: includes/shortcodes/class-wc-shortcode-my-account.php:118 #: templates/checkout/thankyou.php:32 msgid "My Account" msgstr "" @@ -18265,30 +18538,26 @@ msgid "" "the Place Order button at the bottom of the page." msgstr "" -#: includes/shortcodes/class-wc-shortcode-my-account.php:195 -msgid "Your password has been reset." +#: includes/shortcodes/class-wc-shortcode-my-account.php:46 +msgid "Your password has been reset successfully." msgstr "" -#: includes/shortcodes/class-wc-shortcode-my-account.php:195 -msgid "Log in" -msgstr "" - -#: includes/shortcodes/class-wc-shortcode-my-account.php:238 +#: includes/shortcodes/class-wc-shortcode-my-account.php:237 msgid "Enter a username or e-mail address." msgstr "" -#: includes/shortcodes/class-wc-shortcode-my-account.php:254 -#: includes/shortcodes/class-wc-shortcode-my-account.php:259 +#: includes/shortcodes/class-wc-shortcode-my-account.php:253 +#: includes/shortcodes/class-wc-shortcode-my-account.php:258 msgid "Invalid username or e-mail." msgstr "" -#: includes/shortcodes/class-wc-shortcode-my-account.php:272 +#: includes/shortcodes/class-wc-shortcode-my-account.php:271 msgid "Password reset is not allowed for this user" msgstr "" -#: includes/shortcodes/class-wc-shortcode-my-account.php:317 -#: includes/shortcodes/class-wc-shortcode-my-account.php:322 -#: includes/shortcodes/class-wc-shortcode-my-account.php:338 +#: includes/shortcodes/class-wc-shortcode-my-account.php:316 +#: includes/shortcodes/class-wc-shortcode-my-account.php:321 +#: includes/shortcodes/class-wc-shortcode-my-account.php:337 msgid "Invalid key" msgstr "" @@ -18350,7 +18619,7 @@ msgstr "" msgid "%s is not of type %s" msgstr "" -#: includes/vendor/wp-rest-functions.php:185 includes/wc-rest-functions.php:175 +#: includes/vendor/wp-rest-functions.php:185 includes/wc-rest-functions.php:199 msgid "The date you provided is invalid." msgstr "" @@ -18426,33 +18695,33 @@ msgstr "" msgid "This product is protected and cannot be purchased." msgstr "" -#: includes/wc-cart-functions.php:108 +#: includes/wc-cart-functions.php:109 msgid "%s has been added to your cart." msgid_plural "%s have been added to your cart." msgstr[0] "" msgstr[1] "" -#: includes/wc-cart-functions.php:113 +#: includes/wc-cart-functions.php:114 msgid "Continue Shopping" msgstr "" -#: includes/wc-cart-functions.php:133 +#: includes/wc-cart-functions.php:140 msgid "and" msgstr "" -#: includes/wc-cart-functions.php:238 templates/cart/cart.php:138 +#: includes/wc-cart-functions.php:245 templates/cart/cart.php:138 msgid "Coupon:" msgstr "" -#: includes/wc-cart-functions.php:269 +#: includes/wc-cart-functions.php:276 msgid "Free shipping coupon" msgstr "" -#: includes/wc-cart-functions.php:274 +#: includes/wc-cart-functions.php:281 msgid "[Remove]" msgstr "" -#: includes/wc-cart-functions.php:301 templates/cart/cart-totals.php:71 +#: includes/wc-cart-functions.php:308 templates/cart/cart-totals.php:71 msgid "estimated for %s" msgstr "" @@ -19108,27 +19377,27 @@ msgstr "" msgid "Zambian kwacha" msgstr "" -#: includes/wc-core-functions.php:1188 +#: includes/wc-core-functions.php:1223 msgid "MasterCard" msgstr "" -#: includes/wc-core-functions.php:1189 +#: includes/wc-core-functions.php:1224 msgid "Visa" msgstr "" -#: includes/wc-core-functions.php:1190 +#: includes/wc-core-functions.php:1225 msgid "Discover" msgstr "" -#: includes/wc-core-functions.php:1191 +#: includes/wc-core-functions.php:1226 msgid "American Express" msgstr "" -#: includes/wc-core-functions.php:1192 +#: includes/wc-core-functions.php:1227 msgid "Diners" msgstr "" -#: includes/wc-core-functions.php:1193 +#: includes/wc-core-functions.php:1228 msgid "JCB" msgstr "" @@ -19187,15 +19456,15 @@ msgstr "" msgid "wc_get_product should not be called before the woocommerce_init action." msgstr "" -#: includes/wc-rest-functions.php:56 +#: includes/wc-rest-functions.php:71 msgid "Invalid URL %s." msgstr "" -#: includes/wc-rest-functions.php:100 +#: includes/wc-rest-functions.php:124 msgid "Zero size file downloaded." msgstr "" -#: includes/wc-rest-functions.php:168 +#: includes/wc-rest-functions.php:192 msgid "%1$s is not of type %2$s" msgstr "" @@ -19215,69 +19484,73 @@ msgstr "" msgid "New products tagged %s" msgstr "" -#: includes/wc-template-functions.php:468 +#: includes/wc-template-functions.php:494 msgid "Search Results: “%s”" msgstr "" -#: includes/wc-template-functions.php:471 +#: includes/wc-template-functions.php:497 msgid " – Page %s" msgstr "" -#: includes/wc-template-functions.php:775 +#: includes/wc-template-functions.php:806 msgid "Default sorting" msgstr "" -#: includes/wc-template-functions.php:776 +#: includes/wc-template-functions.php:807 msgid "Sort by popularity" msgstr "" -#: includes/wc-template-functions.php:777 +#: includes/wc-template-functions.php:808 msgid "Sort by average rating" msgstr "" -#: includes/wc-template-functions.php:778 +#: includes/wc-template-functions.php:809 msgid "Sort by newness" msgstr "" -#: includes/wc-template-functions.php:779 +#: includes/wc-template-functions.php:810 msgid "Sort by price: low to high" msgstr "" -#: includes/wc-template-functions.php:780 +#: includes/wc-template-functions.php:811 msgid "Sort by price: high to low" msgstr "" -#: includes/wc-template-functions.php:1115 +#: includes/wc-template-functions.php:1146 #: templates/checkout/form-shipping.php:54 #: templates/single-product/tabs/additional-information.php:25 msgid "Additional Information" msgstr "" -#: includes/wc-template-functions.php:1124 +#: includes/wc-template-functions.php:1155 msgid "Reviews (%d)" msgstr "" -#: includes/wc-template-functions.php:1257 +#: includes/wc-template-functions.php:1288 msgid "" "Use $args argument as an array instead. Deprecated argument will be removed " "in WC 2.2." msgstr "" -#: includes/wc-template-functions.php:1480 +#: includes/wc-template-functions.php:1413 +msgid "Checkout" +msgstr "" + +#: includes/wc-template-functions.php:1533 msgid "Place order" msgstr "" -#: includes/wc-template-functions.php:1847 +#: includes/wc-template-functions.php:1900 msgid "Update country" msgstr "" -#: includes/wc-template-functions.php:1868 +#: includes/wc-template-functions.php:1921 #: templates/cart/shipping-calculator.php:63 msgid "Select a state…" msgstr "" -#: includes/wc-template-functions.php:1913 -#: includes/wc-template-functions.php:2060 +#: includes/wc-template-functions.php:1966 +#: includes/wc-template-functions.php:2113 msgid "Choose an option" msgstr "" @@ -19659,7 +19932,7 @@ msgid "Cart Totals" msgstr "" #: templates/cart/cart-totals.php:33 templates/cart/cart-totals.php:34 -#: templates/cart/mini-cart.php:80 templates/checkout/review-order.php:59 +#: templates/cart/mini-cart.php:84 templates/checkout/review-order.php:59 msgid "Subtotal" msgstr "" @@ -19668,7 +19941,7 @@ msgstr "" msgid "Quantity" msgstr "" -#: templates/cart/cart.php:60 templates/cart/mini-cart.php:49 +#: templates/cart/cart.php:60 templates/cart/mini-cart.php:51 msgid "Remove this item" msgstr "" @@ -19684,14 +19957,10 @@ msgstr "" msgid "You may be interested in…" msgstr "" -#: templates/cart/mini-cart.php:72 +#: templates/cart/mini-cart.php:76 msgid "No products in the cart." msgstr "" -#: templates/cart/mini-cart.php:86 -msgid "Checkout" -msgstr "" - #: templates/cart/proceed-to-checkout-button.php:27 msgid "Proceed to Checkout" msgstr "" @@ -20388,7 +20657,7 @@ msgctxt "full name" msgid "%1$s %2$s" msgstr "" -#: includes/abstracts/abstract-wc-product.php:1057 +#: includes/abstracts/abstract-wc-product.php:1044 msgctxt "min_price" msgid "From:" msgstr "" @@ -20532,8 +20801,8 @@ msgid "product-tag" msgstr "" #: includes/admin/class-wc-admin-permalink-settings.php:194 -#: includes/class-wc-post-types.php:235 includes/wc-core-functions.php:790 -#: includes/wc-core-functions.php:825 includes/wc-update-functions.php:60 +#: includes/class-wc-post-types.php:235 includes/wc-core-functions.php:812 +#: includes/wc-core-functions.php:860 includes/wc-update-functions.php:60 msgctxt "slug" msgid "product" msgstr "" @@ -20706,12 +20975,12 @@ msgctxt "number of pages" msgid "of" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:289 +#: includes/admin/meta-boxes/views/html-order-items.php:290 msgctxt "Refund $amount" msgid "Refund %s via %s" msgstr "" -#: includes/admin/meta-boxes/views/html-order-items.php:290 +#: includes/admin/meta-boxes/views/html-order-items.php:291 msgctxt "Refund $amount manually" msgid "Refund %s manually" msgstr "" @@ -20759,41 +21028,46 @@ msgctxt "Pagination, like `1 of 3`" msgid "%1$s of %2$s" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:453 +#: includes/admin/views/html-admin-page-status-report.php:465 msgctxt "Version info" msgid "%s is available" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:465 +#: includes/admin/views/html-admin-page-status-report.php:477 msgctxt "by author" msgid "by %s" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:535 +#: includes/admin/views/html-admin-page-status-report.php:547 msgctxt "Page setting" msgid "Shop Base" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:540 +#: includes/admin/views/html-admin-page-status-report.php:552 msgctxt "Page setting" msgid "Cart" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:545 +#: includes/admin/views/html-admin-page-status-report.php:557 msgctxt "Page setting" msgid "Checkout" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:550 +#: includes/admin/views/html-admin-page-status-report.php:562 msgctxt "Page setting" msgid "My Account" msgstr "" -#: includes/admin/views/html-admin-page-status-report.php:564 +#: includes/admin/views/html-admin-page-status-report.php:576 msgctxt "WC Pages links in the System Status" msgid "Edit %s page" msgstr "" +#: includes/admin/views/html-report-by-date.php:16 +msgctxt "start date and end date" +msgid "From %s to %s" +msgstr "" + #: includes/class-wc-checkout.php:451 msgctxt "Shipping FIELDNAME" msgid "Shipping %s" @@ -20870,8 +21144,8 @@ msgid "Failed" msgstr "" #: includes/class-wc-product-grouped.php:152 -#: includes/class-wc-product-variable.php:353 -#: includes/class-wc-product-variable.php:359 +#: includes/class-wc-product-variable.php:354 +#: includes/class-wc-product-variable.php:360 msgctxt "Price range: from-to" msgid "%1$s–%2$s" msgstr "" @@ -20886,7 +21160,7 @@ msgctxt "edit-address-slug" msgid "shipping" msgstr "" -#: includes/wc-cart-functions.php:103 +#: includes/wc-cart-functions.php:104 msgctxt "Item name in quotes" msgid "“%s”" msgstr "" @@ -20896,7 +21170,7 @@ msgctxt "Order date parsed by strftime" msgid "%b %d, %Y @ %I:%M %p" msgstr "" -#: includes/wc-template-functions.php:1435 +#: includes/wc-template-functions.php:1488 msgctxt "breadcrumb" msgid "Home" msgstr "" diff --git a/includes/abstracts/abstract-wc-legacy-order.php b/includes/abstracts/abstract-wc-legacy-order.php new file mode 100644 index 00000000000..8fe96d3435a --- /dev/null +++ b/includes/abstracts/abstract-wc-legacy-order.php @@ -0,0 +1,595 @@ +get_item( $item ); + } + if ( ! is_object( $item ) || ! $item->is_type( 'line_item' ) ) { + return false; + } + if ( ! $this->get_id() ) { + $this->save(); // Order must exist + } + + // BW compatibility with old args + if ( isset( $args['totals'] ) ) { + foreach ( $args['totals'] as $key => $value ) { + if ( 'tax' === $key ) { + $args['total_tax'] = $value; + } elseif ( 'tax_data' === $key ) { + $args['taxes'] = $value; + } else { + $args[ $key ] = $value; + } + } + } + + // Handly qty if set + if ( isset( $args['qty'] ) ) { + if ( $product->backorders_require_notification() && $product->is_on_backorder( $args['qty'] ) ) { + $item->add_meta_data( apply_filters( 'woocommerce_backordered_item_meta_name', __( 'Backordered', 'woocommerce' ) ), $args['qty'] - max( 0, $product->get_total_stock() ), true ); + } + $args['subtotal'] = $args['subtotal'] ? $args['subtotal'] : $product->get_price_excluding_tax( $args['qty'] ); + $args['total'] = $args['total'] ? $args['total'] : $product->get_price_excluding_tax( $args['qty'] ); + } + + $item->set_order_id( $this->get_id() ); + $item->set_all( $args ); + $item->save(); + do_action( 'woocommerce_order_edit_product', $this->get_id(), $item->get_id(), $args, $product ); + + return $item->get_id(); + } + + /** + * Update coupon for order. Note this does not update order totals. + * @param object|int $item + * @param array $args + * @return int updated order item ID + */ + public function update_coupon( $item, $args ) { + _deprecated_function( 'WC_Order::update_coupon', '2.7', 'Interact with WC_Order_Item_Coupon class' ); + if ( is_numeric( $item ) ) { + $item = $this->get_item( $item ); + } + if ( ! is_object( $item ) || ! $item->is_type( 'coupon' ) ) { + return false; + } + if ( ! $this->get_id() ) { + $this->save(); // Order must exist + } + + // BW compatibility for old args + if ( isset( $args['discount_amount'] ) ) { + $args['discount'] = $args['discount_amount']; + } + if ( isset( $args['discount_amount_tax'] ) ) { + $args['discount_tax'] = $args['discount_amount_tax']; + } + + $item->set_order_id( $this->get_id() ); + $item->set_all( $args ); + $item->save(); + + do_action( 'woocommerce_order_update_coupon', $this->get_id(), $item->get_id(), $args ); + + return $item->get_id(); + } + + /** + * Update shipping method for order. + * + * Note this does not update the order total. + * + * @param object|int $item + * @param array $args + * @return int updated order item ID + */ + public function update_shipping( $item, $args ) { + _deprecated_function( 'WC_Order::update_shipping', '2.7', 'Interact with WC_Order_Item_Shipping class' ); + if ( is_numeric( $item ) ) { + $item = $this->get_item( $item ); + } + if ( ! is_object( $item ) || ! $item->is_type( 'shipping' ) ) { + return false; + } + if ( ! $this->get_id() ) { + $this->save(); // Order must exist + } + + // BW compatibility for old args + if ( isset( $args['cost'] ) ) { + $args['total'] = $args['cost']; + } + + $item->set_order_id( $this->get_id() ); + $item->set_all( $args ); + $item->save(); + $this->calculate_shipping(); + + do_action( 'woocommerce_order_update_shipping', $this->get_id(), $item->get_id(), $args ); + + return $item->get_id(); + } + + /** + * Update fee for order. + * + * Note this does not update order totals. + * + * @param object|int $item + * @param array $args + * @return int updated order item ID + */ + public function update_fee( $item, $args ) { + _deprecated_function( 'WC_Order::update_fee', '2.7', 'Interact with WC_Order_Item_Fee class' ); + if ( is_numeric( $item ) ) { + $item = $this->get_item( $item ); + } + if ( ! is_object( $item ) || ! $item->is_type( 'fee' ) ) { + return false; + } + if ( ! $this->get_id() ) { + $this->save(); // Order must exist + } + + $item->set_order_id( $this->get_id() ); + $item->set_all( $args ); + $item->save(); + + do_action( 'woocommerce_order_update_fee', $this->get_id(), $item->get_id(), $args ); + + return $item->get_id(); + } + + /** + * Update tax line on order. + * Note this does not update order totals. + * + * @since 2.7 + * @param object|int $item + * @param array $args + * @return int updated order item ID + */ + public function update_tax( $item, $args ) { + _deprecated_function( 'WC_Order::update_tax', '2.7', 'Interact with WC_Order_Item_Tax class' ); + if ( is_numeric( $item ) ) { + $item = $this->get_item( $item ); + } + if ( ! is_object( $item ) || ! $item->is_type( 'tax' ) ) { + return false; + } + if ( ! $this->get_id() ) { + $this->save(); // Order must exist + } + + $item->set_order_id( $this->get_id() ); + $item->set_all( $args ); + $item->save(); + + do_action( 'woocommerce_order_update_tax', $this->get_id(), $item->get_id(), $args ); + + return $item->get_id(); + } + + /** + * Get a product (either product or variation). + * @deprecated Add deprecation notices in future release. Replaced with $item->get_product() + * @param object $item + * @return WC_Product|bool + */ + public function get_product_from_item( $item ) { + if ( is_callable( array( $item, 'get_product' ) ) ) { + $product = $item->get_product(); + } else { + $product = false; + } + return apply_filters( 'woocommerce_get_product_from_item', $product, $item, $this ); + } + + /** + * Set the customer address. + * @param array $address Address data. + * @param string $type billing or shipping. + */ + public function set_address( $address, $type = 'billing' ) { + foreach ( $address as $key => $value ) { + update_post_meta( $this->get_id(), "_{$type}_" . $key, $value ); + if ( is_callable( array( $this, "set_{$type}_{$key}" ) ) ) { + $this->{"set_{$type}_{$key}"}( $value ); + } + } + } + + /** + * Set an order total. + * @param float $amount + * @param string $total_type + * @return bool + */ + public function legacy_set_total( $amount, $total_type = 'total' ) { + if ( ! in_array( $total_type, array( 'shipping', 'tax', 'shipping_tax', 'total', 'cart_discount', 'cart_discount_tax' ) ) ) { + return false; + } + + switch ( $total_type ) { + case 'total' : + $amount = wc_format_decimal( $amount, wc_get_price_decimals() ); + $this->set_total( $amount ); + update_post_meta( $this->get_id(), '_order_total', $amount ); + break; + case 'cart_discount' : + $amount = wc_format_decimal( $amount ); + $this->set_discount_total( $amount ); + update_post_meta( $this->get_id(), '_cart_discount', $amount ); + break; + case 'cart_discount_tax' : + $amount = wc_format_decimal( $amount ); + $this->set_discount_tax( $amount ); + update_post_meta( $this->get_id(), '_cart_discount_tax', $amount ); + break; + case 'shipping' : + $amount = wc_format_decimal( $amount ); + $this->set_shipping_total( $amount ); + update_post_meta( $this->get_id(), '_order_shipping', $amount ); + break; + case 'shipping_tax' : + $amount = wc_format_decimal( $amount ); + $this->set_shipping_tax( $amount ); + update_post_meta( $this->get_id(), '_order_shipping_tax', $amount ); + break; + case 'tax' : + $amount = wc_format_decimal( $amount ); + $this->set_cart_tax( $amount ); + update_post_meta( $this->get_id(), '_order_tax', $amount ); + break; + } + + return true; + } + + /** + * Magic __isset method for backwards compatibility. + * @param string $key + * @return bool + */ + public function __isset( $key ) { + // Legacy properties which could be accessed directly in the past. + $legacy_props = array( 'completed_date', 'id', 'order_type', 'post', 'status', 'post_status', 'customer_note', 'customer_message', 'user_id', 'customer_user', 'prices_include_tax', 'tax_display_cart', 'display_totals_ex_tax', 'display_cart_ex_tax', 'order_date', 'modified_date', 'cart_discount', 'cart_discount_tax', 'order_shipping', 'order_shipping_tax', 'order_total', 'order_tax', 'billing_first_name', 'billing_last_name', 'billing_company', 'billing_address_1', 'billing_address_2', 'billing_city', 'billing_state', 'billing_postcode', 'billing_country', 'billing_phone', 'billing_email', 'shipping_first_name', 'shipping_last_name', 'shipping_company', 'shipping_address_1', 'shipping_address_2', 'shipping_city', 'shipping_state', 'shipping_postcode', 'shipping_country', 'customer_ip_address', 'customer_user_agent', 'payment_method_title', 'payment_method', 'order_currency' ); + return $this->get_id() ? ( in_array( $key, $legacy_props ) || metadata_exists( 'post', $this->get_id(), '_' . $key ) ) : false; + } + + /** + * Magic __get method for backwards compatibility. + * @param string $key + * @return mixed + */ + public function __get( $key ) { + _doing_it_wrong( $key, 'Order properties should not be accessed directly.', '2.7' ); + + if ( 'completed_date' === $key ) { + return $this->get_date_completed(); + } elseif ( 'paid_date' === $key ) { + return $this->get_date_paid(); + } elseif ( 'modified_date' === $key ) { + return $this->get_date_modified(); + } elseif ( 'order_date' === $key ) { + return $this->get_date_created(); + } elseif ( 'id' === $key ) { + return $this->get_id(); + } elseif ( 'post' === $key ) { + return get_post( $this->get_id() ); + } elseif ( 'status' === $key || 'post_status' === $key ) { + return $this->get_status(); + } elseif ( 'customer_message' === $key || 'customer_note' === $key ) { + return $this->get_customer_note(); + } elseif ( in_array( $key, array( 'user_id', 'customer_user' ) ) ) { + return $this->get_customer_id(); + } elseif ( 'tax_display_cart' === $key ) { + return get_option( 'woocommerce_tax_display_cart' ); + } elseif ( 'display_totals_ex_tax' === $key ) { + return 'excl' === get_option( 'woocommerce_tax_display_cart' ); + } elseif ( 'display_cart_ex_tax' === $key ) { + return 'excl' === get_option( 'woocommerce_tax_display_cart' ); + } elseif ( 'cart_discount' === $key ) { + return $this->get_discount(); + } elseif ( 'cart_discount_tax' === $key ) { + return $this->get_discount_tax(); + } elseif ( 'order_tax' === $key ) { + return $this->get_cart_tax(); + } elseif ( 'order_shipping_tax' === $key ) { + return $this->get_shipping_tax(); + } elseif ( 'order_shipping' === $key ) { + return $this->get_shipping_total(); + } elseif ( 'order_total' === $key ) { + return $this->get_total(); + } elseif ( 'order_type' === $key ) { + return $this->get_type(); + } elseif ( 'order_currency' === $key ) { + return $this->get_currency(); + } elseif ( 'order_version' === $key ) { + return $this->get_version(); + } elseif ( is_callable( array( $this, "get_{$key}" ) ) ) { + return $this->{"get_{$key}"}(); + } else { + return get_post_meta( $this->get_id(), '_' . $key, true ); + } + } + + /** + * has_meta function for order items. + * + * @param string $order_item_id + * @return array of meta data. + */ + public function has_meta( $order_item_id ) { + global $wpdb; + + _deprecated_function( 'has_meta', '2.7', 'WC_Order_item::get_meta_data' ); + + return $wpdb->get_results( $wpdb->prepare( "SELECT meta_key, meta_value, meta_id, order_item_id + FROM {$wpdb->prefix}woocommerce_order_itemmeta WHERE order_item_id = %d + ORDER BY meta_id", absint( $order_item_id ) ), ARRAY_A ); + } + + /** + * Display meta data belonging to an item. + * @param array $item + */ + public function display_item_meta( $item ) { + _deprecated_function( 'get_item_meta', '2.7', 'wc_display_item_meta' ); + $product = $item->get_product(); + $item_meta = new WC_Order_Item_Meta( $item, $product ); + $item_meta->display(); + } + + /** + * Display download links for an order item. + * @param array $item + */ + public function display_item_downloads( $item ) { + _deprecated_function( 'display_item_downloads', '2.7', 'wc_display_item_downloads' ); + $product = $item->get_product(); + + if ( $product && $product->exists() && $product->is_downloadable() && $this->is_download_permitted() ) { + $download_files = $this->get_item_downloads( $item ); + $i = 0; + $links = array(); + + foreach ( $download_files as $download_id => $file ) { + $i++; + $prefix = count( $download_files ) > 1 ? sprintf( __( 'Download %d', 'woocommerce' ), $i ) : __( 'Download', 'woocommerce' ); + $links[] = '' . $prefix . ': ' . esc_html( $file['name'] ) . '' . "\n"; + } + + echo '
    ' . implode( '
    ', $links ); + } + } + + /** + * Get the Download URL. + * + * @param int $product_id + * @param int $download_id + * @return string + */ + public function get_download_url( $product_id, $download_id ) { + _deprecated_function( 'get_download_url', '2.7', 'WC_Order_Item_Product::get_item_download_url' ); + return add_query_arg( array( + 'download_file' => $product_id, + 'order' => $this->get_order_key(), + 'email' => urlencode( $this->get_billing_email() ), + 'key' => $download_id, + ), trailingslashit( home_url() ) ); + } + + /** + * Get the downloadable files for an item in this order. + * + * @param array $item + * @return array + */ + public function get_item_downloads( $item ) { + _deprecated_function( 'get_item_downloads', '2.7', 'WC_Order_Item_Product::get_item_downloads' ); + return $item->get_item_downloads(); + } + + /** + * Gets shipping total. Alias of WC_Order::get_shipping_total(). + * @deprecated 2.7.0 since this is an alias only. + * @return float + */ + public function get_total_shipping() { + return $this->get_shipping_total(); + } + + /** + * Get order item meta. + * @deprecated 2.7.0 + * @param mixed $order_item_id + * @param string $key (default: '') + * @param bool $single (default: false) + * @return array|string + */ + public function get_item_meta( $order_item_id, $key = '', $single = false ) { + _deprecated_function( 'get_item_meta', '2.7', 'wc_get_order_item_meta' ); + return get_metadata( 'order_item', $order_item_id, $key, $single ); + } + + /** + * Get all item meta data in array format in the order it was saved. Does not group meta by key like get_item_meta(). + * + * @param mixed $order_item_id + * @return array of objects + */ + public function get_item_meta_array( $order_item_id ) { + _deprecated_function( 'get_item_meta_array', '2.7', 'WC_Order_Item::get_meta_data() (note the format has changed)' ); + $item = $this->get_item( $order_item_id ); + $meta_data = $item->get_meta_data(); + $item_meta_array = array(); + + foreach ( $meta_data as $meta ) { + $item_meta_array[ $meta->meta_id ] = $meta; + } + + return $item_meta_array; + } + + /** + * Expand item meta into the $item array. + * @deprecated 2.7.0 Item meta no longer expanded due to new order item + * classes. This function now does nothing to avoid data breakage. + * @param array $item before expansion. + * @return array + */ + public function expand_item_meta( $item ) { + _deprecated_function( 'expand_item_meta', '2.7', '' ); + return $item; + } + + /** + * Load the order object. Called from the constructor. + * @deprecated 2.7.0 Logic moved to constructor + * @param int|object|WC_Order $order Order to init. + */ + protected function init( $order ) { + _deprecated_function( 'init', '2.7', 'Logic moved to constructor' ); + if ( is_numeric( $order ) ) { + $this->read( $order ); + } elseif ( $order instanceof WC_Order ) { + $this->read( absint( $order->get_id() ) ); + } elseif ( isset( $order->ID ) ) { + $this->read( absint( $order->ID ) ); + } + } + + /** + * Gets an order from the database. + * @deprecated 2.7 + * @param int $id (default: 0). + * @return bool + */ + public function get_order( $id = 0 ) { + _deprecated_function( 'get_order', '2.7', 'read' ); + if ( ! $id ) { + return false; + } + if ( $result = get_post( $id ) ) { + $this->populate( $result ); + return true; + } + return false; + } + + /** + * Populates an order from the loaded post data. + * @deprecated 2.7 + * @param mixed $result + */ + public function populate( $result ) { + _deprecated_function( 'populate', '2.7', 'read' ); + $this->read( $result->ID ); + } + + /** + * Cancel the order and restore the cart (before payment). + * @deprecated 2.7.0 Moved to event handler. + * @param string $note (default: '') Optional note to add. + */ + public function cancel_order( $note = '' ) { + _deprecated_function( 'cancel_order', '2.7', 'update_status' ); + WC()->session->set( 'order_awaiting_payment', false ); + $this->update_status( 'cancelled', $note ); + } + + /** + * Record sales. + * @deprecated 2.7.0 + */ + public function record_product_sales() { + _deprecated_function( 'record_product_sales', '2.7', 'wc_update_total_sales_counts' ); + wc_update_total_sales_counts( $this->get_id() ); + } + + /** + * Increase applied coupon counts. + * @deprecated 2.7.0 + */ + public function increase_coupon_usage_counts() { + _deprecated_function( 'increase_coupon_usage_counts', '2.7', 'wc_update_coupon_usage_counts' ); + wc_update_coupon_usage_counts( $this->get_id() ); + } + + /** + * Decrease applied coupon counts. + * @deprecated 2.7.0 + */ + public function decrease_coupon_usage_counts() { + _deprecated_function( 'decrease_coupon_usage_counts', '2.7', 'wc_update_coupon_usage_counts' ); + wc_update_coupon_usage_counts( $this->get_id() ); + } + + /** + * Reduce stock levels for all line items in the order. + * @deprecated 2.7.0 + */ + public function reduce_order_stock() { + _deprecated_function( 'reduce_order_stock', '2.7', 'wc_reduce_stock_levels' ); + wc_reduce_stock_levels( $this->get_id() ); + } + + /** + * Send the stock notifications. + * @deprecated 2.7.0 No longer needs to be called directly. + */ + public function send_stock_notifications( $product, $new_stock, $qty_ordered ) { + _deprecated_function( 'send_stock_notifications', '2.7' ); + } + + /** + * Output items for display in html emails. + * @deprecated 2.7.0 Moved to template functions. + * @param array $args Items args. + * @return string + */ + public function email_order_items_table( $args = array() ) { + _deprecated_function( 'email_order_items_table', '2.7', 'wc_get_email_order_items' ); + return wc_get_email_order_items( $this, $args ); + } + + /** + * Get currency. + * @deprecated 2.7.0 + */ + public function get_order_currency() { + _deprecated_function( 'get_order_currency', '2.7', 'get_currency' ); + return apply_filters( 'woocommerce_get_order_currency', $this->get_currency(), $this ); + } +} diff --git a/includes/abstracts/abstract-wc-order.php b/includes/abstracts/abstract-wc-order.php index 00c2abd5718..fee786a16ad 100644 --- a/includes/abstracts/abstract-wc-order.php +++ b/includes/abstracts/abstract-wc-order.php @@ -1,94 +1,80 @@ 0, + 'parent_id' => 0, + 'status' => 'pending', + 'type' => 'shop_order', + 'order_key' => '', + 'currency' => '', + 'version' => '', + 'prices_include_tax' => false, + 'date_created' => '', + 'date_modified' => '', + 'customer_id' => 0, + 'discount_total' => 0, + 'discount_tax' => 0, + 'shipping_total' => 0, + 'shipping_tax' => 0, + 'cart_tax' => 0, + 'total' => 0, + 'total_tax' => 0, + ); - /** @var $post WP_Post. */ - public $post = null; + /** + * Data stored in meta keys, but not considered "meta" for an order. + * @since 2.7.0 + * @var array + */ + protected $_internal_meta_keys = array( + '_customer_user', '_order_key', '_order_currency', '_cart_discount', + '_cart_discount_tax', '_order_shipping', '_order_shipping_tax', + '_order_tax', '_order_total', '_order_version', '_prices_include_tax', + '_payment_tokens', + ); - /** @public string Order type. */ - public $order_type = false; + /** + * Internal meta type used to store order data. + * @var string + */ + protected $_meta_type = 'post'; - /** @public string Order Date. */ - public $order_date = ''; - - /** @public string Order Modified Date. */ - public $modified_date = ''; - - /** @public string Customer Message (excerpt). */ - public $customer_message = ''; - - /** @public string Customer Note */ - public $customer_note = ''; - - /** @public string Order Status. */ - public $post_status = ''; - - /** @public bool Do prices include tax? */ - public $prices_include_tax = false; - - /** @public string Display mode for taxes in cart. */ - public $tax_display_cart = ''; - - /** @public bool Do totals display ex tax? */ - public $display_totals_ex_tax = false; - - /** @public bool Do cart prices display ex tax? */ - public $display_cart_ex_tax = false; - - /** @protected string Formatted address. Accessed via get_formatted_billing_address(). */ - protected $formatted_billing_address = ''; - - /** @protected string Formatted address. Accessed via get_formatted_shipping_address(). */ - protected $formatted_shipping_address = ''; + /** + * Stores meta in cache for future reads. + * A group must be set to to enable caching. + * @var string + */ + protected $_cache_group = 'order'; /** * Get the order if ID is passed, otherwise the order is new and empty. @@ -99,51 +85,1002 @@ abstract class WC_Abstract_Order { * @param int|object|WC_Order $order Order to init. */ public function __construct( $order = 0 ) { - $this->prices_include_tax = get_option('woocommerce_prices_include_tax') == 'yes' ? true : false; - $this->tax_display_cart = get_option( 'woocommerce_tax_display_cart' ); - $this->display_totals_ex_tax = $this->tax_display_cart == 'excl' ? true : false; - $this->display_cart_ex_tax = $this->tax_display_cart == 'excl' ? true : false; - $this->init( $order ); + if ( is_numeric( $order ) && $order > 0 ) { + $this->read( $order ); + } elseif ( $order instanceof self ) { + $this->read( absint( $order->get_id() ) ); + } elseif ( ! empty( $order->ID ) ) { + $this->read( absint( $order->ID ) ); + } + } + + /* + |-------------------------------------------------------------------------- + | CRUD methods + |-------------------------------------------------------------------------- + | + | Methods which create, read, update and delete orders from the database. + | Written in abstract fashion so that the way orders are stored can be + | changed more easily in the future. + | + | A save method is included for convenience (chooses update or create based + | on if the order exists yet). + | + */ + + /** + * Get internal type (post type.) + * @return string + */ + public function get_type() { + return 'shop_order'; } /** - * Init/load the order object. Called from the constructor. - * - * @param int|object|WC_Order $order Order to init. + * Get a title for the new post type. */ - protected function init( $order ) { - if ( is_numeric( $order ) ) { - $this->id = absint( $order ); - $this->post = get_post( $order ); - $this->get_order( $this->id ); - } elseif ( $order instanceof WC_Order ) { - $this->id = absint( $order->id ); - $this->post = $order->post; - $this->get_order( $this->id ); - } elseif ( isset( $order->ID ) ) { - $this->id = absint( $order->ID ); - $this->post = $order; - $this->get_order( $this->id ); + protected function get_post_title() { + return sprintf( __( 'Order – %s', 'woocommerce' ), strftime( _x( '%b %d, %Y @ %I:%M %p', 'Order date parsed by strftime', 'woocommerce' ) ) ); + } + + /** + * Insert data into the database. + * @since 2.7.0 + */ + public function create() { + $this->set_order_key( 'wc_' . apply_filters( 'woocommerce_generate_order_key', uniqid( 'order_' ) ) ); + $this->set_date_created( current_time( 'timestamp' ) ); + + $order_id = wp_insert_post( apply_filters( 'woocommerce_new_order_data', array( + 'post_date' => date( 'Y-m-d H:i:s', $this->get_date_created() ), + 'post_date_gmt' => get_gmt_from_date( date( 'Y-m-d H:i:s', $this->get_date_created() ) ), + 'post_type' => $this->get_type(), + 'post_status' => 'wc-' . ( $this->get_status() ? $this->get_status() : apply_filters( 'woocommerce_default_order_status', 'pending' ) ), + 'ping_status' => 'closed', + 'post_author' => 1, + 'post_title' => $this->get_post_title(), + 'post_password' => uniqid( 'order_' ), + 'post_parent' => $this->get_parent_id(), + ) ), true ); + + if ( $order_id ) { + $this->set_id( $order_id ); + + // Set meta data + $this->update_post_meta( '_customer_user', $this->get_customer_id() ); + $this->update_post_meta( '_order_currency', $this->get_currency() ); + $this->update_post_meta( '_order_key', $this->get_order_key() ); + $this->update_post_meta( '_cart_discount', $this->get_discount_total( true ) ); + $this->update_post_meta( '_cart_discount_tax', $this->get_discount_tax( true ) ); + $this->update_post_meta( '_order_shipping', $this->get_shipping_total( true ) ); + $this->update_post_meta( '_order_shipping_tax', $this->get_shipping_tax( true ) ); + $this->update_post_meta( '_order_tax', $this->get_cart_tax( true ) ); + $this->update_post_meta( '_order_total', $this->get_total( true ) ); + $this->update_post_meta( '_order_version', $this->get_version() ); + $this->update_post_meta( '_prices_include_tax', $this->get_prices_include_tax() ); + $this->save_meta_data(); } } /** - * Remove all line items (products, coupons, shipping, taxes) from the order. + * Read from the database. + * @since 2.7.0 + * @param int $id ID of object to read. + */ + public function read( $id ) { + if ( empty( $id ) || ! ( $post_object = get_post( $id ) ) ) { + return; + } + + // Map standard post data + $this->set_id( $post_object->ID ); + $this->set_parent_id( $post_object->post_parent ); + $this->set_date_created( $post_object->post_date ); + $this->set_date_modified( $post_object->post_modified ); + $this->set_status( $post_object->post_status ); + $this->set_order_type( $post_object->post_type ); + $this->set_customer_id( get_post_meta( $this->get_id(), '_customer_user', true ) ); + $this->set_order_key( get_post_meta( $this->get_id(), '_order_key', true ) ); + $this->set_currency( get_post_meta( $this->get_id(), '_order_currency', true ) ); + $this->set_discount_total( get_post_meta( $this->get_id(), '_cart_discount', true ) ); + $this->set_discount_tax( get_post_meta( $this->get_id(), '_cart_discount_tax', true ) ); + $this->set_shipping_total( get_post_meta( $this->get_id(), '_order_shipping', true ) ); + $this->set_shipping_tax( get_post_meta( $this->get_id(), '_order_shipping_tax', true ) ); + $this->set_cart_tax( get_post_meta( $this->get_id(), '_order_tax', true ) ); + $this->set_total( get_post_meta( $this->get_id(), '_order_total', true ) ); + + // Orders store the state of prices including tax when created. + $this->set_prices_include_tax( metadata_exists( 'post', $this->get_id(), '_prices_include_tax' ) ? 'yes' === get_post_meta( $this->get_id(), '_prices_include_tax', true ) : 'yes' === get_option( 'woocommerce_prices_include_tax' ) ); + + // Load meta data + $this->read_meta_data(); + } + + /** + * Post meta update wrapper. Sets or deletes based on value. + * @since 2.7.0 + * @return bool Was it changed? + */ + protected function update_post_meta( $key, $value ) { + if ( '' !== $value ) { + return update_post_meta( $this->get_id(), $key, $value ); + } else { + return delete_post_meta( $this->get_id(), $key ); + } + } + + /** + * Update data in the database. + * @since 2.7.0 + */ + public function update() { + global $wpdb; + + $order_id = $this->get_id(); + + $wpdb->update( + $wpdb->posts, + array( + 'post_date' => date( 'Y-m-d H:i:s', $this->get_date_created() ), + 'post_date_gmt' => get_gmt_from_date( date( 'Y-m-d H:i:s', $this->get_date_created() ) ), + 'post_status' => 'wc-' . ( $this->get_status() ? $this->get_status() : apply_filters( 'woocommerce_default_order_status', 'pending' ) ), + 'post_parent' => $this->get_parent_id(), + ), + array( + 'ID' => $order_id + ) + ); + + // Update meta data + $this->update_post_meta( '_customer_user', $this->get_customer_id() ); + $this->update_post_meta( '_order_currency', $this->get_currency() ); + $this->update_post_meta( '_order_key', $this->get_order_key() ); + $this->update_post_meta( '_cart_discount', $this->get_discount_total( true ) ); + $this->update_post_meta( '_cart_discount_tax', $this->get_discount_tax( true ) ); + $this->update_post_meta( '_order_shipping', $this->get_shipping_total( true ) ); + $this->update_post_meta( '_order_shipping_tax', $this->get_shipping_tax( true ) ); + $this->update_post_meta( '_order_tax', $this->get_cart_tax( true ) ); + $this->update_post_meta( '_order_total', $this->get_total( true ) ); + $this->update_post_meta( '_prices_include_tax', $this->get_prices_include_tax() ); + $this->save_meta_data(); + } + + /** + * Delete data from the database. + * @since 2.7.0 + */ + public function delete() { + wp_delete_post( $this->get_id() ); + } + + /** + * Save data to the database. + * @since 2.7.0 + * @return int order ID + */ + public function save() { + $this->set_version( WC_VERSION ); + + if ( ! $this->get_id() ) { + $this->create(); + } else { + $this->update(); + } + + clean_post_cache( $this->get_id() ); + wc_delete_shop_order_transients( $this->get_id() ); + + return $this->get_id(); + } + + /* + |-------------------------------------------------------------------------- + | Getters + |-------------------------------------------------------------------------- + | + | Methods for getting data from the order object. + | + */ + + /** + * Get all class data in array format. + * @since 2.7.0 + * @return array + */ + public function get_data() { + return array_merge( + $this->_data, + array( + 'meta_data' => $this->get_meta_data(), + 'line_items' => $this->get_items( 'line_item' ), + 'tax_lines' => $this->get_items( 'tax' ), + 'shipping_lines' => $this->get_items( 'shipping' ), + 'fee_lines' => $this->get_items( 'fee' ), + 'coupon_lines' => $this->get_items( 'coupon' ), + ) + ); + } + + /** + * Get order ID. + * @since 2.7.0 + * @return integer + */ + public function get_id() { + return $this->_data['id']; + } + + /** + * Get parent order ID. + * @since 2.7.0 + * @return integer + */ + public function get_parent_id() { + return $this->_data['parent_id']; + } + + /** + * get_order_number function. * + * Gets the order number for display (by default, order ID). + * + * @return string + */ + public function get_order_number() { + return apply_filters( 'woocommerce_order_number', $this->get_id(), $this ); + } + + /** + * Get order key. + * @since 2.7.0 + * @return string + */ + public function get_order_key() { + return $this->_data['order_key']; + } + + /** + * Gets order currency. + * @return string + */ + public function get_currency() { + return apply_filters( 'woocommerce_get_currency', $this->_data['currency'], $this ); + } + + /** + * Get order_version + * @return string + */ + public function get_version() { + return $this->_data['version']; + } + + /** + * Get prices_include_tax + * @return bool + */ + public function get_prices_include_tax() { + return $this->_data['prices_include_tax']; + } + + /** + * Get Order Type + * @return string + */ + public function get_order_type() { + return $this->_data['type']; + } + + /** + * Get date_created + * @return int + */ + public function get_date_created() { + return $this->_data['date_created']; + } + + /** + * Get date_modified + * @return int + */ + public function get_date_modified() { + return $this->_data['date_modified']; + } + + /** + * Get customer_id + * @return int + */ + public function get_customer_id() { + return $this->_data['customer_id']; + } + + /** + * Return the order statuses without wc- internal prefix. + * @return string + */ + public function get_status() { + return apply_filters( 'woocommerce_order_get_status', 'wc-' === substr( $this->_data['status'], 0, 3 ) ? substr( $this->_data['status'], 3 ) : $this->_data['status'], $this ); + } + + /** + * Alias for get_customer_id(). + * @since 2.2 + * @return int + */ + public function get_user_id() { + return $this->get_customer_id(); + } + + /** + * Get the user associated with the order. False for guests. + * + * @since 2.2 + * @return WP_User|false + */ + public function get_user() { + return $this->get_user_id() ? get_user_by( 'id', $this->get_user_id() ) : false; + } + + /** + * Get discount_total + * @param bool $raw Gets raw unfiltered value. + * @return string + */ + public function get_discount_total( $raw = false ) { + $value = wc_format_decimal( $this->_data['discount_total'] ); + return $raw ? $value : apply_filters( 'woocommerce_order_amount_discount_total', $value, $this ); + } + + /** + * Get discount_tax + * @param bool $raw Gets raw unfiltered value. + * @return string + */ + public function get_discount_tax( $raw = false ) { + $value = wc_format_decimal( $this->_data['discount_tax'] ); + return $raw ? $value : apply_filters( 'woocommerce_order_amount_discount_tax', $value, $this ); + } + + /** + * Get shipping_total + * @param bool $raw Gets raw unfiltered value. + * @return string + */ + public function get_shipping_total( $raw = false ) { + $value = wc_format_decimal( $this->_data['shipping_total'] ); + return $raw ? $value : apply_filters( 'woocommerce_order_amount_shipping_total', $value, $this ); + } + + /** + * Get shipping_tax. + * @param bool $raw Gets raw unfiltered value. + * @return string + */ + public function get_shipping_tax( $raw = false ) { + $value = wc_format_decimal( $this->_data['shipping_tax'] ); + return $raw ? $value : apply_filters( 'woocommerce_order_amount_shipping_tax', $value, $this ); + } + + /** + * Gets cart tax amount. + * @param bool $raw Gets raw unfiltered value. + * @return float + */ + public function get_cart_tax( $raw = false ) { + $value = wc_format_decimal( $this->_data['cart_tax'] ); + return $raw ? $value : apply_filters( 'woocommerce_order_amount_cart_tax', $value, $this ); + } + + /** + * Gets order grand total. incl. taxes. Used in gateways. Filtered. + * @param bool $raw Gets raw unfiltered value. + * @return float + */ + public function get_total( $raw = false ) { + $value = wc_format_decimal( $this->_data['total'], wc_get_price_decimals() ); + return $raw ? $value : apply_filters( 'woocommerce_order_amount_total', $value, $this ); + } + + /** + * Get total tax amount. Alias for get_order_tax(). + * + * @since 2.7.0 woocommerce_order_amount_total_tax filter has been removed to avoid + * these values being modified and then saved back to the DB. There are + * other, later hooks available to change totals on display. e.g. + * woocommerce_get_order_item_totals. + * @param bool $raw Gets raw unfiltered value. + * @return float + */ + public function get_total_tax( $raw = false ) { + $value = wc_format_decimal( $this->_data['total_tax'] ); + return $raw ? $value : apply_filters( 'woocommerce_order_amount_total_tax', $value, $this ); + } + + /** + * Gets the total discount amount. + * @param bool $ex_tax Show discount excl any tax. + * @return float + */ + public function get_total_discount( $ex_tax = true ) { + if ( $ex_tax ) { + $total_discount = $this->get_discount_total(); + } else { + $total_discount = $this->get_discount_total() + $this->get_discount_tax(); + } + return apply_filters( 'woocommerce_order_amount_total_discount', round( $total_discount, WC_ROUNDING_PRECISION ), $this ); + } + + /** + * Gets order subtotal. + * @return float + */ + public function get_subtotal() { + $subtotal = 0; + + foreach ( $this->get_items() as $item ) { + $subtotal += $item->get_subtotal(); + } + + return apply_filters( 'woocommerce_order_amount_subtotal', (double) $subtotal, $this ); + } + + /** + * Get taxes, merged by code, formatted ready for output. + * + * @return array + */ + public function get_tax_totals() { + $tax_totals = array(); + + foreach ( $this->get_items( 'tax' ) as $key => $tax ) { + $code = $tax->get_rate_code(); + + if ( ! isset( $tax_totals[ $code ] ) ) { + $tax_totals[ $code ] = new stdClass(); + $tax_totals[ $code ]->amount = 0; + } + + $tax_totals[ $code ]->id = $key; + $tax_totals[ $code ]->rate_id = $tax->get_rate_id(); + $tax_totals[ $code ]->is_compound = $tax->is_compound(); + $tax_totals[ $code ]->label = $tax->get_label(); + $tax_totals[ $code ]->amount += $tax->get_tax_total() + $tax->get_shipping_tax_total(); + $tax_totals[ $code ]->formatted_amount = wc_price( wc_round_tax_total( $tax_totals[ $code ]->amount ), array( 'currency' => $this->get_currency() ) ); + } + + if ( apply_filters( 'woocommerce_order_hide_zero_taxes', true ) ) { + $amounts = array_filter( wp_list_pluck( $tax_totals, 'amount' ) ); + $tax_totals = array_intersect_key( $tax_totals, $amounts ); + } + + return apply_filters( 'woocommerce_order_tax_totals', $tax_totals, $this ); + } + + /* + |-------------------------------------------------------------------------- + | Setters + |-------------------------------------------------------------------------- + | + | Functions for setting order data. These should not update anything in the + | database itself and should only change what is stored in the class + | object. However, for backwards compatibility pre 2.7.0 some of these + | setters may handle both. + | + */ + + /** + * Set order ID. + * @since 2.7.0 + * @param int $value + */ + public function set_id( $value ) { + $this->_data['id'] = absint( $value ); + } + + /** + * Set parent order ID. + * @since 2.7.0 + * @param int $value + */ + public function set_parent_id( $value ) { + $this->_data['parent_id'] = absint( $value ); + } + + /** +<<<<<<< HEAD + * Set order status. + * @since 2.7.0 + * @param string $new_status Status to change the order to. No internal wc- prefix is required. + * @param array details of change + */ + public function set_status( $new_status ) { + $old_status = $this->get_status(); + $new_status = 'wc-' === substr( $new_status, 0, 3 ) ? substr( $new_status, 3 ) : $new_status; + + // If the old status is unknown (e.g. draft) assume its pending for action usage. + if ( ! in_array( 'wc-' . $old_status, array_keys( wc_get_order_statuses() ) ) ) { + $old_status = 'pending'; + } + + if ( in_array( 'wc-' . $new_status, array_keys( wc_get_order_statuses() ) ) && $new_status !== $old_status ) { + $this->_data['status'] = 'wc-' . $new_status; + } else { + $new_status = $old_status; + } + + return array( + 'from' => $old_status, + 'to' => $new_status + ); + } + + /** + * Set Order Type + * @param string $value + */ + public function set_order_type( $value ) { + $this->_data['type'] = $value; + } + + /** + * Set order_key. + * @param string $value Max length 20 chars. + */ + public function set_order_key( $value ) { + $this->_data['order_key'] = substr( $value, 0, 20 ); + } + + /** + * Set order_version + * @param string $value + */ + public function set_version( $value ) { + $this->_data['version'] = $value; + } + + /** + * Set order_currency + * @param string $value + */ + public function set_currency( $value ) { + $this->_data['currency'] = $value; + } + + /** + * Set prices_include_tax + * @param bool $value + */ + public function set_prices_include_tax( $value ) { + $this->_data['prices_include_tax'] = (bool) $value; + } + + /** + * Set date_created + * @param string $timestamp Timestamp + */ + public function set_date_created( $timestamp ) { + $this->_data['date_created'] = is_numeric( $timestamp ) ? $timestamp : strtotime( $timestamp ); + } + + /** + * Set date_modified + * @param string $timestamp + */ + public function set_date_modified( $timestamp ) { + $this->_data['date_modified'] = is_numeric( $timestamp ) ? $timestamp : strtotime( $timestamp ); + } + + /** + * Set customer_id + * @param int $value + */ + public function set_customer_id( $value ) { + $this->_data['customer_id'] = absint( $value ); + } + + /** + * Set discount_total + * @param string $value + */ + public function set_discount_total( $value ) { + $this->_data['discount_total'] = wc_format_decimal( $value ); + } + + /** + * Set discount_tax + * @param string $value + */ + public function set_discount_tax( $value ) { + $this->_data['discount_tax'] = wc_format_decimal( $value ); + } + + /** + * Set shipping_total + * @param string $value + */ + public function set_shipping_total( $value ) { + $this->_data['shipping_total'] = wc_format_decimal( $value ); + } + + /** + * Set shipping_tax + * @param string $value + */ + public function set_shipping_tax( $value ) { + $this->_data['shipping_tax'] = wc_format_decimal( $value ); + $this->set_total_tax( $this->get_cart_tax() + $this->get_shipping_tax() ); + } + + /** + * Set cart tax + * @param string $value + */ + public function set_cart_tax( $value ) { + $this->_data['cart_tax'] = wc_format_decimal( $value ); + $this->set_total_tax( $this->get_cart_tax() + $this->get_shipping_tax() ); + } + + /** + * Sets order tax (sum of cart and shipping tax). Used internaly only. + * @param string $value + */ + protected function set_total_tax( $value ) { + $this->_data['total_tax'] = wc_format_decimal( $value ); + } + + /** + * Set total + * @param string $value + * @param string $deprecated Function used to set different totals based on this. + */ + public function set_total( $value, $deprecated = '' ) { + if ( $deprecated ) { + _deprecated_argument( 'total_type', '2.7', 'Use dedicated total setter methods instead.' ); + return $this->legacy_set_total( $value, $deprecated ); + } + $this->_data['total'] = wc_format_decimal( $value, wc_get_price_decimals() ); + } + + /* + |-------------------------------------------------------------------------- + | Order Item Handling + |-------------------------------------------------------------------------- + | + | Order items are used for products, taxes, shipping, and fees within + | each order. + | + */ + + /** + * Remove all line items (products, coupons, shipping, taxes) from the order. * @param string $type Order item type. Default null. */ public function remove_order_items( $type = null ) { global $wpdb; - if ( ! empty( $type ) ) { - $wpdb->query( $wpdb->prepare( "DELETE FROM itemmeta USING {$wpdb->prefix}woocommerce_order_itemmeta itemmeta INNER JOIN {$wpdb->prefix}woocommerce_order_items items WHERE itemmeta.order_item_id = items.order_item_id AND items.order_id = %d AND items.order_item_type = %s", $this->id, $type ) ); - $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}woocommerce_order_items WHERE order_id = %d AND order_item_type = %s", $this->id, $type ) ); + $wpdb->query( $wpdb->prepare( "DELETE FROM itemmeta USING {$wpdb->prefix}woocommerce_order_itemmeta itemmeta INNER JOIN {$wpdb->prefix}woocommerce_order_items items WHERE itemmeta.order_item_id = items.order_item_id AND items.order_id = %d AND items.order_item_type = %s", $this->get_id(), $type ) ); + $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}woocommerce_order_items WHERE order_id = %d AND order_item_type = %s", $this->get_id(), $type ) ); } else { - $wpdb->query( $wpdb->prepare( "DELETE FROM itemmeta USING {$wpdb->prefix}woocommerce_order_itemmeta itemmeta INNER JOIN {$wpdb->prefix}woocommerce_order_items items WHERE itemmeta.order_item_id = items.order_item_id and items.order_id = %d", $this->id ) ); - $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}woocommerce_order_items WHERE order_id = %d", $this->id ) ); + $wpdb->query( $wpdb->prepare( "DELETE FROM itemmeta USING {$wpdb->prefix}woocommerce_order_itemmeta itemmeta INNER JOIN {$wpdb->prefix}woocommerce_order_items items WHERE itemmeta.order_item_id = items.order_item_id and items.order_id = %d", $this->get_id() ) ); + $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}woocommerce_order_items WHERE order_id = %d", $this->get_id() ) ); } } + /** + * Return an array of items/products within this order. + * @param string|array $type Types of line items to get (array or string). + * @return Array of WC_Order_item + */ + public function get_items( $type = 'line_item' ) { + global $wpdb; + $get_items_sql = $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}woocommerce_order_items WHERE order_id = %d ", $this->get_id() ) . "AND order_item_type IN ( '" . implode( "','", array_map( 'esc_sql', (array) $type ) ) . "' ) ORDER BY order_item_id;"; + $items = $wpdb->get_results( $get_items_sql ); + + if ( ! empty( $items ) ) { + $items = array_map( array( $this, 'get_item' ), array_combine( wp_list_pluck( $items, 'order_item_id' ), $items ) ); + } else { + $items = array(); + } + + return apply_filters( 'woocommerce_order_get_items', $items, $this ); + } + + /** + * Return an array of fees within this order. + * @return array + */ + public function get_fees() { + return $this->get_items( 'fee' ); + } + + /** + * Return an array of taxes within this order. + * @return array + */ + public function get_taxes() { + return $this->get_items( 'tax' ); + } + + /** + * Return an array of shipping costs within this order. + * @return array + */ + public function get_shipping_methods() { + return $this->get_items( 'shipping' ); + } + + /** + * Gets formatted shipping method title. + * @return string + */ + public function get_shipping_method() { + $names = array(); + foreach ( $this->get_shipping_methods() as $shipping_method ) { + $names[] = $shipping_method->get_name(); + } + return apply_filters( 'woocommerce_order_shipping_method', implode( ', ', $names ), $this ); + } + + /** + * Get coupon codes only. + * @return array + */ + public function get_used_coupons() { + $coupon_codes = array(); + if ( $coupons = $this->get_items( 'coupon' ) ) { + foreach ( $coupons as $coupon ) { + $coupon_codes[] = $coupon->get_code(); + } + } + return $coupon_codes; + } + + /** + * Gets the count of order items of a certain type. + * + * @param string $item_type + * @return string + */ + public function get_item_count( $item_type = '' ) { + $items = $this->get_items( empty( $item_type ) ? 'line_item' : $item_type ); + $count = 0; + + foreach ( $items as $item ) { + $count += $item->get_qty(); + } + + return apply_filters( 'woocommerce_get_item_count', $count, $item_type, $this ); + } + + /** + * Get an order item object, based on it's type. + * @since 2.7.0 + * @param int $item_id + * @return WC_Order_Item + */ + public function get_item( $item_id ) { + return WC_Order_Factory::get_order_item( $item_id ); + } + + /** + * Add a product line item to the order. + * Order must be saved prior to adding items. + * @param \WC_Product $product + * @param array $args + * @param array $deprecated qty was passed as arg 2 prior to 2.7.0 + * @return int order item ID + */ + public function add_product( $product, $args = array(), $deprecated = array() ) { + if ( ! is_array( $args ) ) { + _deprecated_argument( 'qty', '2.7', 'Pass only product and args' ); + $qty = $args; + $args = $deprecated; + $args['qty'] = $qty; + } + + $args = wp_parse_args( $args, array( + 'qty' => 1, + 'name' => $product ? $product->get_title() : '', + 'tax_class' => $product ? $product->get_tax_class() : '', + 'product_id' => $product ? $product->get_id() : '', + 'variation_id' => $product && isset( $product->variation_id ) ? $product->variation_id : 0, + 'subtotal' => $product ? $product->get_price_excluding_tax( $args['qty'] ) : '', + 'total' => $product ? $product->get_price_excluding_tax( $args['qty'] ) : '', + 'subtotal_tax' => 0, + 'total_tax' => 0, + 'variation' => array(), + 'taxes' => array( + 'subtotal' => array(), + 'total' => array(), + ), + ) ); + + // BW compatibility with old args + if ( isset( $args['totals'] ) ) { + foreach ( $args['totals'] as $key => $value ) { + if ( 'tax' === $key ) { + $args['total_tax'] = $value; + } elseif ( 'tax_data' === $key ) { + $args['taxes'] = $value; + } else { + $args[ $key ] = $value; + } + } + } + + $item = new WC_Order_Item_Product( $args ); + + // Handle backorders + if ( $product->backorders_require_notification() && $product->is_on_backorder( $args['qty'] ) ) { + $item->add_meta_data( apply_filters( 'woocommerce_backordered_item_meta_name', __( 'Backordered', 'woocommerce' ) ), $args['qty'] - max( 0, $product->get_total_stock() ), true ); + } + + $item->set_order_id( $this->get_id() ? $this->get_id() : $this->save() ); + $item->save(); + + if ( has_action( 'woocommerce_order_add_product' ) ) { + _deprecated_function( 'Action: woocommerce_order_add_product', '2.7', 'Use woocommerce_new_order_item action instead.' ); + do_action( 'woocommerce_order_add_product', $this->get_id(), $item->get_id(), $product, $qty, $args ); + } + + return $item->get_id(); + } + + /** + * Add coupon code to the order. + * Order must be saved prior to adding items. + * @param array $args + * @param int $deprecated1 2.7.0 code, discount, tax were passed. + * @param int $deprecated2 2.7.0 code, discount, tax were passed. + * @return int order item ID + */ + public function add_coupon( $args = array(), $deprecated1 = 0, $deprecated2 = 0 ) { + if ( ! is_array( $args ) ) { + _deprecated_argument( 'code', '2.7', 'Pass only an array of args' ); + $args = array( + 'code' => $args, + 'discount' => $deprecated1, + 'discount_tax' => $deprecated2, + ); + } + + $args = wp_parse_args( $args, array( + 'code' => '', + 'discount' => 0, + 'discount_tax' => 0, + ) ); + + $item = new WC_Order_Item_Coupon( $args ); + $item->set_order_id( $this->get_id() ? $this->get_id() : $this->save() ); + $item->save(); + + if ( has_action( 'woocommerce_order_add_coupon' ) ) { + _deprecated_function( 'Action: woocommerce_order_add_coupon', '2.7', 'Use woocommerce_new_order_item action instead.' ); + do_action( 'woocommerce_order_add_coupon', $this->get_id(), $item->get_id(), $args['code'], $args['discount'], $args['discount_tax'] ); + } + + return $item->get_id(); + } + + /** + * Add a tax row to the order. + * Order must be saved prior to adding items. + * @since 2.2 + * @param array $args + * @param int $deprecated1 2.7.0 tax_rate_id, amount, shipping amount. + * @param int $deprecated2 2.7.0 tax_rate_id, amount, shipping amount. + * @return int order item ID + */ + public function add_tax( $args = array(), $deprecated1 = 0, $deprecated2 = 0 ) { + if ( ! is_array( $args ) ) { + _deprecated_argument( 'tax_rate_id', '2.7', 'Pass only an array of args' ); + $args = array( + 'rate_id' => $args, + 'tax_total' => $deprecated1, + 'shipping_tax_total' => $deprecated2, + ); + } + + $args = wp_parse_args( $args, array( + 'rate_id' => '', + 'tax_total' => 0, + 'shipping_tax_total' => 0, + 'rate_code' => isset( $args['rate_id'] ) ? WC_Tax::get_rate_code( $args['rate_id'] ) : '', + 'label' => isset( $args['rate_id'] ) ? WC_Tax::get_rate_label( $args['rate_id'] ) : '', + 'compound' => isset( $args['rate_id'] ) ? WC_Tax::is_compound( $args['rate_id'] ) : '', + ) ); + + $item = new WC_Order_Item_Tax( $args ); + $item->set_order_id( $this->get_id() ? $this->get_id() : $this->save() ); + $item->save(); + + if ( has_action( 'woocommerce_order_add_tax' ) ) { + _deprecated_function( 'Action: woocommerce_order_add_tax', '2.7', 'Use woocommerce_new_order_item action instead.' ); + do_action( 'woocommerce_order_add_tax', $this->get_id(), $item->get_id(), $args['rate_id'], $args['tax_total'], $args['shipping_tax_total'] ); + } + + return $item->get_id(); + } + + /** + * Add a shipping row to the order. + * Order must be saved prior to adding items. + * @param WC_Shipping_Rate shipping_rate + * @return int order item ID + */ + public function add_shipping( $shipping_rate ) { + $item = new WC_Order_Item_Shipping( array( + 'method_title' => $shipping_rate->label, + 'method_id' => $shipping_rate->id, + 'total' => wc_format_decimal( $shipping_rate->cost ), + 'taxes' => $shipping_rate->taxes, + 'meta_data' => $shipping_rate->get_meta_data(), + ) ); + $item->set_order_id( $this->get_id() ? $this->get_id() : $this->save() ); + $item->save(); + + if ( has_action( 'woocommerce_order_add_shipping' ) ) { + _deprecated_function( 'Action: woocommerce_order_add_shipping', '2.7', 'Use woocommerce_new_order_item action instead.' ); + do_action( 'woocommerce_order_add_shipping', $this->get_id(), $item->get_id(), $shipping_rate ); + } + + return $item->get_id(); + } + + /** + * Add a fee to the order. + * Order must be saved prior to adding items. + * @param object $fee + * @return int updated order item ID + */ + public function add_fee( $fee ) { + $item = new WC_Order_Item_Fee( array( + 'name' => $fee->name, + 'tax_class' => $fee->taxable ? $fee->tax_class : 0, + 'total' => $fee->amount, + 'total_tax' => $fee->tax, + 'taxes' => array( + 'total' => $fee->tax_data, + ), + ) ); + + $item->set_order_id( $this->get_id() ? $this->get_id() : $this->save() ); + $item->save(); + + if ( has_action( 'woocommerce_order_add_fee' ) ) { + _deprecated_function( 'Action: woocommerce_order_add_fee', '2.7', 'Use woocommerce_new_order_item action instead.' ); + do_action( 'woocommerce_order_add_fee', $this->get_id(), $item->get_id(), $fee ); + } + + return $item->get_id(); + } + + /** + * Add a payment token to an order + * + * @since 2.6 + * @param WC_Payment_Token $token Payment token object + * @return boolean|int The new token ID or false if it failed. + */ + public function add_payment_token( $token ) { + if ( empty( $token ) || ! ( $token instanceof WC_Payment_Token ) ) { + return false; + } + + $token_ids = get_post_meta( $this->get_id(), '_payment_tokens', true ); + + if ( empty ( $token_ids ) ) { + $token_ids = array(); + } + + $token_ids[] = $token->get_id(); + + update_post_meta( $this->get_id(), '_payment_tokens', $token_ids ); + do_action( 'woocommerce_payment_token_added_to_order', $this->get_id(), $token->get_id(), $token, $token_ids ); + return $token->get_id(); + } + /** * Returns a list of all payment tokens associated with the current order * @@ -151,510 +1088,35 @@ abstract class WC_Abstract_Order { * @return array An array of payment token objects */ public function get_payment_tokens() { - return WC_Payment_Tokens::get_order_tokens( $this->id ); + return WC_Payment_Tokens::get_order_tokens( $this->get_id() ); } - /** - * Add a payment token to an order - * - * @since 2.6 - * @param WC_Payment_Token $token Payment token object - * @return boolean True if the token was added, false if not - */ - public function add_payment_token( $token ) { - if ( empty( $token ) || ! ( $token instanceof WC_Payment_Token ) ) { - return false; - } - - $token_ids = get_post_meta( $this->id, '_payment_tokens', true ); - if ( empty ( $token_ids ) ) { - $token_ids = array(); - } - $token_ids[] = $token->get_id(); - - update_post_meta( $this->id, '_payment_tokens', $token_ids ); - do_action( 'woocommerce_payment_token_added_to_order', $this->id, $token->get_id(), $token, $token_ids ); - return true; - } + /* + |-------------------------------------------------------------------------- + | Calculations. + |-------------------------------------------------------------------------- + | + | These methods calculate order totals and taxes based on the current data. + | + */ /** - * Set the payment method for the order. - * - * @param WC_Payment_Gateway|string $payment_method - */ - public function set_payment_method( $payment_method = '' ) { - if ( is_object( $payment_method ) ) { - update_post_meta( $this->id, '_payment_method', $payment_method->id ); - update_post_meta( $this->id, '_payment_method_title', $payment_method->get_title() ); - } else { - update_post_meta( $this->id, '_payment_method', '' ); - update_post_meta( $this->id, '_payment_method_title', '' ); - } - } - - /** - * Set the customer address. - * - * @param array $address Address data. - * @param string $type billing or shipping. - */ - public function set_address( $address, $type = 'billing' ) { - - foreach ( $address as $key => $value ) { - update_post_meta( $this->id, "_{$type}_" . $key, $value ); - } - } - - /** - * Returns the requested address in raw, non-formatted way. - * @since 2.4.0 - * @param string $type Billing or shipping. Anything else besides 'billing' will return shipping address. - * @return array The stored address after filter. - */ - public function get_address( $type = 'billing' ) { - - if ( 'billing' === $type ) { - $address = array( - 'first_name' => $this->billing_first_name, - 'last_name' => $this->billing_last_name, - 'company' => $this->billing_company, - 'address_1' => $this->billing_address_1, - 'address_2' => $this->billing_address_2, - 'city' => $this->billing_city, - 'state' => $this->billing_state, - 'postcode' => $this->billing_postcode, - 'country' => $this->billing_country, - 'email' => $this->billing_email, - 'phone' => $this->billing_phone, - ); - } else { - $address = array( - 'first_name' => $this->shipping_first_name, - 'last_name' => $this->shipping_last_name, - 'company' => $this->shipping_company, - 'address_1' => $this->shipping_address_1, - 'address_2' => $this->shipping_address_2, - 'city' => $this->shipping_city, - 'state' => $this->shipping_state, - 'postcode' => $this->shipping_postcode, - 'country' => $this->shipping_country, - ); - } - - return apply_filters( 'woocommerce_get_order_address', $address, $type, $this ); - } - - /** - * Add a product line item to the order. + * Calculate shipping total. * * @since 2.2 - * @param \WC_Product $product - * @param int $qty Line item quantity. - * @param array $args - * @return int|bool Item ID or false. + * @return float */ - public function add_product( $product, $qty = 1, $args = array() ) { - $args = wp_parse_args( $args, array( - 'variation' => array(), - 'totals' => array() - ) ); + public function calculate_shipping() { + $shipping_total = 0; - if ( ! $product ) { - return false; + foreach ( $this->get_shipping_methods() as $shipping ) { + $shipping_total += $shipping->get_total(); } - $item_id = wc_add_order_item( $this->id, array( - 'order_item_name' => $product->get_title(), - 'order_item_type' => 'line_item' - ) ); + $this->set_shipping_total( $shipping_total ); + $this->save(); - if ( ! $item_id ) { - return false; - } - - wc_add_order_item_meta( $item_id, '_qty', wc_stock_amount( $qty ) ); - wc_add_order_item_meta( $item_id, '_tax_class', $product->get_tax_class() ); - wc_add_order_item_meta( $item_id, '_product_id', $product->id ); - wc_add_order_item_meta( $item_id, '_variation_id', isset( $product->variation_id ) ? $product->variation_id : 0 ); - - // Set line item totals, either passed in or from the product - wc_add_order_item_meta( $item_id, '_line_subtotal', wc_format_decimal( isset( $args['totals']['subtotal'] ) ? $args['totals']['subtotal'] : $product->get_price_excluding_tax( $qty ) ) ); - wc_add_order_item_meta( $item_id, '_line_total', wc_format_decimal( isset( $args['totals']['total'] ) ? $args['totals']['total'] : $product->get_price_excluding_tax( $qty ) ) ); - wc_add_order_item_meta( $item_id, '_line_subtotal_tax', wc_format_decimal( isset( $args['totals']['subtotal_tax'] ) ? $args['totals']['subtotal_tax'] : 0 ) ); - wc_add_order_item_meta( $item_id, '_line_tax', wc_format_decimal( isset( $args['totals']['tax'] ) ? $args['totals']['tax'] : 0 ) ); - - // Save tax data - Since 2.2 - if ( isset( $args['totals']['tax_data'] ) ) { - - $tax_data = array(); - $tax_data['total'] = array_map( 'wc_format_decimal', $args['totals']['tax_data']['total'] ); - $tax_data['subtotal'] = array_map( 'wc_format_decimal', $args['totals']['tax_data']['subtotal'] ); - - wc_add_order_item_meta( $item_id, '_line_tax_data', $tax_data ); - } else { - wc_add_order_item_meta( $item_id, '_line_tax_data', array( 'total' => array(), 'subtotal' => array() ) ); - } - - // Add variation meta - if ( ! empty( $args['variation'] ) ) { - foreach ( $args['variation'] as $key => $value ) { - wc_add_order_item_meta( $item_id, str_replace( 'attribute_', '', $key ), $value ); - } - } - - // Backorders - if ( $product->backorders_require_notification() && $product->is_on_backorder( $qty ) ) { - wc_add_order_item_meta( $item_id, apply_filters( 'woocommerce_backordered_item_meta_name', __( 'Backordered', 'woocommerce' ) ), $qty - max( 0, $product->get_total_stock() ) ); - } - - do_action( 'woocommerce_order_add_product', $this->id, $item_id, $product, $qty, $args ); - - return $item_id; - } - - - /** - * Update a line item for the order. - * - * Note this does not update order totals. - * - * @since 2.2 - * @param int $item_id order item ID. - * @param array $args data to update. - * @param WC_Product $product - * @return bool - */ - public function update_product( $item_id, $product, $args ) { - - if ( ! $item_id || ! is_object( $product ) ) { - return false; - } - - // quantity - if ( isset( $args['qty'] ) ) { - wc_update_order_item_meta( $item_id, '_qty', wc_stock_amount( $args['qty'] ) ); - } - - // tax class - if ( isset( $args['tax_class'] ) ) { - wc_update_order_item_meta( $item_id, '_tax_class', $args['tax_class'] ); - } - - // set item totals, either provided or from product - if ( isset( $args['qty'] ) ) { - wc_update_order_item_meta( $item_id, '_line_subtotal', wc_format_decimal( isset( $args['totals']['subtotal'] ) ? $args['totals']['subtotal'] : $product->get_price_excluding_tax( $args['qty'] ) ) ); - wc_update_order_item_meta( $item_id, '_line_total', wc_format_decimal( isset( $args['totals']['total'] ) ? $args['totals']['total'] : $product->get_price_excluding_tax( $args['qty'] ) ) ); - } - - // set item tax totals - wc_update_order_item_meta( $item_id, '_line_subtotal_tax', wc_format_decimal( isset( $args['totals']['subtotal_tax'] ) ? $args['totals']['subtotal_tax'] : 0 ) ); - wc_update_order_item_meta( $item_id, '_line_tax', wc_format_decimal( isset( $args['totals']['tax'] ) ? $args['totals']['tax'] : 0 ) ); - - // variation meta - if ( isset( $args['variation'] ) && is_array( $args['variation'] ) ) { - - foreach ( $args['variation'] as $key => $value ) { - wc_update_order_item_meta( $item_id, str_replace( 'attribute_', '', $key ), $value ); - } - } - - // backorders - if ( isset( $args['qty'] ) && $product->backorders_require_notification() && $product->is_on_backorder( $args['qty'] ) ) { - wc_update_order_item_meta( $item_id, apply_filters( 'woocommerce_backordered_item_meta_name', __( 'Backordered', 'woocommerce' ) ), $args['qty'] - max( 0, $product->get_total_stock() ) ); - } - - do_action( 'woocommerce_order_edit_product', $this->id, $item_id, $args, $product ); - - return true; - } - - - /** - * Add coupon code to the order. - * - * @param string $code - * @param int $discount_amount - * @param int $discount_amount_tax "Discounted" tax - used for tax inclusive prices. - * @return int|bool Item ID or false. - */ - public function add_coupon( $code, $discount_amount = 0, $discount_amount_tax = 0 ) { - $item_id = wc_add_order_item( $this->id, array( - 'order_item_name' => $code, - 'order_item_type' => 'coupon' - ) ); - - if ( ! $item_id ) { - return false; - } - - wc_add_order_item_meta( $item_id, 'discount_amount', $discount_amount ); - wc_add_order_item_meta( $item_id, 'discount_amount_tax', $discount_amount_tax ); - - do_action( 'woocommerce_order_add_coupon', $this->id, $item_id, $code, $discount_amount, $discount_amount_tax ); - - return $item_id; - } - - /** - * Update coupon for order. - * - * Note this does not update order totals. - * - * @since 2.2 - * @param int $item_id - * @param array $args - * @return bool - */ - public function update_coupon( $item_id, $args ) { - if ( ! $item_id ) { - return false; - } - - // code - if ( isset( $args['code'] ) ) { - wc_update_order_item( $item_id, array( 'order_item_name' => $args['code'] ) ); - } - - // amount - if ( isset( $args['discount_amount'] ) ) { - wc_update_order_item_meta( $item_id, 'discount_amount', wc_format_decimal( $args['discount_amount'] ) ); - } - if ( isset( $args['discount_amount_tax'] ) ) { - wc_add_order_item_meta( $item_id, 'discount_amount_tax', wc_format_decimal( $args['discount_amount_tax'] ) ); - } - - do_action( 'woocommerce_order_update_coupon', $this->id, $item_id, $args ); - - return true; - } - - /** - * Add a tax row to the order. - * - * @since 2.2 - * @param int tax_rate_id - * @return int|bool Item ID or false. - */ - public function add_tax( $tax_rate_id, $tax_amount = 0, $shipping_tax_amount = 0 ) { - - $code = WC_Tax::get_rate_code( $tax_rate_id ); - - if ( ! $code ) { - return false; - } - - $item_id = wc_add_order_item( $this->id, array( - 'order_item_name' => $code, - 'order_item_type' => 'tax' - ) ); - - if ( ! $item_id ) { - return false; - } - - wc_add_order_item_meta( $item_id, 'rate_id', $tax_rate_id ); - wc_add_order_item_meta( $item_id, 'label', WC_Tax::get_rate_label( $tax_rate_id ) ); - wc_add_order_item_meta( $item_id, 'compound', WC_Tax::is_compound( $tax_rate_id ) ? 1 : 0 ); - wc_add_order_item_meta( $item_id, 'tax_amount', wc_format_decimal( $tax_amount ) ); - wc_add_order_item_meta( $item_id, 'shipping_tax_amount', wc_format_decimal( $shipping_tax_amount ) ); - - do_action( 'woocommerce_order_add_tax', $this->id, $item_id, $tax_rate_id, $tax_amount, $shipping_tax_amount ); - - return $item_id; - } - - /** - * Add a shipping row to the order. - * - * @param WC_Shipping_Rate shipping_rate - * @return int|bool Item ID or false. - */ - public function add_shipping( $shipping_rate ) { - - $item_id = wc_add_order_item( $this->id, array( - 'order_item_name' => $shipping_rate->label, - 'order_item_type' => 'shipping' - ) ); - - if ( ! $item_id ) { - return false; - } - - wc_add_order_item_meta( $item_id, 'method_id', $shipping_rate->id ); - wc_add_order_item_meta( $item_id, 'cost', wc_format_decimal( $shipping_rate->cost ) ); - - // Save shipping taxes - Since 2.2 - $taxes = array_map( 'wc_format_decimal', $shipping_rate->taxes ); - wc_add_order_item_meta( $item_id, 'taxes', $taxes ); - - // Store meta - $shipping_meta = $shipping_rate->get_meta_data(); - if ( ! empty( $shipping_meta ) ) { - foreach ( $shipping_rate->get_meta_data() as $key => $value ) { - wc_add_order_item_meta( $item_id, $key, $value ); - } - } - - do_action( 'woocommerce_order_add_shipping', $this->id, $item_id, $shipping_rate ); - - // Update total - $this->set_total( $this->order_shipping + wc_format_decimal( $shipping_rate->cost ), 'shipping' ); - - return $item_id; - } - - /** - * Update shipping method for order. - * - * Note this does not update the order total. - * - * @since 2.2 - * @param int $item_id - * @param array $args - * @return bool - */ - public function update_shipping( $item_id, $args ) { - - if ( ! $item_id ) { - return false; - } - - // method title - if ( isset( $args['method_title'] ) ) { - wc_update_order_item( $item_id, array( 'order_item_name' => $args['method_title'] ) ); - } - - // method ID - if ( isset( $args['method_id'] ) ) { - wc_update_order_item_meta( $item_id, 'method_id', $args['method_id'] ); - } - - // method cost - if ( isset( $args['cost'] ) ) { - // Get old cost before updating - $old_cost = wc_get_order_item_meta( $item_id, 'cost' ); - - // Update - wc_update_order_item_meta( $item_id, 'cost', wc_format_decimal( $args['cost'] ) ); - - // Update total - $this->set_total( $this->order_shipping - wc_format_decimal( $old_cost ) + wc_format_decimal( $args['cost'] ), 'shipping' ); - } - - do_action( 'woocommerce_order_update_shipping', $this->id, $item_id, $args ); - - return true; - } - - /** - * Add a fee to the order. - * - * @param object $fee - * @return int|bool Item ID or false. - */ - public function add_fee( $fee ) { - - $item_id = wc_add_order_item( $this->id, array( - 'order_item_name' => $fee->name, - 'order_item_type' => 'fee' - ) ); - - if ( ! $item_id ) { - return false; - } - - if ( $fee->taxable ) { - wc_add_order_item_meta( $item_id, '_tax_class', $fee->tax_class ); - } else { - wc_add_order_item_meta( $item_id, '_tax_class', '0' ); - } - - wc_add_order_item_meta( $item_id, '_line_total', wc_format_decimal( $fee->amount ) ); - wc_add_order_item_meta( $item_id, '_line_tax', wc_format_decimal( $fee->tax ) ); - - // Save tax data - Since 2.2 - $tax_data = array_map( 'wc_format_decimal', $fee->tax_data ); - wc_add_order_item_meta( $item_id, '_line_tax_data', array( 'total' => $tax_data ) ); - - do_action( 'woocommerce_order_add_fee', $this->id, $item_id, $fee ); - - return $item_id; - } - - /** - * Update fee for order. - * - * Note this does not update order totals. - * - * @since 2.2 - * @param int $item_id - * @param array $args - * @return bool - */ - public function update_fee( $item_id, $args ) { - - if ( ! $item_id ) { - return false; - } - - // name - if ( isset( $args['name'] ) ) { - wc_update_order_item( $item_id, array( 'order_item_name' => $args['name'] ) ); - } - - // tax class - if ( isset( $args['tax_class'] ) ) { - wc_update_order_item_meta( $item_id, '_tax_class', $args['tax_class'] ); - } - - // total - if ( isset( $args['line_total'] ) ) { - wc_update_order_item_meta( $item_id, '_line_total', wc_format_decimal( $args['line_total'] ) ); - } - - // total tax - if ( isset( $args['line_tax'] ) ) { - wc_update_order_item_meta( $item_id, '_line_tax', wc_format_decimal( $args['line_tax'] ) ); - } - - do_action( 'woocommerce_order_update_fee', $this->id, $item_id, $args ); - - return true; - } - - /** - * Set an order total. - * - * @param float $amount - * @param string $total_type - * - * @return bool - */ - public function set_total( $amount, $total_type = 'total' ) { - - if ( ! in_array( $total_type, array( 'shipping', 'tax', 'shipping_tax', 'total', 'cart_discount', 'cart_discount_tax' ) ) ) { - return false; - } - - switch ( $total_type ) { - case 'total' : - $key = '_order_total'; - $amount = wc_format_decimal( $amount, wc_get_price_decimals() ); - break; - case 'cart_discount' : - case 'cart_discount_tax' : - $key = '_' . $total_type; - $amount = wc_format_decimal( $amount ); - break; - default : - $key = '_order_' . $total_type; - $amount = wc_format_decimal( $amount ); - break; - } - - update_post_meta( $this->id, $key, $amount ); - - return true; + return $this->get_shipping_total(); } /** @@ -679,75 +1141,53 @@ abstract class WC_Abstract_Order { * Calculate taxes for all line items and shipping, and store the totals and tax rows. * * Will use the base country unless customer addresses are set. - * - * @return bool success or fail. + * @param $args array Added in 2.7.0 to pass things like location. */ - public function calculate_taxes() { - $tax_total = 0; - $shipping_tax_total = 0; - $taxes = array(); - $shipping_taxes = array(); - $tax_based_on = get_option( 'woocommerce_tax_based_on' ); - - // If is_vat_exempt is 'yes', or wc_tax_enabled is false, return and do nothing. - if ( 'yes' === $this->is_vat_exempt || ! wc_tax_enabled() ) { - return false; - } - - if ( 'billing' === $tax_based_on ) { - $country = $this->billing_country; - $state = $this->billing_state; - $postcode = $this->billing_postcode; - $city = $this->billing_city; - } elseif ( 'shipping' === $tax_based_on ) { - $country = $this->shipping_country; - $state = $this->shipping_state; - $postcode = $this->shipping_postcode; - $city = $this->shipping_city; - } + public function calculate_taxes( $args = array() ) { + $tax_based_on = get_option( 'woocommerce_tax_based_on' ); + $args = wp_parse_args( $args, array( + 'country' => 'billing' === $tax_based_on ? $this->get_billing_country() : $this->get_shipping_country(), + 'state' => 'billing' === $tax_based_on ? $this->get_billing_state() : $this->get_shipping_state(), + 'postcode' => 'billing' === $tax_based_on ? $this->get_billing_postcode() : $this->get_shipping_postcode(), + 'city' => 'billing' === $tax_based_on ? $this->get_billing_city() : $this->get_shipping_city(), + ) ); // Default to base - if ( 'base' === $tax_based_on || empty( $country ) ) { - $default = wc_get_base_location(); - $country = $default['country']; - $state = $default['state']; - $postcode = ''; - $city = ''; + if ( 'base' === $tax_based_on || empty( $args['country'] ) ) { + $default = wc_get_base_location(); + $args['country'] = $default['country']; + $args['state'] = $default['state']; + $args['postcode'] = ''; + $args['city'] = ''; } - // Get items + // Calc taxes for line items foreach ( $this->get_items( array( 'line_item', 'fee' ) ) as $item_id => $item ) { + $tax_class = $item->get_tax_class(); + $tax_status = $item->get_tax_status(); - $product = $this->get_product_from_item( $item ); - $line_total = isset( $item['line_total'] ) ? $item['line_total'] : 0; - $line_subtotal = isset( $item['line_subtotal'] ) ? $item['line_subtotal'] : 0; - $tax_class = $item['tax_class']; - $item_tax_status = $product ? $product->get_tax_status() : 'taxable'; - - if ( '0' !== $tax_class && 'taxable' === $item_tax_status ) { - + if ( '0' !== $tax_class && 'taxable' === $tax_status ) { $tax_rates = WC_Tax::find_rates( array( - 'country' => $country, - 'state' => $state, - 'postcode' => $postcode, - 'city' => $city, - 'tax_class' => $tax_class + 'country' => $args['country'], + 'state' => $args['state'], + 'postcode' => $args['postcode'], + 'city' => $args['city'], + 'tax_class' => $tax_class, ) ); - $line_subtotal_taxes = WC_Tax::calc_tax( $line_subtotal, $tax_rates, false ); - $line_taxes = WC_Tax::calc_tax( $line_total, $tax_rates, false ); - $line_subtotal_tax = max( 0, array_sum( $line_subtotal_taxes ) ); - $line_tax = max( 0, array_sum( $line_taxes ) ); - $tax_total += $line_tax; + $total = $item->get_total(); + $taxes = WC_Tax::calc_tax( $total, $tax_rates, false ); - wc_update_order_item_meta( $item_id, '_line_subtotal_tax', wc_format_decimal( $line_subtotal_tax ) ); - wc_update_order_item_meta( $item_id, '_line_tax', wc_format_decimal( $line_tax ) ); - wc_update_order_item_meta( $item_id, '_line_tax_data', array( 'total' => $line_taxes, 'subtotal' => $line_subtotal_taxes ) ); - - // Sum the item taxes - foreach ( array_keys( $taxes + $line_taxes ) as $key ) { - $taxes[ $key ] = ( isset( $line_taxes[ $key ] ) ? $line_taxes[ $key ] : 0 ) + ( isset( $taxes[ $key ] ) ? $taxes[ $key ] : 0 ); + if ( $item->is_type( 'line_item' ) ) { + $subtotal = $item->get_subtotal(); + $subtotal_taxes = WC_Tax::calc_tax( $subtotal, $tax_rates, false ); + $subtotal_tax = max( 0, array_sum( $subtotal_taxes ) ); + $item->set_subtotal_tax( $subtotal_tax ); + $item->set_taxes( array( 'total' => $taxes, 'subtotal' => $subtotal_taxes ) ); + } else { + $item->set_taxes( array( 'total' => $taxes ) ); } + $item->save(); } } @@ -764,10 +1204,10 @@ abstract class WC_Abstract_Order { $tax_class = sanitize_title( $tax_class ); if ( in_array( $tax_class, $found_tax_classes ) ) { $tax_rates = WC_Tax::find_shipping_rates( array( - 'country' => $country, - 'state' => $state, - 'postcode' => $postcode, - 'city' => $city, + 'country' => $args['country'], + 'state' => $args['state'], + 'postcode' => $args['postcode'], + 'city' => $args['city'], 'tax_class' => $tax_class, ) ); break; @@ -775,100 +1215,37 @@ abstract class WC_Abstract_Order { } } else { $tax_rates = WC_Tax::find_shipping_rates( array( - 'country' => $country, - 'state' => $state, - 'postcode' => $postcode, - 'city' => $city, + 'country' => $args['country'], + 'state' => $args['state'], + 'postcode' => $args['postcode'], + 'city' => $args['city'], 'tax_class' => 'standard' === $shipping_tax_class ? '' : $shipping_tax_class, ) ); } - - $line_taxes = WC_Tax::calc_tax( $item['cost'], $tax_rates, false ); - $line_tax = max( 0, array_sum( $line_taxes ) ); - $shipping_tax_total += $line_tax; - - wc_update_order_item_meta( $item_id, '_line_tax', wc_format_decimal( $line_tax ) ); - wc_update_order_item_meta( $item_id, '_line_tax_data', array( 'total' => $line_taxes ) ); - - // Sum the item taxes - foreach ( array_keys( $shipping_taxes + $line_taxes ) as $key ) { - $shipping_taxes[ $key ] = ( isset( $line_taxes[ $key ] ) ? $line_taxes[ $key ] : 0 ) + ( isset( $shipping_taxes[ $key ] ) ? $shipping_taxes[ $key ] : 0 ); - } + $item->set_taxes( array( 'total' => WC_Tax::calc_tax( $item->get_total(), $tax_rates, false ) ) ); + $item->save(); } - - // Save tax totals - $this->set_total( $shipping_tax_total, 'shipping_tax' ); - $this->set_total( $tax_total, 'tax' ); - - // Tax rows - $this->remove_order_items( 'tax' ); - - // Now merge to keep tax rows - foreach ( array_keys( $taxes + $shipping_taxes ) as $tax_rate_id ) { - $this->add_tax( $tax_rate_id, isset( $taxes[ $tax_rate_id ] ) ? $taxes[ $tax_rate_id ] : 0, isset( $shipping_taxes[ $tax_rate_id ] ) ? $shipping_taxes[ $tax_rate_id ] : 0 ); - } - - return true; - } - - - /** - * Calculate shipping total. - * - * @since 2.2 - * @return float - */ - public function calculate_shipping() { - - $shipping_total = 0; - - foreach ( $this->get_shipping_methods() as $shipping ) { - $shipping_total += $shipping['cost']; - } - - $this->set_total( $shipping_total, 'shipping' ); - - return $this->get_total_shipping(); + $this->update_taxes(); } /** - * Update tax lines at order level by looking at the line item taxes themselves. - * - * @return bool success or fail. + * Update tax lines for the order based on the line item taxes themselves. */ public function update_taxes() { - $order_taxes = array(); - $order_shipping_taxes = array(); + $cart_taxes = array(); + $shipping_taxes = array(); foreach ( $this->get_items( array( 'line_item', 'fee' ) ) as $item_id => $item ) { - - $line_tax_data = maybe_unserialize( $item['line_tax_data'] ); - - if ( isset( $line_tax_data['total'] ) ) { - - foreach ( $line_tax_data['total'] as $tax_rate_id => $tax ) { - - if ( ! isset( $order_taxes[ $tax_rate_id ] ) ) { - $order_taxes[ $tax_rate_id ] = 0; - } - - $order_taxes[ $tax_rate_id ] += $tax; - } + $taxes = $item->get_taxes(); + foreach ( $taxes['total'] as $tax_rate_id => $tax ) { + $cart_taxes[ $tax_rate_id ] = isset( $cart_taxes[ $tax_rate_id ] ) ? $cart_taxes[ $tax_rate_id ] + $tax : $tax; } } - foreach ( $this->get_items( array( 'shipping' ) ) as $item_id => $item ) { - - $line_tax_data = maybe_unserialize( $item['taxes'] ); - - if ( isset( $line_tax_data ) ) { - foreach ( $line_tax_data as $tax_rate_id => $tax ) { - if ( ! isset( $order_shipping_taxes[ $tax_rate_id ] ) ) { - $order_shipping_taxes[ $tax_rate_id ] = 0; - } - - $order_shipping_taxes[ $tax_rate_id ] += $tax; - } + foreach ( $this->get_shipping_methods() as $item_id => $item ) { + $taxes = $item->get_taxes(); + foreach ( $taxes['total'] as $tax_rate_id => $tax ) { + $shipping_taxes[ $tax_rate_id ] = isset( $shipping_taxes[ $tax_rate_id ] ) ? $shipping_taxes[ $tax_rate_id ] + $tax : $tax; } } @@ -876,15 +1253,18 @@ abstract class WC_Abstract_Order { $this->remove_order_items( 'tax' ); // Now merge to keep tax rows. - foreach ( array_keys( $order_taxes + $order_shipping_taxes ) as $tax_rate_id ) { - $this->add_tax( $tax_rate_id, isset( $order_taxes[ $tax_rate_id ] ) ? $order_taxes[ $tax_rate_id ] : 0, isset( $order_shipping_taxes[ $tax_rate_id ] ) ? $order_shipping_taxes[ $tax_rate_id ] : 0 ); + foreach ( array_keys( $cart_taxes + $shipping_taxes ) as $tax_rate_id ) { + $this->add_tax( array( + 'rate_id' => $tax_rate_id, + 'tax_total' => isset( $cart_taxes[ $tax_rate_id ] ) ? $cart_taxes[ $tax_rate_id ] : 0, + 'shipping_tax_total' => isset( $shipping_taxes[ $tax_rate_id ] ) ? $shipping_taxes[ $tax_rate_id ] : 0, + ) ); } // Save tax totals - $this->set_total( WC_Tax::round( array_sum( $order_shipping_taxes ) ), 'shipping_tax' ); - $this->set_total( WC_Tax::round( array_sum( $order_taxes ) ), 'tax' ); - - return true; + $this->set_shipping_tax( WC_Tax::round( array_sum( $shipping_taxes ) ) ); + $this->set_cart_tax( WC_Tax::round( array_sum( $cart_taxes ) ) ); + $this->save(); } /** @@ -907,809 +1287,148 @@ abstract class WC_Abstract_Order { // line items foreach ( $this->get_items() as $item ) { - $cart_subtotal += wc_format_decimal( isset( $item['line_subtotal'] ) ? $item['line_subtotal'] : 0 ); - $cart_total += wc_format_decimal( isset( $item['line_total'] ) ? $item['line_total'] : 0 ); - $cart_subtotal_tax += wc_format_decimal( isset( $item['line_subtotal_tax'] ) ? $item['line_subtotal_tax'] : 0 ); - $cart_total_tax += wc_format_decimal( isset( $item['line_tax'] ) ? $item['line_tax'] : 0 ); + $cart_subtotal += wc_format_decimal( $item->get_subtotal() ); + $cart_total += wc_format_decimal( $item->get_total() ); + $cart_subtotal_tax += wc_format_decimal( $item->get_subtotal_tax() ); + $cart_total_tax += wc_format_decimal( $item->get_total_tax() ); } $this->calculate_shipping(); foreach ( $this->get_fees() as $item ) { - $fee_total += $item['line_total']; + $fee_total += $item->get_total(); } - $this->set_total( $cart_subtotal - $cart_total, 'cart_discount' ); - $this->set_total( $cart_subtotal_tax - $cart_total_tax, 'cart_discount_tax' ); + $grand_total = round( $cart_total + $fee_total + $this->get_shipping_total() + $this->get_cart_tax() + $this->get_shipping_tax(), wc_get_price_decimals() ); - $grand_total = round( $cart_total + $fee_total + $this->get_total_shipping() + $this->get_cart_tax() + $this->get_shipping_tax(), wc_get_price_decimals() ); - - $this->set_total( $grand_total, 'total' ); + $this->set_discount_total( $cart_subtotal - $cart_total ); + $this->set_discount_tax( $cart_subtotal_tax - $cart_total_tax ); + $this->set_total( $grand_total ); + $this->save(); return $grand_total; } - /** - * Gets an order from the database. - * - * @param int $id (default: 0). - * @return bool - */ - public function get_order( $id = 0 ) { - - if ( ! $id ) { - return false; - } - - if ( $result = get_post( $id ) ) { - $this->populate( $result ); - return true; - } - - return false; - } - - /** - * Populates an order from the loaded post data. - * - * @param mixed $result - */ - public function populate( $result ) { - - // Standard post data - $this->id = $result->ID; - $this->order_date = $result->post_date; - $this->modified_date = $result->post_modified; - $this->customer_message = $result->post_excerpt; - $this->customer_note = $result->post_excerpt; - $this->post_status = $result->post_status; - - // Billing email can default to user if set. - if ( empty( $this->billing_email ) && ! empty( $this->customer_user ) && ( $user = get_user_by( 'id', $this->customer_user ) ) ) { - $this->billing_email = $user->user_email; - } - - // Orders store the state of prices including tax when created. - $this->prices_include_tax = metadata_exists( 'post', $this->id, '_prices_include_tax' ) ? get_post_meta( $this->id, '_prices_include_tax', true ) === 'yes' : $this->prices_include_tax; - } - - /** - * __isset function. - * - * @param mixed $key - * @return bool - */ - public function __isset( $key ) { - - if ( ! $this->id ) { - return false; - } - - return metadata_exists( 'post', $this->id, '_' . $key ); - } - - /** - * __get function. - * - * @param mixed $key - * @return mixed - */ - public function __get( $key ) { - // Get values or default if not set. - if ( 'completed_date' === $key ) { - $value = ( $value = get_post_meta( $this->id, '_completed_date', true ) ) ? $value : $this->modified_date; - } elseif ( 'user_id' === $key ) { - $value = ( $value = get_post_meta( $this->id, '_customer_user', true ) ) ? absint( $value ) : ''; - } elseif ( 'status' === $key ) { - $value = $this->get_status(); - } else { - $value = get_post_meta( $this->id, '_' . $key, true ); - } - - return $value; - } - - /** - * Return the order statuses without wc- internal prefix. - * - * Queries get_post_status() directly to avoid having out of date statuses, if updated elsewhere. - * - * @return string - */ - public function get_status() { - $this->post_status = get_post_status( $this->id ); - return apply_filters( 'woocommerce_order_get_status', 'wc-' === substr( $this->post_status, 0, 3 ) ? substr( $this->post_status, 3 ) : $this->post_status, $this ); - } - - /** - * Checks the order status against a passed in status. - * - * @return bool - */ - public function has_status( $status ) { - return apply_filters( 'woocommerce_order_has_status', ( is_array( $status ) && in_array( $this->get_status(), $status ) ) || $this->get_status() === $status ? true : false, $this, $status ); - } - - /** - * Gets the user ID associated with the order. Guests are 0. - * - * @since 2.2 - * @return int - */ - public function get_user_id() { - return $this->customer_user ? intval( $this->customer_user ) : 0; - } - - /** - * Get the user associated with the order. False for guests. - * - * @since 2.2 - * @return WP_User|false - */ - public function get_user() { - return $this->get_user_id() ? get_user_by( 'id', $this->get_user_id() ) : false; - } - - /** - * Get transaction id for the order. - * - * @return string - */ - public function get_transaction_id() { - return get_post_meta( $this->id, '_transaction_id', true ); - } - - /** - * Check if an order key is valid. - * - * @param mixed $key - * @return bool - */ - public function key_is_valid( $key ) { - - if ( $key == $this->order_key ) { - return true; - } - - return false; - } - - /** - * get_order_number function. - * - * Gets the order number for display (by default, order ID). - * - * @return string - */ - public function get_order_number() { - return apply_filters( 'woocommerce_order_number', $this->id, $this ); - } - - /** - * Get a formatted billing address for the order. - * - * @return string - */ - public function get_formatted_billing_address() { - if ( ! $this->formatted_billing_address ) { - - // Formatted Addresses. - $address = apply_filters( 'woocommerce_order_formatted_billing_address', array( - 'first_name' => $this->billing_first_name, - 'last_name' => $this->billing_last_name, - 'company' => $this->billing_company, - 'address_1' => $this->billing_address_1, - 'address_2' => $this->billing_address_2, - 'city' => $this->billing_city, - 'state' => $this->billing_state, - 'postcode' => $this->billing_postcode, - 'country' => $this->billing_country - ), $this ); - - $this->formatted_billing_address = WC()->countries->get_formatted_address( $address ); - } - - return $this->formatted_billing_address; - } - - /** - * Get a formatted shipping address for the order. - * - * @return string - */ - public function get_formatted_shipping_address() { - if ( ! $this->formatted_shipping_address ) { - - if ( $this->shipping_address_1 || $this->shipping_address_2 ) { - - // Formatted Addresses - $address = apply_filters( 'woocommerce_order_formatted_shipping_address', array( - 'first_name' => $this->shipping_first_name, - 'last_name' => $this->shipping_last_name, - 'company' => $this->shipping_company, - 'address_1' => $this->shipping_address_1, - 'address_2' => $this->shipping_address_2, - 'city' => $this->shipping_city, - 'state' => $this->shipping_state, - 'postcode' => $this->shipping_postcode, - 'country' => $this->shipping_country - ), $this ); - - $this->formatted_shipping_address = WC()->countries->get_formatted_address( $address ); - } - } - - return $this->formatted_shipping_address; - } - - /** - * Get a formatted shipping address for the order. - * - * @return string - */ - public function get_shipping_address_map_url() { - $address = apply_filters( 'woocommerce_shipping_address_map_url_parts', array( - 'address_1' => $this->shipping_address_1, - 'address_2' => $this->shipping_address_2, - 'city' => $this->shipping_city, - 'state' => $this->shipping_state, - 'postcode' => $this->shipping_postcode, - 'country' => $this->shipping_country - ), $this ); - - return apply_filters( 'woocommerce_shipping_address_map_url', 'https://maps.google.com/maps?&q=' . urlencode( implode( ', ', $address ) ) . '&z=16', $this ); - } - - /** - * Get the billing address in an array. - * @deprecated 2.3 - * @return string - */ - public function get_billing_address() { - _deprecated_function( 'get_billing_address', '2.3', 'get_formatted_billing_address' ); - return $this->get_formatted_billing_address(); - } - - /** - * Get the shipping address in an array. - * @deprecated 2.3 - * @return string - */ - public function get_shipping_address() { - _deprecated_function( 'get_shipping_address', '2.3', 'get_formatted_shipping_address' ); - return $this->get_formatted_shipping_address(); - } - - /** - * Get a formatted billing full name. - * - * @since 2.4.0 - * - * @return string - */ - public function get_formatted_billing_full_name() { - return sprintf( _x( '%1$s %2$s', 'full name', 'woocommerce' ), $this->billing_first_name, $this->billing_last_name ); - } - - /** - * Get a formatted shipping full name. - * - * @since 2.4.0 - * - * @return string - */ - public function get_formatted_shipping_full_name() { - return sprintf( _x( '%1$s %2$s', 'full name', 'woocommerce' ), $this->shipping_first_name, $this->shipping_last_name ); - } - - /** - * Return an array of items/products within this order. - * - * @param string|array $type Types of line items to get (array or string). - * @return array - */ - public function get_items( $type = '' ) { - global $wpdb; - - if ( empty( $type ) ) { - $type = array( 'line_item' ); - } - - if ( ! is_array( $type ) ) { - $type = array( $type ); - } - - $items = array(); - $get_items_sql = $wpdb->prepare( "SELECT order_item_id, order_item_name, order_item_type FROM {$wpdb->prefix}woocommerce_order_items WHERE order_id = %d ", $this->id ); - $get_items_sql .= "AND order_item_type IN ( '" . implode( "','", array_map( 'esc_sql', $type ) ) . "' ) ORDER BY order_item_id;"; - $line_items = $wpdb->get_results( $get_items_sql ); - - // Loop items - foreach ( $line_items as $item ) { - $items[ $item->order_item_id ]['name'] = $item->order_item_name; - $items[ $item->order_item_id ]['type'] = $item->order_item_type; - $items[ $item->order_item_id ]['item_meta'] = $this->get_item_meta( $item->order_item_id ); - $items[ $item->order_item_id ]['item_meta_array'] = $this->get_item_meta_array( $item->order_item_id ); - $items[ $item->order_item_id ] = $this->expand_item_meta( $items[ $item->order_item_id ] ); - } - - return apply_filters( 'woocommerce_order_get_items', $items, $this ); - } - - /** - * Expand item meta into the $item array. - * @since 2.4.0 - * @param array $item before expansion. - * @return array - */ - public function expand_item_meta( $item ) { - // Reserved meta keys - $reserved_item_meta_keys = array( - 'name', - 'type', - 'item_meta', - 'item_meta_array', - 'qty', - 'tax_class', - 'product_id', - 'variation_id', - 'line_subtotal', - 'line_total', - 'line_tax', - 'line_subtotal_tax' - ); - - // Expand item meta if set. - if ( ! empty( $item['item_meta'] ) ) { - foreach ( $item['item_meta'] as $name => $value ) { - if ( in_array( $name, $reserved_item_meta_keys ) ) { - continue; - } - if ( '_' === substr( $name, 0, 1 ) ) { - $item[ substr( $name, 1 ) ] = $value[0]; - } elseif ( ! in_array( $name, $reserved_item_meta_keys ) ) { - $item[ $name ] = make_clickable( $value[0] ); - } - } - } - return $item; - } - - /** - * Gets the count of order items of a certain type. - * - * @param string $item_type - * @return string - */ - public function get_item_count( $item_type = '' ) { - if ( empty( $item_type ) ) { - $item_type = array( 'line_item' ); - } - if ( ! is_array( $item_type ) ) { - $item_type = array( $item_type ); - } - - $items = $this->get_items( $item_type ); - $count = 0; - - foreach ( $items as $item ) { - $count += empty( $item['qty'] ) ? 1 : $item['qty']; - } - - return apply_filters( 'woocommerce_get_item_count', $count, $item_type, $this ); - } - - /** - * Get refunds - * @return array - */ - public function get_refunds() { return array(); } - - /** - * Return an array of fees within this order. - * - * @return array - */ - public function get_fees() { - return $this->get_items( 'fee' ); - } - - /** - * Return an array of taxes within this order. - * - * @return array - */ - public function get_taxes() { - return $this->get_items( 'tax' ); - } - - /** - * Return an array of shipping costs within this order. - * - * @return array - */ - public function get_shipping_methods() { - return $this->get_items( 'shipping' ); - } - - /** - * Check whether this order has a specific shipping method or not. - * - * @param string $method_id - * - * @return bool - */ - public function has_shipping_method( $method_id ) { - - $shipping_methods = $this->get_shipping_methods(); - $has_method = false; - - if ( empty( $shipping_methods ) ) { - return false; - } - - foreach ( $shipping_methods as $shipping_method ) { - if ( $shipping_method['method_id'] == $method_id ) { - $has_method = true; - } - } - - return $has_method; - } - - /** - * Get taxes, merged by code, formatted ready for output. - * - * @return array - */ - public function get_tax_totals() { - - $taxes = $this->get_items( 'tax' ); - $tax_totals = array(); - - foreach ( $taxes as $key => $tax ) { - - $code = $tax[ 'name' ]; - - if ( ! isset( $tax_totals[ $code ] ) ) { - $tax_totals[ $code ] = new stdClass(); - $tax_totals[ $code ]->amount = 0; - } - - $tax_totals[ $code ]->id = $key; - $tax_totals[ $code ]->rate_id = $tax['rate_id']; - $tax_totals[ $code ]->is_compound = $tax[ 'compound' ]; - $tax_totals[ $code ]->label = isset( $tax[ 'label' ] ) ? $tax[ 'label' ] : $tax[ 'name' ]; - $tax_totals[ $code ]->amount += $tax[ 'tax_amount' ] + $tax[ 'shipping_tax_amount' ]; - $tax_totals[ $code ]->formatted_amount = wc_price( wc_round_tax_total( $tax_totals[ $code ]->amount ), array('currency' => $this->get_order_currency()) ); - } - - if ( apply_filters( 'woocommerce_order_hide_zero_taxes', true ) ) { - $amounts = array_filter( wp_list_pluck( $tax_totals, 'amount' ) ); - $tax_totals = array_intersect_key( $tax_totals, $amounts ); - } - - return apply_filters( 'woocommerce_order_tax_totals', $tax_totals, $this ); - } - - /** - * has_meta function for order items. - * - * @param string $order_item_id - * @return array of meta data. - */ - public function has_meta( $order_item_id ) { - global $wpdb; - - return $wpdb->get_results( $wpdb->prepare( "SELECT meta_key, meta_value, meta_id, order_item_id - FROM {$wpdb->prefix}woocommerce_order_itemmeta WHERE order_item_id = %d - ORDER BY meta_id", absint( $order_item_id ) ), ARRAY_A ); - } - - /** - * Get all item meta data in array format in the order it was saved. Does not group meta by key like get_item_meta(). - * - * @param mixed $order_item_id - * @return array of objects - */ - public function get_item_meta_array( $order_item_id ) { - global $wpdb; - - // Get cache key - uses get_cache_prefix to invalidate when needed - $cache_key = WC_Cache_Helper::get_cache_prefix( 'orders' ) . 'item_meta_array_' . $order_item_id; - $item_meta_array = wp_cache_get( $cache_key, 'orders' ); - - if ( false === $item_meta_array ) { - $item_meta_array = array(); - $metadata = $wpdb->get_results( $wpdb->prepare( "SELECT meta_key, meta_value, meta_id FROM {$wpdb->prefix}woocommerce_order_itemmeta WHERE order_item_id = %d ORDER BY meta_id", absint( $order_item_id ) ) ); - foreach ( $metadata as $metadata_row ) { - $item_meta_array[ $metadata_row->meta_id ] = (object) array( 'key' => $metadata_row->meta_key, 'value' => $metadata_row->meta_value ); - } - wp_cache_set( $cache_key, $item_meta_array, 'orders' ); - } - - return $item_meta_array ; - } - - /** - * Display meta data belonging to an item. - * @param array $item - */ - public function display_item_meta( $item ) { - $product = $this->get_product_from_item( $item ); - $item_meta = new WC_Order_Item_Meta( $item, $product ); - $item_meta->display(); - } - - /** - * Get order item meta. - * - * @param mixed $order_item_id - * @param string $key (default: '') - * @param bool $single (default: false) - * @return array|string - */ - public function get_item_meta( $order_item_id, $key = '', $single = false ) { - return get_metadata( 'order_item', $order_item_id, $key, $single ); - } - - /** Total Getters *******************************************************/ - - /** - * Gets the total discount amount. - * @param bool $ex_tax Show discount excl any tax. - * @return float - */ - public function get_total_discount( $ex_tax = true ) { - if ( ! $this->order_version || version_compare( $this->order_version, '2.3.7', '<' ) ) { - // Backwards compatible total calculation - totals were not stored consistently in old versions. - if ( $ex_tax ) { - if ( $this->prices_include_tax ) { - $total_discount = (double) $this->cart_discount - (double) $this->cart_discount_tax; - } else { - $total_discount = (double) $this->cart_discount; - } - } else { - if ( $this->prices_include_tax ) { - $total_discount = (double) $this->cart_discount; - } else { - $total_discount = (double) $this->cart_discount + (double) $this->cart_discount_tax; - } - } - // New logic - totals are always stored exclusive of tax, tax total is stored in cart_discount_tax - } else { - if ( $ex_tax ) { - $total_discount = (double) $this->cart_discount; - } else { - $total_discount = (double) $this->cart_discount + (double) $this->cart_discount_tax; - } - } - return apply_filters( 'woocommerce_order_amount_total_discount', round( $total_discount, wc_get_rounding_precision() ), $this ); - } - - /** - * Gets the discount amount. - * @deprecated in favour of get_total_discount() since we now only have one discount type. - * @return float - */ - public function get_cart_discount() { - _deprecated_function( 'get_cart_discount', '2.3', 'get_total_discount' ); - return apply_filters( 'woocommerce_order_amount_cart_discount', $this->get_total_discount(), $this ); - } - - /** - * Get cart discount (formatted). - * - * @deprecated order (after tax) discounts removed in 2.3.0. - * @return string - */ - public function get_order_discount_to_display() { - _deprecated_function( 'get_order_discount_to_display', '2.3' ); - } - - /** - * Gets the total (order) discount amount - these are applied after tax. - * - * @deprecated order (after tax) discounts removed in 2.3.0. - * @return float - */ - public function get_order_discount() { - _deprecated_function( 'get_order_discount', '2.3' ); - return apply_filters( 'woocommerce_order_amount_order_discount', (double) $this->order_discount, $this ); - } - - /** - * Gets cart tax amount. - * - * @return float - */ - public function get_cart_tax() { - return apply_filters( 'woocommerce_order_amount_cart_tax', (double) $this->order_tax, $this ); - } - - /** - * Gets shipping tax amount. - * - * @return float - */ - public function get_shipping_tax() { - return apply_filters( 'woocommerce_order_amount_shipping_tax', (double) $this->order_shipping_tax, $this ); - } - - /** - * Gets shipping and product tax. - * - * @return float - */ - public function get_total_tax() { - return apply_filters( 'woocommerce_order_amount_total_tax', wc_round_tax_total( $this->get_cart_tax() + $this->get_shipping_tax() ), $this ); - } - - /** - * Gets shipping total. - * - * @return float - */ - public function get_total_shipping() { - return apply_filters( 'woocommerce_order_amount_total_shipping', (double) $this->order_shipping, $this ); - } - - /** - * Gets order total. - * - * @return float - */ - public function get_total() { - return apply_filters( 'woocommerce_order_amount_total', (double) $this->order_total, $this ); - } - - /** - * Gets order subtotal. - * - * @return mixed|void - */ - public function get_subtotal() { - $subtotal = 0; - - foreach ( $this->get_items() as $item ) { - $subtotal += ( isset( $item['line_subtotal'] ) ) ? $item['line_subtotal'] : 0; - } - - return apply_filters( 'woocommerce_order_amount_subtotal', (double) $subtotal, $this ); - } - /** * Get item subtotal - this is the cost before discount. * - * @param mixed $item + * @param object $item * @param bool $inc_tax (default: false). * @param bool $round (default: true). * @return float */ public function get_item_subtotal( $item, $inc_tax = false, $round = true ) { - if ( $inc_tax ) { - $price = ( $item['line_subtotal'] + $item['line_subtotal_tax'] ) / max( 1, $item['qty'] ); - } else { - $price = ( $item['line_subtotal'] / max( 1, $item['qty'] ) ); + $subtotal = 0; + + if ( is_callable( array( $item, 'get_subtotal' ) ) ) { + if ( $inc_tax ) { + $subtotal = ( $item->get_subtotal() + $item->get_subtotal_tax() ) / max( 1, $item->get_qty() ); + } else { + $subtotal = ( $item->get_subtotal() / max( 1, $item->get_qty() ) ); + } + + $subtotal = $round ? number_format( (float) $subtotal, wc_get_price_decimals(), '.', '' ) : $subtotal; } - $price = $round ? number_format( (float) $price, wc_get_price_decimals(), '.', '' ) : $price; - - return apply_filters( 'woocommerce_order_amount_item_subtotal', $price, $this, $item, $inc_tax, $round ); + return apply_filters( 'woocommerce_order_amount_item_subtotal', $subtotal, $this, $item, $inc_tax, $round ); } /** * Get line subtotal - this is the cost before discount. * - * @param mixed $item + * @param object $item * @param bool $inc_tax (default: false). * @param bool $round (default: true). * @return float */ public function get_line_subtotal( $item, $inc_tax = false, $round = true ) { - if ( $inc_tax ) { - $price = $item['line_subtotal'] + $item['line_subtotal_tax']; - } else { - $price = $item['line_subtotal']; + $subtotal = 0; + + if ( is_callable( array( $item, 'get_subtotal' ) ) ) { + if ( $inc_tax ) { + $subtotal = $item->get_subtotal() + $item->get_subtotal_tax(); + } else { + $subtotal = $item->get_subtotal(); + } + + $subtotal = $round ? round( $subtotal, wc_get_price_decimals() ) : $subtotal; } - $price = $round ? round( $price, wc_get_price_decimals() ) : $price; - - return apply_filters( 'woocommerce_order_amount_line_subtotal', $price, $this, $item, $inc_tax, $round ); + return apply_filters( 'woocommerce_order_amount_line_subtotal', $subtotal, $this, $item, $inc_tax, $round ); } /** * Calculate item cost - useful for gateways. * - * @param mixed $item + * @param object $item * @param bool $inc_tax (default: false). * @param bool $round (default: true). * @return float */ public function get_item_total( $item, $inc_tax = false, $round = true ) { + $total = 0; - $qty = ( ! empty( $item['qty'] ) ) ? $item['qty'] : 1; + if ( is_callable( array( $item, 'get_total' ) ) ) { + if ( $inc_tax ) { + $total = ( $item->get_total() + $item->get_total_tax() ) / max( 1, $item->get_qty() ); + } else { + $total = $item->get_total() / max( 1, $item->get_qty() ); + } - if ( $inc_tax ) { - $price = ( $item['line_total'] + $item['line_tax'] ) / max( 1, $qty ); - } else { - $price = $item['line_total'] / max( 1, $qty ); + $total = $round ? round( $total, wc_get_price_decimals() ) : $total; } - $price = $round ? round( $price, wc_get_price_decimals() ) : $price; - - return apply_filters( 'woocommerce_order_amount_item_total', $price, $this, $item, $inc_tax, $round ); + return apply_filters( 'woocommerce_order_amount_item_total', $total, $this, $item, $inc_tax, $round ); } /** * Calculate line total - useful for gateways. * - * @param mixed $item + * @param object $item * @param bool $inc_tax (default: false). * @param bool $round (default: true). * @return float */ public function get_line_total( $item, $inc_tax = false, $round = true ) { + $total = 0; - // Check if we need to add line tax to the line total. - $line_total = $inc_tax ? $item['line_total'] + $item['line_tax'] : $item['line_total']; + if ( is_callable( array( $item, 'get_total' ) ) ) { + // Check if we need to add line tax to the line total. + $total = $inc_tax ? $item->get_total() + $item->get_total_tax() : $item->get_total(); - // Check if we need to round. - $line_total = $round ? round( $line_total, wc_get_price_decimals() ) : $line_total; + // Check if we need to round. + $total = $round ? round( $total, wc_get_price_decimals() ) : $total; + } - return apply_filters( 'woocommerce_order_amount_line_total', $line_total, $this, $item, $inc_tax, $round ); + return apply_filters( 'woocommerce_order_amount_line_total', $total, $this, $item, $inc_tax, $round ); } /** - * Calculate item tax - useful for gateways. + * Get item tax - useful for gateways. * * @param mixed $item * @param bool $round (default: true). * @return float */ public function get_item_tax( $item, $round = true ) { + $tax = 0; - $price = $item['line_tax'] / max( 1, $item['qty'] ); - $price = $round ? wc_round_tax_total( $price ) : $price; + if ( is_callable( array( $item, 'get_total_tax' ) ) ) { + $tax = $item->get_total_tax() / max( 1, $item->get_qty() ); + $tax = $round ? wc_round_tax_total( $tax ) : $tax; + } - return apply_filters( 'woocommerce_order_amount_item_tax', $price, $item, $round, $this ); + return apply_filters( 'woocommerce_order_amount_item_tax', $tax, $item, $round, $this ); } /** - * Calculate line tax - useful for gateways. + * Get line tax - useful for gateways. * * @param mixed $item * @return float */ public function get_line_tax( $item ) { - return apply_filters( 'woocommerce_order_amount_line_tax', wc_round_tax_total( $item['line_tax'] ), $item, $this ); - } - - /** End Total Getters *******************************************************/ - - /** - * Gets formatted shipping method title. - * - * @return string - */ - public function get_shipping_method() { - - $labels = array(); - - // Backwards compat < 2.1 - get shipping title stored in meta. - if ( $this->shipping_method_title ) { - $labels[] = $this->shipping_method_title; - } else { - - // 2.1+ get line items for shipping. - $shipping_methods = $this->get_shipping_methods(); - - foreach ( $shipping_methods as $shipping ) { - $labels[] = $shipping['name'] ? $shipping['name'] : __( 'Shipping', 'woocommerce' ); - } - } - - return apply_filters( 'woocommerce_order_shipping_method', implode( ', ', $labels ), $this ); + return apply_filters( 'woocommerce_order_amount_line_tax', is_callable( array( $item, 'get_total_tax' ) ) ? wc_round_tax_total( $item->get_total_tax() ) : 0, $item, $this ); } /** @@ -1720,42 +1439,25 @@ abstract class WC_Abstract_Order { * @return string */ public function get_formatted_line_subtotal( $item, $tax_display = '' ) { - - if ( ! $tax_display ) { - $tax_display = $this->tax_display_cart; - } - - if ( ! isset( $item['line_subtotal'] ) || ! isset( $item['line_subtotal_tax'] ) ) { - return ''; - } + $tax_display = $tax_display ? $tax_display : get_option( 'woocommerce_tax_display_cart' ); if ( 'excl' == $tax_display ) { - $ex_tax_label = $this->prices_include_tax ? 1 : 0; + $ex_tax_label = $this->get_prices_include_tax() ? 1 : 0; - $subtotal = wc_price( $this->get_line_subtotal( $item ), array( 'ex_tax_label' => $ex_tax_label, 'currency' => $this->get_order_currency() ) ); + $subtotal = wc_price( $this->get_line_subtotal( $item ), array( 'ex_tax_label' => $ex_tax_label, 'currency' => $this->get_currency() ) ); } else { - $subtotal = wc_price( $this->get_line_subtotal( $item, true ), array('currency' => $this->get_order_currency()) ); + $subtotal = wc_price( $this->get_line_subtotal( $item, true ), array('currency' => $this->get_currency()) ); } return apply_filters( 'woocommerce_order_formatted_line_subtotal', $subtotal, $item, $this ); } - /** - * Gets order currency. - * - * @return string - */ - public function get_order_currency() { - return apply_filters( 'woocommerce_get_order_currency', $this->order_currency, $this ); - } - /** * Gets order total - formatted for display. - * * @return string */ public function get_formatted_order_total() { - $formatted_total = wc_price( $this->get_total(), array( 'currency' => $this->get_order_currency() ) ); + $formatted_total = wc_price( $this->get_total(), array( 'currency' => $this->get_currency() ) ); return apply_filters( 'woocommerce_get_formatted_order_total', $formatted_total, $this ); } @@ -1767,96 +1469,77 @@ abstract class WC_Abstract_Order { * @return string */ public function get_subtotal_to_display( $compound = false, $tax_display = '' ) { - - if ( ! $tax_display ) { - $tax_display = $this->tax_display_cart; - } - - $subtotal = 0; + $tax_display = $tax_display ? $tax_display : get_option( 'woocommerce_tax_display_cart' ); + $subtotal = 0; if ( ! $compound ) { foreach ( $this->get_items() as $item ) { + $subtotal += $item->get_subtotal(); - if ( ! isset( $item['line_subtotal'] ) || ! isset( $item['line_subtotal_tax'] ) ) { - return ''; - } - - $subtotal += $item['line_subtotal']; - - if ( 'incl' == $tax_display ) { - $subtotal += $item['line_subtotal_tax']; + if ( 'incl' === $tax_display ) { + $subtotal += $item->get_subtotal_tax(); } } - $subtotal = wc_price( $subtotal, array('currency' => $this->get_order_currency()) ); + $subtotal = wc_price( $subtotal, array( 'currency' => $this->get_currency() ) ); - if ( $tax_display == 'excl' && $this->prices_include_tax ) { + if ( 'excl' === $tax_display && $this->get_prices_include_tax() ) { $subtotal .= ' ' . WC()->countries->ex_tax_or_vat() . ''; } } else { - - if ( 'incl' == $tax_display ) { + if ( 'incl' === $tax_display ) { return ''; } foreach ( $this->get_items() as $item ) { - - $subtotal += $item['line_subtotal']; - + $subtotal += $item->get_subtotal(); } // Add Shipping Costs. - $subtotal += $this->get_total_shipping(); + $subtotal += $this->get_shipping_total(); // Remove non-compound taxes. foreach ( $this->get_taxes() as $tax ) { - - if ( ! empty( $tax['compound'] ) ) { + if ( $this->is_compound() ) { continue; } - - $subtotal = $subtotal + $tax['tax_amount'] + $tax['shipping_tax_amount']; - + $subtotal = $subtotal + $tax->get_tax_total() + $tax->get_shipping_tax_total(); } // Remove discounts. $subtotal = $subtotal - $this->get_total_discount(); - - $subtotal = wc_price( $subtotal, array('currency' => $this->get_order_currency()) ); + $subtotal = wc_price( $subtotal, array( 'currency' => $this->get_currency() ) ); } return apply_filters( 'woocommerce_order_subtotal_to_display', $subtotal, $compound, $this ); } - /** * Gets shipping (formatted). * * @return string */ public function get_shipping_to_display( $tax_display = '' ) { - if ( ! $tax_display ) { - $tax_display = $this->tax_display_cart; - } + $tax_display = $tax_display ? $tax_display : get_option( 'woocommerce_tax_display_cart' ); - if ( $this->order_shipping != 0 ) { + if ( $this->get_shipping_total() != 0 ) { if ( $tax_display == 'excl' ) { // Show shipping excluding tax. - $shipping = wc_price( $this->order_shipping, array('currency' => $this->get_order_currency()) ); + $shipping = wc_price( $this->get_shipping_total(), array('currency' => $this->get_currency()) ); - if ( $this->order_shipping_tax != 0 && $this->prices_include_tax ) { + if ( $this->get_shipping_tax() != 0 && $this->get_prices_include_tax() ) { $shipping .= apply_filters( 'woocommerce_order_shipping_to_display_tax_label', ' ' . WC()->countries->ex_tax_or_vat() . '', $this, $tax_display ); } } else { // Show shipping including tax. - $shipping = wc_price( $this->order_shipping + $this->order_shipping_tax, array('currency' => $this->get_order_currency()) ); + $shipping = wc_price( $this->get_shipping_total() + $this->get_shipping_tax(), array('currency' => $this->get_currency()) ); - if ( $this->order_shipping_tax != 0 && ! $this->prices_include_tax ) { + if ( $this->get_shipping_tax() != 0 && ! $this->get_prices_include_tax() ) { $shipping .= apply_filters( 'woocommerce_order_shipping_to_display_tax_label', ' ' . WC()->countries->inc_tax_or_vat() . '', $this, $tax_display ); } @@ -1879,42 +1562,10 @@ abstract class WC_Abstract_Order { * @return string */ public function get_discount_to_display( $tax_display = '' ) { - if ( ! $tax_display ) { - $tax_display = $this->tax_display_cart; - } - return apply_filters( 'woocommerce_order_discount_to_display', wc_price( $this->get_total_discount( $tax_display === 'excl' && $this->display_totals_ex_tax ), array( 'currency' => $this->get_order_currency() ) ), $this ); + $tax_display = $tax_display ? $tax_display : get_option( 'woocommerce_tax_display_cart' ); + return apply_filters( 'woocommerce_order_discount_to_display', wc_price( $this->get_total_discount( 'excl' === $tax_display && 'excl' === get_option( 'woocommerce_tax_display_cart' ) ), array( 'currency' => $this->get_currency() ) ), $this ); } - /** - * Get cart discount (formatted). - * @deprecated - * @return string - */ - public function get_cart_discount_to_display( $tax_display = '' ) { - _deprecated_function( 'get_cart_discount_to_display', '2.3', 'get_discount_to_display' ); - return apply_filters( 'woocommerce_order_cart_discount_to_display', $this->get_discount_to_display( $tax_display ), $this ); - } - - /** - * Get a product (either product or variation). - * - * @param mixed $item - * @return WC_Product - */ - public function get_product_from_item( $item ) { - - if ( ! empty( $item['variation_id'] ) && 'product_variation' === get_post_type( $item['variation_id'] ) ) { - $_product = wc_get_product( $item['variation_id'] ); - } elseif ( ! empty( $item['product_id'] ) ) { - $_product = wc_get_product( $item['product_id'] ); - } else { - $_product = false; - } - - return apply_filters( 'woocommerce_get_product_from_item', $_product, $item, $this ); - } - - /** * Get totals for display on pages and in emails. * @@ -1922,55 +1573,39 @@ abstract class WC_Abstract_Order { * @return array */ public function get_order_item_totals( $tax_display = '' ) { - - if ( ! $tax_display ) { - $tax_display = $this->tax_display_cart; - } - - $total_rows = array(); + $tax_display = $tax_display ? $tax_display : get_option( 'woocommerce_tax_display_cart' ); + $total_rows = array(); if ( $subtotal = $this->get_subtotal_to_display( false, $tax_display ) ) { $total_rows['cart_subtotal'] = array( 'label' => __( 'Subtotal:', 'woocommerce' ), - 'value' => $subtotal + 'value' => $subtotal, ); } if ( $this->get_total_discount() > 0 ) { $total_rows['discount'] = array( 'label' => __( 'Discount:', 'woocommerce' ), - 'value' => '-' . $this->get_discount_to_display( $tax_display ) + 'value' => '-' . $this->get_discount_to_display( $tax_display ), ); } if ( $this->get_shipping_method() ) { $total_rows['shipping'] = array( 'label' => __( 'Shipping:', 'woocommerce' ), - 'value' => $this->get_shipping_to_display( $tax_display ) + 'value' => $this->get_shipping_to_display( $tax_display ), ); } if ( $fees = $this->get_fees() ) { foreach ( $fees as $id => $fee ) { - - if ( apply_filters( 'woocommerce_get_order_item_totals_excl_free_fees', $fee['line_total'] + $fee['line_tax'] == 0, $id ) ) { + if ( apply_filters( 'woocommerce_get_order_item_totals_excl_free_fees', empty( $fee['line_total'] ) && empty( $fee['line_tax'] ), $id ) ) { continue; } - - if ( 'excl' == $tax_display ) { - - $total_rows[ 'fee_' . $id ] = array( - 'label' => ( $fee['name'] ? $fee['name'] : __( 'Fee', 'woocommerce' ) ) . ':', - 'value' => wc_price( $fee['line_total'], array('currency' => $this->get_order_currency()) ) - ); - - } else { - - $total_rows[ 'fee_' . $id ] = array( - 'label' => $fee['name'] . ':', - 'value' => wc_price( $fee['line_total'] + $fee['line_tax'], array('currency' => $this->get_order_currency()) ) - ); - } + $total_rows[ 'fee_' . $fee->get_id() ] = array( + 'label' => $fee->get_name() . ':', + 'value' => wc_price( 'excl' === $tax_display ? $fee->get_total() : $fee->get_total() + $fee->get_total_tax(), array('currency' => $this->get_currency()) ) + ); } } @@ -1983,7 +1618,7 @@ abstract class WC_Abstract_Order { $total_rows[ sanitize_title( $code ) ] = array( 'label' => $tax->label . ':', - 'value' => $tax->formatted_amount + 'value' => $tax->formatted_amount, ); } @@ -1991,15 +1626,15 @@ abstract class WC_Abstract_Order { $total_rows['tax'] = array( 'label' => WC()->countries->tax_or_vat() . ':', - 'value' => wc_price( $this->get_total_tax(), array( 'currency' => $this->get_order_currency() ) ) + 'value' => wc_price( $this->get_total_tax(), array( 'currency' => $this->get_currency() ) ), ); } } - if ( $this->get_total() > 0 && $this->payment_method_title ) { + if ( $this->get_total() > 0 && $this->get_payment_method_title() ) { $total_rows['payment_method'] = array( 'label' => __( 'Payment Method:', 'woocommerce' ), - 'value' => $this->payment_method_title + 'value' => $this->get_payment_method_title(), ); } @@ -2007,97 +1642,62 @@ abstract class WC_Abstract_Order { foreach ( $refunds as $id => $refund ) { $total_rows[ 'refund_' . $id ] = array( 'label' => $refund->get_refund_reason() ? $refund->get_refund_reason() : __( 'Refund', 'woocommerce' ) . ':', - 'value' => wc_price( '-' . $refund->get_refund_amount(), array( 'currency' => $this->get_order_currency() ) ) + 'value' => wc_price( '-' . $refund->get_refund_amount(), array( 'currency' => $this->get_currency() ) ), ); } } $total_rows['order_total'] = array( 'label' => __( 'Total:', 'woocommerce' ), - 'value' => $this->get_formatted_order_total( $tax_display ) + 'value' => $this->get_formatted_order_total( $tax_display ), ); return apply_filters( 'woocommerce_get_order_item_totals', $total_rows, $this ); } + /* + |-------------------------------------------------------------------------- + | Conditionals + |-------------------------------------------------------------------------- + | + | Checks if a condition is true or false. + | + */ /** - * Output items for display in html emails. - * - * @param array $args Items args. - * @param null $deprecated1 Deprecated arg. - * @param null $deprecated2 Deprecated arg. - * @param null $deprecated3 Deprecated arg. - * @param null $deprecated4 Deprecated arg. - * @param null $deprecated5 Deprecated arg. - * @return string - */ - public function email_order_items_table( $args = array(), $deprecated1 = null, $deprecated2 = null, $deprecated3 = null, $deprecated4 = null, $deprecated5 = null ) { - ob_start(); - - if ( ! is_null( $deprecated1 ) || ! is_null( $deprecated2 ) || ! is_null( $deprecated3 ) || ! is_null( $deprecated4 ) || ! is_null( $deprecated5 ) ) { - _deprecated_argument( __FUNCTION__, '2.5.0' ); - } - - $defaults = array( - 'show_sku' => false, - 'show_image' => false, - 'image_size' => array( 32, 32 ), - 'plain_text' => false, - 'sent_to_admin' => false - ); - - $args = wp_parse_args( $args, $defaults ); - $template = $args['plain_text'] ? 'emails/plain/email-order-items.php' : 'emails/email-order-items.php'; - - wc_get_template( $template, apply_filters( 'woocommerce_email_order_items_args', array( - 'order' => $this, - 'items' => $this->get_items(), - 'show_download_links' => $this->is_download_permitted() && ! $args['sent_to_admin'], - 'show_sku' => $args['show_sku'], - 'show_purchase_note' => $this->is_paid() && ! $args['sent_to_admin'], - 'show_image' => $args['show_image'], - 'image_size' => $args['image_size'], - 'plain_text' => $args['plain_text'], - 'sent_to_admin' => $args['sent_to_admin'] - ) ) ); - - return apply_filters( 'woocommerce_email_order_items_table', ob_get_clean(), $this ); - } - - /** - * Returns if an order has been paid for based on the order status. - * @since 2.5.0 - * @return bool - */ - public function is_paid() { - return apply_filters( 'woocommerce_order_is_paid', $this->has_status( apply_filters( 'woocommerce_order_is_paid_statuses', array( 'processing', 'completed' ) ) ), $this ); - } - - /** - * Checks if product download is permitted. + * Checks the order status against a passed in status. * * @return bool */ - public function is_download_permitted() { - return apply_filters( 'woocommerce_order_is_download_permitted', $this->has_status( 'completed' ) || ( get_option( 'woocommerce_downloads_grant_access_after_payment' ) == 'yes' && $this->has_status( 'processing' ) ), $this ); + public function has_status( $status ) { + return apply_filters( 'woocommerce_order_has_status', ( is_array( $status ) && in_array( $this->get_status(), $status ) ) || $this->get_status() === $status ? true : false, $this, $status ); } /** - * Returns true if the order contains a downloadable product. + * Check whether this order has a specific shipping method or not. + * + * @param string $method_id * @return bool */ - public function has_downloadable_item() { - foreach ( $this->get_items() as $item ) { - $_product = $this->get_product_from_item( $item ); - - if ( $_product && $_product->exists() && $_product->is_downloadable() && $_product->has_file() ) { + public function has_shipping_method( $method_id ) { + foreach ( $this->get_shipping_methods() as $shipping_method ) { + if ( $shipping_method->get_method_id() === $method_id ) { return true; } } return false; } + /** + * Check if an order key is valid. + * + * @param mixed $key + * @return bool + */ + public function key_is_valid( $key ) { + return $key === $this->get_order_key(); + } + /** * Returns true if the order contains a free product. * @since 2.5.0 @@ -2105,661 +1705,10 @@ abstract class WC_Abstract_Order { */ public function has_free_item() { foreach ( $this->get_items() as $item ) { - if ( ! $item['line_total'] ) { + if ( ! $item->get_total() ) { return true; } } return false; } - - /** - * Generates a URL so that a customer can pay for their (unpaid - pending) order. Pass 'true' for the checkout version which doesn't offer gateway choices. - * - * @param bool $on_checkout - * @return string - */ - public function get_checkout_payment_url( $on_checkout = false ) { - - $pay_url = wc_get_endpoint_url( 'order-pay', $this->id, wc_get_page_permalink( 'checkout' ) ); - - if ( 'yes' == get_option( 'woocommerce_force_ssl_checkout' ) || is_ssl() ) { - $pay_url = str_replace( 'http:', 'https:', $pay_url ); - } - - if ( $on_checkout ) { - $pay_url = add_query_arg( 'key', $this->order_key, $pay_url ); - } else { - $pay_url = add_query_arg( array( 'pay_for_order' => 'true', 'key' => $this->order_key ), $pay_url ); - } - - return apply_filters( 'woocommerce_get_checkout_payment_url', $pay_url, $this ); - } - - /** - * Generates a URL for the thanks page (order received). - * - * @return string - */ - public function get_checkout_order_received_url() { - - $order_received_url = wc_get_endpoint_url( 'order-received', $this->id, wc_get_page_permalink( 'checkout' ) ); - - if ( 'yes' == get_option( 'woocommerce_force_ssl_checkout' ) || is_ssl() ) { - $order_received_url = str_replace( 'http:', 'https:', $order_received_url ); - } - - $order_received_url = add_query_arg( 'key', $this->order_key, $order_received_url ); - - return apply_filters( 'woocommerce_get_checkout_order_received_url', $order_received_url, $this ); - } - - /** - * Generates a URL so that a customer can cancel their (unpaid - pending) order. - * - * @param string $redirect - * - * @return string - */ - public function get_cancel_order_url( $redirect = '' ) { - - // Get cancel endpoint - $cancel_endpoint = $this->get_cancel_endpoint(); - - return apply_filters( 'woocommerce_get_cancel_order_url', esc_url( add_query_arg( array( - 'cancel_order' => 'true', - 'order' => $this->order_key, - 'order_id' => $this->id, - 'redirect' => $redirect, - ), $cancel_endpoint ) ) ); - } - - /** - * Generates a raw (unescaped) cancel-order URL for use by payment gateways. - * - * @param string $redirect - * @return string The unescaped cancel-order URL. - */ - public function get_cancel_order_url_raw( $redirect = '' ) { - - // Get cancel endpoint - $cancel_endpoint = $this->get_cancel_endpoint(); - - return apply_filters( 'woocommerce_get_cancel_order_url_raw', add_query_arg( array( - 'cancel_order' => 'true', - 'order' => $this->order_key, - 'order_id' => $this->id, - 'redirect' => $redirect, - ), $cancel_endpoint ) ); - } - - - /** - * Helper method to return the cancel endpoint. - * - * @return string the cancel endpoint; either the cart page or the home page. - */ - public function get_cancel_endpoint() { - - $cancel_endpoint = wc_get_page_permalink( 'cart' ); - if ( ! $cancel_endpoint ) { - $cancel_endpoint = home_url(); - } - - if ( false === strpos( $cancel_endpoint, '?' ) ) { - $cancel_endpoint = trailingslashit( $cancel_endpoint ); - } - - return $cancel_endpoint; - } - - - /** - * Generates a URL to view an order from the my account page. - * - * @return string - */ - public function get_view_order_url() { - - $view_order_url = wc_get_endpoint_url( 'view-order', $this->id, wc_get_page_permalink( 'myaccount' ) ); - - return apply_filters( 'woocommerce_get_view_order_url', $view_order_url, $this ); - } - - /** - * Get the downloadable files for an item in this order. - * - * @param array $item - * @return array - */ - public function get_item_downloads( $item ) { - global $wpdb; - - $product_id = $item['variation_id'] > 0 ? $item['variation_id'] : $item['product_id']; - $product = wc_get_product( $product_id ); - if ( ! $product ) { - /** - * $product can be `false`. Example: checking an old order, when a product or variation has been deleted. - * @see \WC_Product_Factory::get_product - */ - return array(); - } - $download_ids = $wpdb->get_col( $wpdb->prepare(" - SELECT download_id - FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions - WHERE user_email = %s - AND order_key = %s - AND product_id = %s - ORDER BY permission_id - ", $this->billing_email, $this->order_key, $product_id ) ); - - $files = array(); - - foreach ( $download_ids as $download_id ) { - - if ( $product->has_file( $download_id ) ) { - $files[ $download_id ] = $product->get_file( $download_id ); - $files[ $download_id ]['download_url'] = $this->get_download_url( $product_id, $download_id ); - } - } - - return apply_filters( 'woocommerce_get_item_downloads', $files, $item, $this ); - } - - /** - * Display download links for an order item. - * @param array $item - */ - public function display_item_downloads( $item ) { - $product = $this->get_product_from_item( $item ); - - if ( $product && $product->exists() && $product->is_downloadable() && $this->is_download_permitted() ) { - $download_files = $this->get_item_downloads( $item ); - $i = 0; - $links = array(); - - foreach ( $download_files as $download_id => $file ) { - $i++; - $prefix = count( $download_files ) > 1 ? sprintf( __( 'Download %d', 'woocommerce' ), $i ) : __( 'Download', 'woocommerce' ); - $links[] = '' . $prefix . ': ' . esc_html( $file['name'] ) . '' . "\n"; - } - - echo '
    ' . implode( '
    ', $links ); - } - } - - /** - * Get the Download URL. - * - * @param int $product_id - * @param int $download_id - * @return string - */ - public function get_download_url( $product_id, $download_id ) { - return add_query_arg( array( - 'download_file' => $product_id, - 'order' => $this->order_key, - 'email' => urlencode( $this->billing_email ), - 'key' => $download_id - ), trailingslashit( home_url() ) ); - } - - /** - * Adds a note (comment) to the order. - * - * @param string $note Note to add. - * @param int $is_customer_note (default: 0) Is this a note for the customer? - * @param bool added_by_user Was the note added by a user? - * @return int Comment ID. - */ - public function add_order_note( $note, $is_customer_note = 0, $added_by_user = false ) { - if ( is_user_logged_in() && current_user_can( 'edit_shop_order', $this->id ) && $added_by_user ) { - $user = get_user_by( 'id', get_current_user_id() ); - $comment_author = $user->display_name; - $comment_author_email = $user->user_email; - } else { - $comment_author = __( 'WooCommerce', 'woocommerce' ); - $comment_author_email = strtolower( __( 'WooCommerce', 'woocommerce' ) ) . '@'; - $comment_author_email .= isset( $_SERVER['HTTP_HOST'] ) ? str_replace( 'www.', '', $_SERVER['HTTP_HOST'] ) : 'noreply.com'; - $comment_author_email = sanitize_email( $comment_author_email ); - } - - $comment_post_ID = $this->id; - $comment_author_url = ''; - $comment_content = $note; - $comment_agent = 'WooCommerce'; - $comment_type = 'order_note'; - $comment_parent = 0; - $comment_approved = 1; - $commentdata = apply_filters( 'woocommerce_new_order_note_data', compact( 'comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_agent', 'comment_type', 'comment_parent', 'comment_approved' ), array( 'order_id' => $this->id, 'is_customer_note' => $is_customer_note ) ); - - $comment_id = wp_insert_comment( $commentdata ); - - if ( $is_customer_note ) { - add_comment_meta( $comment_id, 'is_customer_note', 1 ); - - do_action( 'woocommerce_new_customer_note', array( 'order_id' => $this->id, 'customer_note' => $commentdata['comment_content'] ) ); - } - - return $comment_id; - } - - /** - * Updates status of order. - * - * @param string $new_status Status to change the order to. No internal wc- prefix is required. - * @param string $note (default: '') Optional note to add. - * @param bool $manual is this a manual order status change? - * @return bool Successful change or not - */ - public function update_status( $new_status, $note = '', $manual = false ) { - if ( ! $this->id ) { - return false; - } - - // Standardise status names. - $new_status = 'wc-' === substr( $new_status, 0, 3 ) ? substr( $new_status, 3 ) : $new_status; - $old_status = $this->get_status(); - - // If the old status is unknown (e.g. draft) assume its pending for action usage. - if ( ! in_array( 'wc-' . $old_status, array_keys( wc_get_order_statuses() ) ) ) { - $old_status = 'pending'; - } - - // If the statuses are the same there is no need to update, unless the post status is not a valid 'wc' status. - if ( $new_status === $old_status && in_array( $this->post_status, array_keys( wc_get_order_statuses() ) ) ) { - return false; - } - - $this->post_status = 'wc-' . $new_status; - $update_post_data = array( - 'ID' => $this->id, - 'post_status' => $this->post_status, - ); - - if ( 'pending' === $old_status && ! $manual ) { - $update_post_data[ 'post_date' ] = current_time( 'mysql', 0 ); - $update_post_data[ 'post_date_gmt' ] = current_time( 'mysql', 1 ); - } - - if ( ! wp_update_post( $update_post_data ) ) { - $this->add_order_note( sprintf( __( 'Unable to update order from %1$s to %2$s.', 'woocommerce' ), wc_get_order_status_name( $old_status ), wc_get_order_status_name( $new_status ) ), 0, $manual ); - return false; - } - - // Status was set. - do_action( 'woocommerce_order_status_' . $new_status, $this->id ); - - // Status was changed. - if ( $new_status !== $old_status ) { - $this->add_order_note( trim( $note . ' ' . sprintf( __( 'Order status changed from %1$s to %2$s.', 'woocommerce' ), wc_get_order_status_name( $old_status ), wc_get_order_status_name( $new_status ) ) ), 0, $manual ); - do_action( 'woocommerce_order_status_' . $old_status . '_to_' . $new_status, $this->id ); - do_action( 'woocommerce_order_status_changed', $this->id, $old_status, $new_status ); - } else { - $this->add_order_note( trim( $note . ' ' . sprintf( __( 'Order status changed to %s.', 'woocommerce' ), wc_get_order_status_name( $new_status ) ) ), 0, $manual ); - } - - switch ( $new_status ) { - - case 'completed' : - // Record the sales. - $this->record_product_sales(); - - // Increase coupon usage counts. - $this->increase_coupon_usage_counts(); - - // Record the completed date of the order. - update_post_meta( $this->id, '_completed_date', current_time('mysql') ); - - // Update reports. - wc_delete_shop_order_transients( $this->id ); - break; - - case 'processing' : - case 'on-hold' : - // Record the sales. - $this->record_product_sales(); - - // Increase coupon usage counts. - $this->increase_coupon_usage_counts(); - - // Update reports. - wc_delete_shop_order_transients( $this->id ); - break; - - case 'cancelled' : - // If the order is cancelled, restore used coupons. - $this->decrease_coupon_usage_counts(); - - // Update reports. - wc_delete_shop_order_transients( $this->id ); - break; - } - - return true; - } - - - /** - * Cancel the order and restore the cart (before payment). - * - * @param string $note (default: '') Optional note to add. - */ - public function cancel_order( $note = '' ) { - WC()->session->set( 'order_awaiting_payment', false ); - $this->update_status( 'cancelled', $note ); - } - - /** - * When a payment is complete this function is called. - * - * Most of the time this should mark an order as 'processing' so that admin can process/post the items. - * If the cart contains only downloadable items then the order is 'completed' since the admin needs to take no action. - * Stock levels are reduced at this point. - * Sales are also recorded for products. - * Finally, record the date of payment. - * - * @param string $transaction_id Optional transaction id to store in post meta. - */ - public function payment_complete( $transaction_id = '' ) { - do_action( 'woocommerce_pre_payment_complete', $this->id ); - - if ( null !== WC()->session ) { - WC()->session->set( 'order_awaiting_payment', false ); - } - - $valid_order_statuses = apply_filters( 'woocommerce_valid_order_statuses_for_payment_complete', array( 'on-hold', 'pending', 'failed', 'cancelled' ), $this ); - - if ( $this->id && $this->has_status( $valid_order_statuses ) ) { - $order_needs_processing = false; - - if ( sizeof( $this->get_items() ) > 0 ) { - foreach ( $this->get_items() as $item ) { - if ( $_product = $this->get_product_from_item( $item ) ) { - $virtual_downloadable_item = $_product->is_downloadable() && $_product->is_virtual(); - - if ( apply_filters( 'woocommerce_order_item_needs_processing', ! $virtual_downloadable_item, $_product, $this->id ) ) { - $order_needs_processing = true; - break; - } - } else { - $order_needs_processing = true; - break; - } - } - } - - $this->update_status( apply_filters( 'woocommerce_payment_complete_order_status', $order_needs_processing ? 'processing' : 'completed', $this->id ) ); - - add_post_meta( $this->id, '_paid_date', current_time( 'mysql' ), true ); - - if ( ! empty( $transaction_id ) ) { - update_post_meta( $this->id, '_transaction_id', $transaction_id ); - } - - // Payment is complete so reduce stock levels - if ( apply_filters( 'woocommerce_payment_complete_reduce_order_stock', ! get_post_meta( $this->id, '_order_stock_reduced', true ), $this->id ) ) { - $this->reduce_order_stock(); - } - - do_action( 'woocommerce_payment_complete', $this->id ); - } else { - do_action( 'woocommerce_payment_complete_order_status_' . $this->get_status(), $this->id ); - } - } - - - /** - * Record sales. - */ - public function record_product_sales() { - if ( 'yes' === get_post_meta( $this->id, '_recorded_sales', true ) ) { - return; - } - - if ( sizeof( $this->get_items() ) > 0 ) { - - foreach ( $this->get_items() as $item ) { - - if ( $item['product_id'] > 0 ) { - $sales = (int) get_post_meta( $item['product_id'], 'total_sales', true ); - $sales += (int) $item['qty']; - - if ( $sales ) { - update_post_meta( $item['product_id'], 'total_sales', $sales ); - } - } - } - } - - update_post_meta( $this->id, '_recorded_sales', 'yes' ); - - /** - * Called when sales for an order are recorded - * - * @param int $order_id order id - */ - do_action( 'woocommerce_recorded_sales', $this->id ); - } - - - /** - * Get coupon codes only. - * - * @return array - */ - public function get_used_coupons() { - - $codes = array(); - $coupons = $this->get_items( 'coupon' ); - - foreach ( $coupons as $item_id => $item ) { - $codes[] = trim( $item['name'] ); - } - - return $codes; - } - - - /** - * Increase applied coupon counts. - */ - public function increase_coupon_usage_counts() { - if ( 'yes' == get_post_meta( $this->id, '_recorded_coupon_usage_counts', true ) ) { - return; - } - - if ( sizeof( $this->get_used_coupons() ) > 0 ) { - - foreach ( $this->get_used_coupons() as $code ) { - if ( ! $code ) { - continue; - } - - $coupon = new WC_Coupon( $code ); - - $used_by = $this->get_user_id(); - - if ( ! $used_by ) { - $used_by = $this->billing_email; - } - - $coupon->inc_usage_count( $used_by ); - } - - update_post_meta( $this->id, '_recorded_coupon_usage_counts', 'yes' ); - } - } - - - /** - * Decrease applied coupon counts. - */ - public function decrease_coupon_usage_counts() { - - if ( 'yes' != get_post_meta( $this->id, '_recorded_coupon_usage_counts', true ) ) { - return; - } - - if ( sizeof( $this->get_used_coupons() ) > 0 ) { - - foreach ( $this->get_used_coupons() as $code ) { - - if ( ! $code ) { - continue; - } - - $coupon = new WC_Coupon( $code ); - - $used_by = $this->get_user_id(); - if ( ! $used_by ) { - $used_by = $this->billing_email; - } - - $coupon->dcr_usage_count( $used_by ); - } - - delete_post_meta( $this->id, '_recorded_coupon_usage_counts' ); - } - } - - /** - * Reduce stock levels for all line items in the order. - * Runs if stock management is enabled, but can be disabled on per-order basis by extensions @since 2.4.0 via woocommerce_can_reduce_order_stock hook. - */ - public function reduce_order_stock() { - if ( 'yes' === get_option( 'woocommerce_manage_stock' ) && apply_filters( 'woocommerce_can_reduce_order_stock', true, $this ) && sizeof( $this->get_items() ) > 0 ) { - foreach ( $this->get_items() as $item ) { - if ( $item['product_id'] > 0 ) { - $_product = $this->get_product_from_item( $item ); - - if ( $_product && $_product->exists() && $_product->managing_stock() ) { - $qty = apply_filters( 'woocommerce_order_item_quantity', $item['qty'], $this, $item ); - $new_stock = $_product->reduce_stock( $qty ); - $item_name = $_product->get_sku() ? $_product->get_sku(): $item['product_id']; - - if ( isset( $item['variation_id'] ) && $item['variation_id'] ) { - $this->add_order_note( sprintf( __( 'Item %1$s variation #%2$s stock reduced from %3$s to %4$s.', 'woocommerce' ), $item_name, $item['variation_id'], $new_stock + $qty, $new_stock) ); - } else { - $this->add_order_note( sprintf( __( 'Item %1$s stock reduced from %2$s to %3$s.', 'woocommerce' ), $item_name, $new_stock + $qty, $new_stock) ); - } - $this->send_stock_notifications( $_product, $new_stock, $item['qty'] ); - } - } - } - - add_post_meta( $this->id, '_order_stock_reduced', '1', true ); - - do_action( 'woocommerce_reduce_order_stock', $this ); - } - } - - /** - * Send the stock notifications. - * - * @param WC_Product $product - * @param int $new_stock - * @param int $qty_ordered - */ - public function send_stock_notifications( $product, $new_stock, $qty_ordered ) { - - // Backorders - if ( $new_stock < 0 ) { - do_action( 'woocommerce_product_on_backorder', array( 'product' => $product, 'order_id' => $this->id, 'quantity' => $qty_ordered ) ); - } - - // stock status notifications - $notification_sent = false; - - if ( 'yes' == get_option( 'woocommerce_notify_no_stock' ) && get_option( 'woocommerce_notify_no_stock_amount' ) >= $new_stock ) { - do_action( 'woocommerce_no_stock', $product ); - $notification_sent = true; - } - - if ( ! $notification_sent && 'yes' == get_option( 'woocommerce_notify_low_stock' ) && get_option( 'woocommerce_notify_low_stock_amount' ) >= $new_stock ) { - do_action( 'woocommerce_low_stock', $product ); - } - - do_action( 'woocommerce_after_send_stock_notifications', $product, $new_stock, $qty_ordered ); - } - - - /** - * List order notes (public) for the customer. - * - * @return array - */ - public function get_customer_order_notes() { - $notes = array(); - $args = array( - 'post_id' => $this->id, - 'approve' => 'approve', - 'type' => '' - ); - - remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ) ); - - $comments = get_comments( $args ); - - foreach ( $comments as $comment ) { - if ( ! get_comment_meta( $comment->comment_ID, 'is_customer_note', true ) ) { - continue; - } - $comment->comment_content = make_clickable( $comment->comment_content ); - $notes[] = $comment; - } - - add_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ) ); - - return $notes; - } - - /** - * Checks if an order needs payment, based on status and order total. - * - * @return bool - */ - public function needs_payment() { - - $valid_order_statuses = apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $this ); - - if ( $this->has_status( $valid_order_statuses ) && $this->get_total() > 0 ) { - $needs_payment = true; - } else { - $needs_payment = false; - } - - return apply_filters( 'woocommerce_order_needs_payment', $needs_payment, $this, $valid_order_statuses ); - } - - /** - * Checks if an order needs display the shipping address, based on shipping method. - * - * @return boolean - */ - public function needs_shipping_address() { - if ( ! wc_shipping_enabled() ) { - return false; - } - - $hide = apply_filters( 'woocommerce_order_hide_shipping_address', array( 'local_pickup' ), $this ); - $needs_address = false; - - foreach ( $this->get_shipping_methods() as $shipping_method ) { - if ( ! in_array( $shipping_method['method_id'], $hide ) ) { - $needs_address = true; - break; - } - } - - return apply_filters( 'woocommerce_order_needs_shipping_address', $needs_address, $hide, $this ); - } - - /** - * Checks if an order can be edited, specifically for use on the Edit Order screen. - * - * @return bool - */ - public function is_editable() { - return apply_filters( 'wc_order_is_editable', in_array( $this->get_status(), array( 'pending', 'on-hold', 'auto-draft', 'failed' ) ), $this ); - } } diff --git a/includes/abstracts/abstract-wc-product.php b/includes/abstracts/abstract-wc-product.php index 2f2a478f324..ea0fa804b02 100644 --- a/includes/abstracts/abstract-wc-product.php +++ b/includes/abstracts/abstract-wc-product.php @@ -1429,7 +1429,7 @@ class WC_Product { * @return bool */ public function enable_dimensions_display() { - return apply_filters( 'wc_product_enable_dimensions_display', true ); + return apply_filters( 'wc_product_enable_dimensions_display', true ) && ( $this->has_dimensions() || $this->has_weight() ); } /** @@ -1441,6 +1441,15 @@ class WC_Product { return $this->get_dimensions() ? true : false; } + /** + * Does a child have dimensions set? + * @since 2.7.0 + * @return boolean + */ + public function child_has_dimensions() { + return false; + } + /** * Returns the product length. * @return string @@ -1483,6 +1492,15 @@ class WC_Product { return $this->get_weight() ? true : false; } + /** + * Does a child have a weight set? + * @since 2.7.0 + * @return boolean + */ + public function child_has_weight() { + return false; + } + /** * Returns formatted dimensions. * @return string @@ -1498,7 +1516,7 @@ class WC_Product { $dimensions .= ' ' . get_option( 'woocommerce_dimension_unit' ); } - return apply_filters( 'woocommerce_product_dimensions', $dimensions, $this ); + return apply_filters( 'woocommerce_product_dimensions', $dimensions, $this ); } /** diff --git a/includes/abstracts/abstract-wc-rest-shipping-zones-controller.php b/includes/abstracts/abstract-wc-rest-shipping-zones-controller.php new file mode 100644 index 00000000000..ea9f0d45f3c --- /dev/null +++ b/includes/abstracts/abstract-wc-rest-shipping-zones-controller.php @@ -0,0 +1,108 @@ + 404 ) ); + } + + return $zone; + } + + /** + * Check whether a given request has permission to read Shipping Zones. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|boolean + */ + public function get_items_permissions_check( $request ) { + if ( ! wc_shipping_enabled() ) { + return new WP_Error( 'rest_no_route', __( 'Shipping is disabled.', 'woocommerce' ), array( 'status' => 404 ) ); + } + + if ( ! wc_rest_check_manager_permissions( 'settings', 'read' ) ) { + return new WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); + } + + return true; + } + + /** + * Check if a given request has access to create Shipping Zones. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|boolean + */ + public function create_item_permissions_check( $request ) { + if ( ! wc_shipping_enabled() ) { + return new WP_Error( 'rest_no_route', __( 'Shipping is disabled.', 'woocommerce' ), array( 'status' => 404 ) ); + } + + if ( ! wc_rest_check_manager_permissions( 'settings', 'edit' ) ) { + return new WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you cannot create new resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); + } + + return true; + } + + /** + * Check whether a given request has permission to edit Shipping Zones. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|boolean + */ + public function update_items_permissions_check( $request ) { + if ( ! wc_shipping_enabled() ) { + return new WP_Error( 'rest_no_route', __( 'Shipping is disabled.', 'woocommerce' ), array( 'status' => 404 ) ); + } + + if ( ! wc_rest_check_manager_permissions( 'settings', 'edit' ) ) { + return new WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot update resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); + } + + return true; + } +} diff --git a/includes/admin/class-wc-admin-attributes.php b/includes/admin/class-wc-admin-attributes.php index 453de2c551b..3f589efa9d5 100644 --- a/includes/admin/class-wc-admin-attributes.php +++ b/includes/admin/class-wc-admin-attributes.php @@ -271,6 +271,7 @@ class WC_Admin_Attributes {
    + +
    @@ -309,7 +310,6 @@ class WC_Admin_Attributes {

    @@ -374,7 +375,6 @@ class WC_Admin_Attributes { if ( $attribute_taxonomies = wc_get_attribute_taxonomies() ) : foreach ( $attribute_taxonomies as $tax ) : ?> - attribute_label ); ?> @@ -440,6 +440,8 @@ class WC_Admin_Attributes {

    + +
    @@ -489,6 +491,8 @@ class WC_Admin_Attributes {

    + +

    diff --git a/includes/admin/class-wc-admin-permalink-settings.php b/includes/admin/class-wc-admin-permalink-settings.php index 01192eff1a4..8df1649d776 100644 --- a/includes/admin/class-wc-admin-permalink-settings.php +++ b/includes/admin/class-wc-admin-permalink-settings.php @@ -190,8 +190,8 @@ class WC_Admin_Permalink_Settings { } // This is an invalid base structure and breaks pages. - if ( '%product_cat%' == $product_permalink ) { - $product_permalink = '/' . _x( 'product', 'slug', 'woocommerce' ) . '/' . $product_permalink; + if ( '/%product_cat%' === $product_permalink ) { + $product_permalink = '/' . _x( 'product', 'slug', 'woocommerce' ) . $product_permalink; } } elseif ( empty( $product_permalink ) ) { $product_permalink = false; diff --git a/includes/admin/class-wc-admin-settings.php b/includes/admin/class-wc-admin-settings.php index e53ed09ea3e..d2c8bc3e516 100644 --- a/includes/admin/class-wc-admin-settings.php +++ b/includes/admin/class-wc-admin-settings.php @@ -697,7 +697,7 @@ class WC_Admin_Settings { // Format the value based on option type. switch ( $option['type'] ) { case 'checkbox' : - $value = in_array( $raw_value, array( 'yes', 'no' ) ) ? $raw_value : 'no'; + $value = '1' === $raw_value || 'yes' === $raw_value ? 'yes' : 'no'; break; case 'textarea' : $value = wp_kses_post( trim( $raw_value ) ); diff --git a/includes/admin/class-wc-admin-status.php b/includes/admin/class-wc-admin-status.php index db3050be3c3..82191147e07 100644 --- a/includes/admin/class-wc-admin-status.php +++ b/includes/admin/class-wc-admin-status.php @@ -205,7 +205,13 @@ class WC_Admin_Status { $viewed_log = current( $logs ); } - include_once( dirname( __FILE__ ) . '/views/html-admin-page-status-logs.php' ); + $handle = ! empty( $viewed_log ) ? self::get_log_file_handle( $viewed_log ) : ''; + + if ( ! empty( $_REQUEST[ 'handle' ] ) ) { + self::remove_log(); + } + + include_once( 'views/html-admin-page-status-logs.php' ); } /** @@ -240,6 +246,16 @@ class WC_Admin_Status { return $version ; } + /** + * Return the log file handle. + * + * @param string $filename + * @return string + */ + public static function get_log_file_handle( $filename ) { + return substr( $filename, 0, strlen( $filename ) > 37 ? strlen( $filename ) - 37 : strlen( $filename ) - 4 ); + } + /** * Scan the template files. * @param string $template_path @@ -342,4 +358,21 @@ class WC_Admin_Status { return $update_theme_version; } + + /** + * Remove/delete the chosen file. + */ + public static function remove_log() { + if ( empty( $_REQUEST[ '_wpnonce' ] ) || ! wp_verify_nonce( $_REQUEST[ '_wpnonce' ], 'remove_log' ) ) { + wp_die( __( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) ); + } + + if ( ! empty( $_REQUEST[ 'handle' ] ) ) { + $logger = new WC_Logger(); + $logger->remove( $_REQUEST[ 'handle' ] ); + } + + wp_safe_redirect( esc_url_raw( admin_url( 'admin.php?page=wc-status&tab=logs' ) ) ); + exit(); + } } diff --git a/includes/admin/reports/class-wc-admin-report.php b/includes/admin/reports/class-wc-admin-report.php index 6b0d76cb628..fdd705a30c6 100644 --- a/includes/admin/reports/class-wc-admin-report.php +++ b/includes/admin/reports/class-wc-admin-report.php @@ -242,14 +242,14 @@ class WC_Admin_Report { $key = is_array( $value['meta_key'] ) ? $value['meta_key'][0] . '_array' : $value['meta_key']; - if ( strtolower( $value['operator'] ) == 'in' ) { + if ( strtolower( $value['operator'] ) == 'in' || strtolower( $value['operator'] ) == 'not in' ) { if ( is_array( $value['meta_value'] ) ) { $value['meta_value'] = implode( "','", $value['meta_value'] ); } if ( ! empty( $value['meta_value'] ) ) { - $where_value = "IN ('{$value['meta_value']}')"; + $where_value = "{$value['operator']} ('{$value['meta_value']}')"; } } else { $where_value = "{$value['operator']} '{$value['meta_value']}'"; @@ -289,14 +289,14 @@ class WC_Admin_Report { foreach ( $where as $value ) { - if ( strtolower( $value['operator'] ) == 'in' ) { + if ( strtolower( $value['operator'] ) == 'in' || strtolower( $value['operator'] ) == 'not in' ) { if ( is_array( $value['value'] ) ) { $value['value'] = implode( "','", $value['value'] ); } if ( ! empty( $value['value'] ) ) { - $where_value = "IN ('{$value['value']}')"; + $where_value = "{$value['operator']} ('{$value['value']}')"; } } else { $where_value = "{$value['operator']} '{$value['value']}'"; diff --git a/includes/admin/settings/views/html-settings-tax.php b/includes/admin/settings/views/html-settings-tax.php index 98dc179287c..6bd29ac5351 100644 --- a/includes/admin/settings/views/html-settings-tax.php +++ b/includes/admin/settings/views/html-settings-tax.php @@ -12,10 +12,9 @@ if ( ! defined( 'ABSPATH' ) ) {

    - +
    - @@ -29,7 +28,7 @@ if ( ! defined( 'ABSPATH' ) ) { - - +
           
    + @@ -39,15 +38,13 @@ if ( ! defined( 'ABSPATH' ) ) {
    diff --git a/includes/admin/views/html-admin-page-status-logs.php b/includes/admin/views/html-admin-page-status-logs.php index 4f2ef9461e9..d48b16ca1fc 100644 --- a/includes/admin/views/html-admin-page-status-logs.php +++ b/includes/admin/views/html-admin-page-status-logs.php @@ -11,7 +11,12 @@ if ( ! defined( 'ABSPATH' ) ) {
    -

    +

    + + + + +

    @@ -26,7 +31,7 @@ if ( ! defined( 'ABSPATH' ) ) {
    - +

    diff --git a/includes/admin/views/html-admin-page-status-report.php b/includes/admin/views/html-admin-page-status-report.php index 20c88d6763e..ee651d4250e 100644 --- a/includes/admin/views/html-admin-page-status-report.php +++ b/includes/admin/views/html-admin-page-status-report.php @@ -6,8 +6,15 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } -global $wpdb; +global $wpdb; +$system_status = new WC_REST_System_Status_Controller; +$environment = $system_status->get_environment_info(); +$database = $system_status->get_database_info(); +$active_plugins = $system_status->get_active_plugins(); +$theme = $system_status->get_theme_info(); +$settings = $system_status->get_settings(); +$pages = $system_status->get_pages(); ?>

    @@ -29,54 +36,47 @@ global $wpdb; : - + : - + : - version ); ?> + : ' . WC_LOG_DIR . ' '; + if ( $environment['log_directory_writable'] ) { + echo ' ' . esc_html( $environment['log_directory'] ) . ' '; } else { - printf( ' ' . __( 'To allow logging, make %s writable or define a custom WC_LOG_DIR.', 'woocommerce' ) . '', WC_LOG_DIR ); + printf( ' ' . __( 'To allow logging, make %s writable or define a custom WC_LOG_DIR.', 'woocommerce' ) . '', $environment['log_directory'] ); } ?> : - + : - '; else echo '–'; ?> + '; else echo '–'; ?> : ' . sprintf( __( '%s - We recommend setting memory to at least 64MB. See: %s', 'woocommerce' ), size_format( $memory ), '' . __( 'Increasing memory allocated to PHP', 'woocommerce' ) . '' ) . ''; + if ( $environment['wp_memory_limit'] < 67108864 ) { + echo ' ' . sprintf( __( '%s - We recommend setting memory to at least 64MB. See: %s', 'woocommerce' ), size_format( $environment['wp_memory_limit'] ), '' . __( 'Increasing memory allocated to PHP', 'woocommerce' ) . '' ) . ''; } else { - echo '' . size_format( $memory ) . ''; + echo '' . size_format( $environment['wp_memory_limit'] ) . ''; } ?> @@ -84,7 +84,7 @@ global $wpdb; : - + @@ -95,17 +95,17 @@ global $wpdb; : - - - + + + : - + @@ -119,23 +119,16 @@ global $wpdb; : - + : ' . sprintf( __( '%s - We recommend a minimum PHP version of 5.6. See: %s', 'woocommerce' ), esc_html( $php_version ), '' . __( 'How to update your PHP version', 'woocommerce' ) . '' ) . ''; - } else { - echo '' . esc_html( $php_version ) . ''; - } + if ( version_compare( $environment['php_version'], '5.6', '<' ) ) { + echo ' ' . sprintf( __( '%s - We recommend a minimum PHP version of 5.6. See: %s', 'woocommerce' ), esc_html( $environment['php_version'] ), '' . __( 'How to update your PHP version', 'woocommerce' ) . '' ) . ''; } else { - _e( "Couldn't determine PHP version because phpversion() doesn't exist.", 'woocommerce' ); + echo '' . esc_html( $environment['php_version'] ) . ''; } ?> @@ -143,55 +136,44 @@ global $wpdb; : - + : - + : - + : - + : - ' : '–'; ?> + ' : '–'; ?> use_mysqli ) { $ver = mysqli_get_server_info( $wpdb->dbh ); } else { $ver = mysql_get_server_info(); } - if ( ! empty( $wpdb->is_mysql ) && ! stristr( $ver, 'MariaDB' ) ) : ?> : db_version(); - - if ( version_compare( $mysql_version, '5.6', '<' ) ) { - echo ' ' . sprintf( __( '%s - We recommend a minimum MySQL version of 5.6. See: %s', 'woocommerce' ), esc_html( $mysql_version ), '' . __( 'WordPress Requirements', 'woocommerce' ) . '' ) . ''; + if ( version_compare( $environment['mysql_version'], '5.6', '<' ) ) { + echo ' ' . sprintf( __( '%s - We recommend a minimum MySQL version of 5.6. See: %s', 'woocommerce' ), esc_html( $environment['mysql_version'] ), '' . __( 'WordPress Requirements', 'woocommerce' ) . '' ) . ''; } else { - echo '' . esc_html( $mysql_version ) . ''; + echo '' . esc_html( $environment['mysql_version'] ) . ''; } ?> @@ -200,138 +182,96 @@ global $wpdb; : - + : ' . sprintf( __( 'Default timezone is %s - it should be UTC', 'woocommerce' ), $default_timezone ) . ''; + if ( 'UTC' !== $environment['default_timezone'] ) { + echo ' ' . sprintf( __( 'Default timezone is %s - it should be UTC', 'woocommerce' ), $environment['default_timezone'] ) . ''; } else { echo ''; } ?> - SoapClient' ); - } - - // DOMDocument. - $posting['dom_document']['name'] = 'DOMDocument'; - $posting['dom_document']['help'] = wc_help_tip( __( 'HTML/Multipart emails use DOMDocument to generate inline CSS in templates.', 'woocommerce' ) ); - - if ( class_exists( 'DOMDocument' ) ) { - $posting['dom_document']['success'] = true; - } else { - $posting['dom_document']['success'] = false; - $posting['dom_document']['note'] = sprintf( __( 'Your server does not have the %s class enabled - HTML/Multipart emails, and also some extensions, will not work without DOMDocument.', 'woocommerce' ), 'DOMDocument' ); - } - - // GZIP. - $posting['gzip']['name'] = 'GZip'; - $posting['gzip']['help'] = wc_help_tip( __( 'GZip (gzopen) is used to open the GEOIP database from MaxMind.', 'woocommerce' ) ); - - if ( is_callable( 'gzopen' ) ) { - $posting['gzip']['success'] = true; - } else { - $posting['gzip']['success'] = false; - $posting['gzip']['note'] = sprintf( __( 'Your server does not support the %s function - this is required to use the GeoIP database from MaxMind.', 'woocommerce' ), 'gzopen' ); - } - - // Multibyte String. - $posting['mbstring']['name'] = 'Multibyte String'; - $posting['mbstring']['help'] = wc_help_tip( __( 'Multibyte String (mbstring) is used to convert character encoding, like for emails or converting characters to lowercase.', 'woocommerce' ) ); - - if ( extension_loaded( 'mbstring' ) ) { - $posting['mbstring']['success'] = true; - } else { - $posting['mbstring']['success'] = false; - $posting['mbstring']['note'] = sprintf( __( 'Your server does not support the %s functions - this is required for better character encoding. Some fallbacks will be used instead for it.', 'woocommerce' ), 'mbstring' ); - } - - // WP Remote Post Check. - $posting['wp_remote_post']['name'] = __( 'Remote Post', 'woocommerce'); - $posting['wp_remote_post']['help'] = wc_help_tip( __( 'PayPal uses this method of communicating when sending back transaction information.', 'woocommerce' ) ); - - $response = wp_safe_remote_post( 'https://www.paypal.com/cgi-bin/webscr', array( - 'timeout' => 60, - 'user-agent' => 'WooCommerce/' . WC()->version, - 'httpversion' => '1.1', - 'body' => array( - 'cmd' => '_notify-validate' - ) - ) ); - - if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { - $posting['wp_remote_post']['success'] = true; - } else { - $posting['wp_remote_post']['note'] = __( 'wp_remote_post() failed. PayPal IPN won\'t work with your server. Contact your hosting provider.', 'woocommerce' ); - if ( is_wp_error( $response ) ) { - $posting['wp_remote_post']['note'] .= ' ' . sprintf( __( 'Error: %s', 'woocommerce' ), wc_clean( $response->get_error_message() ) ); + + : + + '; } else { - $posting['wp_remote_post']['note'] .= ' ' . sprintf( __( 'Status code: %s', 'woocommerce' ), wc_clean( $response['response']['code'] ) ); - } - $posting['wp_remote_post']['success'] = false; - } - - // WP Remote Get Check. - $posting['wp_remote_get']['name'] = __( 'Remote Get', 'woocommerce'); - $posting['wp_remote_get']['help'] = wc_help_tip( __( 'WooCommerce plugins may use this method of communication when checking for plugin updates.', 'woocommerce' ) ); - - $response = wp_safe_remote_get( 'https://woocommerce.com/wc-api/product-key-api?request=ping&network=' . ( is_multisite() ? '1' : '0' ) ); - - if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { - $posting['wp_remote_get']['success'] = true; - } else { - $posting['wp_remote_get']['note'] = __( 'wp_remote_get() failed. The WooCommerce plugin updater won\'t work with your server. Contact your hosting provider.', 'woocommerce' ); - if ( is_wp_error( $response ) ) { - $posting['wp_remote_get']['note'] .= ' ' . sprintf( __( 'Error: %s', 'woocommerce' ), wc_clean( $response->get_error_message() ) ); + echo ' ' . __( 'Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'woocommerce' ) . ''; + } ?> + + + + : + + '; } else { - $posting['wp_remote_get']['note'] .= ' ' . sprintf( __( 'Status code: %s', 'woocommerce' ), wc_clean( $response['response']['code'] ) ); - } - $posting['wp_remote_get']['success'] = false; - } - - $posting = apply_filters( 'woocommerce_debug_posting', $posting ); - - foreach ( $posting as $post ) { - $mark = ! empty( $post['success'] ) ? 'yes' : 'error'; - ?> - - : - - - - ' : ''; ?> - - - - + echo ' ' . sprintf( __( 'Your server does not have the %s class enabled - some gateway plugins which use SOAP may not work as expected.', 'woocommerce' ), 'SoapClient' ) . ''; + } ?> + + + + : + + '; + } else { + echo ' ' . sprintf( __( 'Your server does not have the %s class enabled - HTML/Multipart emails, and also some extensions, will not work without DOMDocument.', 'woocommerce' ), 'DOMDocument' ) . ''; + } ?> + + + + : + + '; + } else { + echo ' ' . sprintf( __( 'Your server does not support the %s function - this is required to use the GeoIP database from MaxMind.', 'woocommerce' ), 'gzopen' ) . ''; + } ?> + + + + : + + '; + } else { + echo ' ' . sprintf( __( 'Your server does not support the %s functions - this is required for better character encoding. Some fallbacks will be used instead for it.', 'woocommerce' ), 'mbstring' ) . ''; + } ?> + + + + : + + '; + } else { + echo ' ' . __( 'wp_remote_post() failed. Contact your hosting provider.', 'woocommerce' ) . ' ' . esc_html( $environment['remote_post_response'] ) . ''; + } ?> + + + + : + + '; + } else { + echo ' ' . __( 'wp_remote_get() failed. Contact your hosting provider.', 'woocommerce' ) . ' ' . esc_html( $environment['remote_get_response'] ) . ''; + } ?> + + @@ -344,137 +284,83 @@ global $wpdb; - + - - - - - - - - - - - - - - $table_exists ) { ?> - + + + + + + + + + + + +
    :
      prefix ) > 20 ) { - echo ' ' . sprintf( __( '%s - We recommend using a prefix with less than 20 characters. See: %s', 'woocommerce' ), esc_html( $wpdb->prefix ), '' . __( 'How to update your database table prefix', 'woocommerce' ) . '' ) . ''; + if ( strlen( $database['database_prefix'] ) > 20 ) { + echo ' ' . sprintf( __( '%s - We recommend using a prefix with less than 20 characters. See: %s', 'woocommerce' ), esc_html( $database['database_prefix'] ), '' . __( 'How to update your database table prefix', 'woocommerce' ) . '' ) . ''; } else { - echo '' . esc_html( $wpdb->prefix ) . ''; + echo '' . esc_html( $database['database_prefix'] ) . ''; } ?>
     get_var( $wpdb->prepare( "SHOW TABLES LIKE %s;", $wpdb->prefix . $table ) ) !== $wpdb->prefix . $table ? ' ' . __( 'Table does not exist', 'woocommerce' ) . '' : ''; ?>
    : ' . esc_html( WC_Geolocation::get_local_database_path() ) . ' '; - } else { - printf( ' ' . sprintf( __( 'The MaxMind GeoIP Database does not exist - Geolocation will not function. You can download and install it manually from %1$s to the path: %2$s. Scroll down to \"Downloads\" and download the \"Binary / gzip\" file next to \"GeoLite Country\"', 'woocommerce' ), make_clickable( 'http://dev.maxmind.com/geoip/legacy/geolite/' ), '' . WC_Geolocation::get_local_database_path() . '' ) . '', WC_LOG_DIR ); - } - ?>
      ' . __( 'Table does not exist', 'woocommerce' ) . '' : ''; ?>
    : ' . esc_html( $database['maxmind_geoip_database'] ) . ' '; + } else { + printf( ' ' . sprintf( __( 'The MaxMind GeoIP Database does not exist - Geolocation will not function. You can download and install it manually from %1$s to the path: %2$s. Scroll down to \"Downloads\" and download the \"Binary / gzip\" file next to \"GeoLite Country\". Please remember to uncompress GeoIP.dat.gz and upload the GeoIP.dat file only.', 'woocommerce' ), make_clickable( 'http://dev.maxmind.com/geoip/legacy/geolite/' ), '' . $database['maxmind_geoip_database'] . '' ) . '', WC_LOG_DIR ); + } + ?>
    - + ' . $plugin_name . ''; + $plugin_name = esc_html( $plugin['name'] ); + if ( ! empty( $plugin['url'] ) ) { + $plugin_name = '' . $plugin_name . ''; } - if ( strstr( $dirname, 'woocommerce-' ) && strstr( $plugin_data['PluginURI'], 'woothemes.com' ) ) { - - if ( false === ( $version_data = get_transient( md5( $plugin ) . '_version_data' ) ) ) { - $changelog = wp_safe_remote_get( 'http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $dirname . '/changelog.txt' ); - $cl_lines = explode( "\n", wp_remote_retrieve_body( $changelog ) ); - if ( ! empty( $cl_lines ) ) { - foreach ( $cl_lines as $line_num => $cl_line ) { - if ( preg_match( '/^[0-9]/', $cl_line ) ) { - - $date = str_replace( '.' , '-' , trim( substr( $cl_line , 0 , strpos( $cl_line , '-' ) ) ) ); - $version = preg_replace( '~[^0-9,.]~' , '' ,stristr( $cl_line , "version" ) ); - $update = trim( str_replace( "*" , "" , $cl_lines[ $line_num + 1 ] ) ); - $version_data = array( 'date' => $date , 'version' => $version , 'update' => $update , 'changelog' => $changelog ); - set_transient( md5( $plugin ) . '_version_data', $version_data, DAY_IN_SECONDS ); - break; - } - } - } + $version_string = ''; + $network_string = ''; + if ( strstr( $plugin['url'], 'woothemes.com' ) ) { + if ( ! empty( $plugin['version_latest'] ) && version_compare( $plugin['version_latest'], $plugin['version'], '>' ) ) { + $version_string = ' – ' . esc_html( sprintf( _x( '%s is available', 'Version info', 'woocommerce' ), $plugin['version_latest'] ) ) . ''; } - if ( ! empty( $version_data['version'] ) && version_compare( $version_data['version'], $plugin_data['Version'], '>' ) ) { - $version_string = ' – ' . esc_html( sprintf( _x( '%s is available', 'Version info', 'woocommerce' ), $version_data['version'] ) ) . ''; - } - - if ( $plugin_data['Network'] != false ) { + if ( $plugin['network_activated'] != false ) { $network_string = ' – ' . __( 'Network enabled', 'woocommerce' ) . ''; } } - ?> - + + + + + + - + - + - + - + - + - + - -

    ()

    ()

     
    :' : ''; ?>
    : ' : ''; ?>' : ''; ?>
    () ()
    - - - - - - - - - - + +

    :' : ''; ?> + $name ) { + $display_terms[] = strtolower( $name ) . ' (' . $slug . ')'; + } + echo implode( ', ', array_map( 'esc_html', $display_terms ) ); + ?>
    @@ -543,177 +431,109 @@ global $wpdb; array( - 'option' => 'woocommerce_shop_page_id', - 'shortcode' => '', - 'help' => __( 'The URL of your WooCommerce shop\'s homepage (along with the Page ID).', 'woocommerce' ), - ), - _x( 'Cart', 'Page setting', 'woocommerce' ) => array( - 'option' => 'woocommerce_cart_page_id', - 'shortcode' => '[' . apply_filters( 'woocommerce_cart_shortcode_tag', 'woocommerce_cart' ) . ']', - 'help' => __( 'The URL of your WooCommerce shop\'s cart (along with the page ID).', 'woocommerce' ), - ), - _x( 'Checkout', 'Page setting', 'woocommerce' ) => array( - 'option' => 'woocommerce_checkout_page_id', - 'shortcode' => '[' . apply_filters( 'woocommerce_checkout_shortcode_tag', 'woocommerce_checkout' ) . ']', - 'help' => __( 'The URL of your WooCommerce shop\'s checkout (along with the page ID).', 'woocommerce' ), - ), - _x( 'My Account', 'Page setting', 'woocommerce' ) => array( - 'option' => 'woocommerce_myaccount_page_id', - 'shortcode' => '[' . apply_filters( 'woocommerce_my_account_shortcode_tag', 'woocommerce_my_account' ) . ']', - 'help' => __( 'The URL of your WooCommerce shop\'s “My Account” Page (along with the page ID).', 'woocommerce' ), - ) - ); - $alt = 1; - - foreach ( $check_pages as $page_name => $values ) { + foreach ( $pages as $page ) { $error = false; - $page_id = get_option( $values['option'] ); - if ( $page_id ) { - $page_name = '' . esc_html( $page_name ) . ''; + if ( $page['page_id'] ) { + $page_name = '' . esc_html( $page['page_name'] ) . ''; } else { - $page_name = esc_html( $page_name ); + $page_name = esc_html( $page['page_name'] ); } echo '' . $page_name . ':'; - echo '' . wc_help_tip( $values['help'] ) . ''; + echo '' . wc_help_tip( sprintf( __( 'The URL of your WooCommerce shop\'s %s (along with the Page ID).', 'woocommerce' ), $page_name ) ) . ''; // Page ID check. - if ( ! $page_id ) { + if ( ! $page['page_set'] ) { echo ' ' . __( 'Page not set', 'woocommerce' ) . ''; $error = true; - } else if ( ! get_post( $page_id ) ) { + } else if ( ! $page['page_exists'] ) { echo ' ' . __( 'Page ID is set, but the page does not exist', 'woocommerce' ) . ''; $error = true; - } else if ( get_post_status( $page_id ) !== 'publish' ) { + } else if ( ! $page['page_visible'] ) { echo ' ' . sprintf( __( 'Page visibility should be %spublic%s', 'woocommerce' ), '', '' ) . ''; $error = true; } else { - // Shortcode check - if ( $values['shortcode'] ) { - $page = get_post( $page_id ); - - if ( empty( $page ) ) { - - echo ' ' . sprintf( __( 'Page does not exist', 'woocommerce' ) ) . ''; + if ( $page['shortcode_required'] ) { + if ( ! $page['shortcode_present'] ) { + echo ' ' . sprintf( __( 'Page does not contain the shortcode.', 'woocommerce' ), $page['shortcode'] ) . ''; $error = true; - - } else if ( ! strstr( $page->post_content, $values['shortcode'] ) ) { - - echo ' ' . sprintf( __( 'Page does not contain the shortcode: %s', 'woocommerce' ), $values['shortcode'] ) . ''; - $error = true; - } } - } - if ( ! $error ) echo '#' . absint( $page_id ) . ' - ' . str_replace( home_url(), '', get_permalink( $page_id ) ) . ''; + if ( ! $error ) echo '#' . absint( $page['page_id'] ) . ' - ' . str_replace( home_url(), '', get_permalink( $page['page_id'] ) ) . ''; echo ''; } ?> - - - - - - - - - - - - - -

    :  0 ) ); - foreach ( $terms as $term ) { - $display_terms[] = strtolower( $term->name ) . ' (' . $term->slug . ')'; - } - echo implode( ', ', array_map( 'esc_html', $display_terms ) ); - ?>
    - Version; - $update_theme_version = WC_Admin_Status::get_latest_theme_version( $active_theme ); - ?> - + - + Template ); - $update_theme_version = WC_Admin_Status::get_latest_theme_version( $parent_theme ); + if( $theme['is_child_theme'] ) : ?> - + - + - + - + WC()->plugin_path() . '/templates/' ) ); - $scanned_files = array(); - $found_files = array(); - $outdated_templates = false; - - foreach ( $template_paths as $plugin_name => $template_path ) { - - $scanned_files = WC_Admin_Status::scan_template_files( $template_path ); - - foreach ( $scanned_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_template_directory() . '/' . $file ) ) { - $theme_file = get_template_directory() . '/' . $file; - } elseif( file_exists( get_template_directory() . '/woocommerce/' . $file ) ) { - $theme_file = get_template_directory() . '/woocommerce/' . $file; - } else { - $theme_file = false; - } - - if ( ! empty( $theme_file ) ) { - $core_version = WC_Admin_Status::get_file_version( $template_path . $file ); - $theme_version = WC_Admin_Status::get_file_version( $theme_file ); - - if ( $core_version && ( empty( $theme_version ) || version_compare( $theme_version, $core_version, '<' ) ) ) { - if ( ! $outdated_templates ) { - $outdated_templates = true; - } - $found_files[ $plugin_name ][] = sprintf( __( '%s version %s is out of date. The core version is %s', 'woocommerce' ), str_replace( WP_CONTENT_DIR . '/themes/', '', $theme_file ), $theme_version ? $theme_version : '-', $core_version ); - } else { - $found_files[ $plugin_name ][] = sprintf( '%s', str_replace( WP_CONTENT_DIR . '/themes/', '', $theme_file ) ); - } - } - } - } - - if ( ! empty( $found_files ) ) { - foreach ( $found_files as $plugin_name => $found_plugin_files ) { - ?> + if ( ! empty( $theme['overrides'] ) ) { ?> - + - + @@ -795,12 +589,12 @@ global $wpdb; - + - +
    -

    + +

    + +

    +
    get_export_button(); ?> diff --git a/includes/api/class-wc-rest-orders-controller.php b/includes/api/class-wc-rest-orders-controller.php index ebd363612f2..4400c1de08c 100644 --- a/includes/api/class-wc-rest-orders-controller.php +++ b/includes/api/class-wc-rest-orders-controller.php @@ -1019,7 +1019,7 @@ class WC_REST_Orders_Controller extends WC_REST_Posts_Controller { // Create item. if ( is_null( $item['id'] ) ) { $this->set_item( $order, $line_type, $item, 'create' ); - } elseif ( $this->item_is_null( $item ) ) { + } elseif ( $this->item_is_null( $item ) || 0 === $item['quantity'] ) { // Delete item. wc_delete_order_item( $item['id'] ); } else { diff --git a/includes/api/class-wc-rest-product-reviews-controller.php b/includes/api/class-wc-rest-product-reviews-controller.php index 5c7f900bd5e..12df9399c36 100644 --- a/includes/api/class-wc-rest-product-reviews-controller.php +++ b/includes/api/class-wc-rest-product-reviews-controller.php @@ -1,8 +1,8 @@ /reviews endpoint. + * Handles requests to /products//reviews. * * @author WooThemes * @category API @@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) { } /** - * REST API Products controller class. + * REST API Product Reviews Controller Class. * * @package WooCommerce/API * @extends WC_REST_Controller @@ -47,6 +47,22 @@ class WC_REST_Product_Reviews_Controller extends WC_REST_Controller { 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), + array( + 'methods' => WP_REST_Server::CREATABLE, + 'callback' => array( $this, 'create_item' ), + 'permission_callback' => array( $this, 'create_item_permissions_check' ), + 'args' => array_merge( $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ), array( + 'review' => array( + 'required' => true, + ), + 'name' => array( + 'required' => true, + ), + 'email' => array( + 'required' => true, + ), + ) ), + ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); @@ -59,8 +75,35 @@ class WC_REST_Product_Reviews_Controller extends WC_REST_Controller { 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'update_item' ), + 'permission_callback' => array( $this, 'update_item_permissions_check' ), + 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), + ), + array( + 'methods' => WP_REST_Server::DELETABLE, + 'callback' => array( $this, 'delete_item' ), + 'permission_callback' => array( $this, 'delete_item_permissions_check' ), + 'args' => array( + 'force' => array( + 'default' => false, + 'description' => __( 'Whether to bypass trash and force deletion.', 'woocommerce' ), + ), + ), + ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); + + register_rest_route( $this->namespace, '/' . $this->rest_base . '/batch', array( + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'batch_items' ), + 'permission_callback' => array( $this, 'batch_items_permissions_check' ), + 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), + ), + 'schema' => array( $this, 'get_public_batch_schema' ), + ) ); } /** @@ -78,7 +121,7 @@ class WC_REST_Product_Reviews_Controller extends WC_REST_Controller { } /** - * Check if a given request has access to read a webhook develivery. + * Check if a given request has access to read a product review. * * @param WP_REST_Request $request Full details about the request. * @return WP_Error|boolean @@ -93,6 +136,61 @@ class WC_REST_Product_Reviews_Controller extends WC_REST_Controller { return true; } + /** + * Check if a given request has access to create a new product review. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|boolean + */ + public function create_item_permissions_check( $request ) { + $post = get_post( (int) $request['product_id'] ); + if ( $post && ! wc_rest_check_post_permissions( 'product', 'create', $post->ID ) ) { + return new WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you cannot create new resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); + } + return true; + } + + /** + * Check if a given request has access to update a product review. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|boolean + */ + public function update_item_permissions_check( $request ) { + $post = get_post( (int) $request['product_id'] ); + if ( $post && ! wc_rest_check_post_permissions( 'product', 'edit', $post->ID ) ) { + return new WP_Error( 'woocommerce_rest_cannot_edit', __( 'Sorry, you cannot edit resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); + } + return true; + } + + /** + * Check if a given request has access to delete a product review. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|boolean + */ + public function delete_item_permissions_check( $request ) { + $post = get_post( (int) $request['product_id'] ); + if ( $post && ! wc_rest_check_post_permissions( 'product', 'delete', $post->ID ) ) { + return new WP_Error( 'woocommerce_rest_cannot_edit', __( 'Sorry, you cannot delete product reviews.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); + } + return true; + } + + /** + * Check if a given request has access to batch manage product reviews. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|boolean + */ + public function batch_items_permissions_check( $request ) { + if ( ! wc_rest_check_post_permissions( 'product', 'batch' ) ) { + return new WP_Error( 'woocommerce_rest_cannot_edit', __( 'Sorry, you cannot batch manipulate product reviews.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); + } + return true; + } + /** * Get all reviews from a product. * @@ -100,13 +198,13 @@ class WC_REST_Product_Reviews_Controller extends WC_REST_Controller { * @return array */ public function get_items( $request ) { - $product = get_post( (int) $request['product_id'] ); + $product_id = (int) $request['product_id']; - if ( empty( $product->post_type ) || 'product' !== $product->post_type ) { + if ( 'product' !== get_post_type( $product_id ) ) { return new WP_Error( 'woocommerce_rest_product_invalid_id', __( 'Invalid product ID.', 'woocommerce' ), array( 'status' => 404 ) ); } - $reviews = get_approved_comments( $product->ID ); + $reviews = get_approved_comments( $product_id ); $data = array(); foreach ( $reviews as $review_data ) { $review = $this->prepare_item_for_response( $review_data, $request ); @@ -124,16 +222,16 @@ class WC_REST_Product_Reviews_Controller extends WC_REST_Controller { * @return WP_Error|WP_REST_Response */ public function get_item( $request ) { - $id = (int) $request['id']; - $product = get_post( (int) $request['product_id'] ); + $id = (int) $request['id']; + $product_id = (int) $request['product_id']; - if ( empty( $product->post_type ) || 'product' !== $product->post_type ) { + if ( 'product' !== get_post_type( $product_id ) ) { return new WP_Error( 'woocommerce_rest_product_invalid_id', __( 'Invalid product ID.', 'woocommerce' ), array( 'status' => 404 ) ); } $review = get_comment( $id ); - if ( empty( $id ) || empty( $review ) || intval( $review->comment_post_ID ) !== intval( $product->ID ) ) { + if ( empty( $id ) || empty( $review ) || intval( $review->comment_post_ID ) !== $product_id ) { return new WP_Error( 'woocommerce_rest_invalid_id', __( 'Invalid resource ID.', 'woocommerce' ), array( 'status' => 404 ) ); } @@ -143,6 +241,197 @@ class WC_REST_Product_Reviews_Controller extends WC_REST_Controller { return $response; } + + /** + * Create a product review. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|WP_REST_Response + */ + public function create_item( $request ) { + $product_id = (int) $request['product_id']; + + if ( 'product' !== get_post_type( $product_id ) ) { + return new WP_Error( 'woocommerce_rest_product_invalid_id', __( 'Invalid product ID.', 'woocommerce' ), array( 'status' => 404 ) ); + } + + $prepared_review = $this->prepare_item_for_database( $request ); + + /** + * Filter a product review (comment) before it is inserted via the REST API. + * + * Allows modification of the comment right before it is inserted via `wp_insert_comment`. + * + * @param array $prepared_review The prepared comment data for `wp_insert_comment`. + * @param WP_REST_Request $request Request used to insert the comment. + */ + $prepared_review = apply_filters( 'rest_pre_insert_product_review', $prepared_review, $request ); + + $product_review_id = wp_insert_comment( $prepared_review ); + if ( ! $product_review_id ) { + return new WP_Error( 'rest_product_review_failed_create', __( 'Creating product review failed.' ), array( 'status' => 500 ) ); + } + + update_comment_meta( $product_review_id, 'rating', ( ! empty( $request['rating'] ) ? $request['rating'] : '0' ) ); + + $product_review = get_comment( $product_review_id ); + $this->update_additional_fields_for_object( $product_review, $request ); + + /** + * Fires after a single item is created or updated via the REST API. + * + * @param WP_Comment $product_review Inserted object. + * @param WP_REST_Request $request Request object. + * @param boolean $creating True when creating item, false when updating. + */ + do_action( "woocommerce_rest_insert_product_review", $product_review, $request, true ); + + $request->set_param( 'context', 'edit' ); + $response = $this->prepare_item_for_response( $product_review, $request ); + $response = rest_ensure_response( $response ); + $response->set_status( 201 ); + $base = str_replace( '(?P[\d]+)', $product_id, $this->rest_base ); + $response->header( 'Location', rest_url( sprintf( '/%s/%s/%d', $this->namespace, $base, $product_review_id ) ) ); + + return $response; + } + + /** + * Update a single product review. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|WP_REST_Response + */ + public function update_item( $request ) { + $product_review_id = (int) $request['id']; + $product_id = (int) $request['product_id']; + + if ( 'product' !== get_post_type( $product_id ) ) { + return new WP_Error( 'woocommerce_rest_product_invalid_id', __( 'Invalid product ID.', 'woocommerce' ), array( 'status' => 404 ) ); + } + + $review = get_comment( $product_review_id ); + + if ( empty( $product_review_id ) || empty( $review ) || intval( $review->comment_post_ID ) !== $product_id ) { + return new WP_Error( 'woocommerce_rest_product_review_invalid_id', __( 'Invalid resource ID.', 'woocommerce' ), array( 'status' => 404 ) ); + } + + $prepared_review = $this->prepare_item_for_database( $request ); + + $updated = wp_update_comment( $prepared_review ); + if ( 0 === $updated ) { + return new WP_Error( 'rest_product_review_failed_edit', __( 'Updating product review failed.' ), array( 'status' => 500 ) ); + } + + if ( ! empty( $request['rating'] ) ) { + update_comment_meta( $product_review_id, 'rating', $request['rating'] ); + } + + $product_review = get_comment( $product_review_id ); + $this->update_additional_fields_for_object( $product_review, $request ); + + /** + * Fires after a single item is created or updated via the REST API. + * + * @param WP_Comment $comment Inserted object. + * @param WP_REST_Request $request Request object. + * @param boolean $creating True when creating item, false when updating. + */ + do_action( "woocommerce_rest_insert_product_review", $product_review, $request, true ); + + $request->set_param( 'context', 'edit' ); + $response = $this->prepare_item_for_response( $product_review, $request ); + + return rest_ensure_response( $response ); + } + + /** + * Delete a product review. + * + * @param WP_REST_Request $request Full details about the request + * @return WP_Error|boolean + */ + public function delete_item( $request ) { + $product_review_id = is_array( $request['id'] ) ? $request['id']['id'] : $request['id']; + $force = isset( $request['force'] ) ? (bool) $request['force'] : false; + + $product_review = get_comment( $product_review_id ); + if ( empty( $product_review_id ) || empty( $product_review->comment_ID ) || empty( $product_review->comment_post_ID ) ) { + return new WP_Error( 'woocommerce_rest_product_review_invalid_id', __( 'Invalid product review ID.', 'woocommerce' ), array( 'status' => 404 ) ); + } + + /** + * Filter whether a product review is trashable. + * + * Return false to disable trash support for the product review. + * + * @param boolean $supports_trash Whether the object supports trashing. + * @param WP_Post $product_review The object being considered for trashing support. + */ + $supports_trash = apply_filters( 'rest_product_review_trashable', ( EMPTY_TRASH_DAYS > 0 ), $product_review ); + + $request->set_param( 'context', 'edit' ); + $response = $this->prepare_item_for_response( $product_review, $request ); + + if ( $force ) { + $result = wp_delete_comment( $product_review_id, true ); + } else { + if ( ! $supports_trash ) { + return new WP_Error( 'rest_trash_not_supported', __( 'The product review does not support trashing.' ), array( 'status' => 501 ) ); + } + + if ( 'trash' === $product_review->comment_approved ) { + return new WP_Error( 'rest_already_trashed', __( 'The comment has already been trashed.' ), array( 'status' => 410 ) ); + } + + $result = wp_trash_comment( $product_review->comment_ID ); + } + + if ( ! $result ) { + return new WP_Error( 'rest_cannot_delete', __( 'The product review cannot be deleted.' ), array( 'status' => 500 ) ); + } + + /** + * Fires after a product review is deleted via the REST API. + * + * @param object $product_review The deleted item. + * @param WP_REST_Response $response The response data. + * @param WP_REST_Request $request The request sent to the API. + */ + do_action( 'rest_delete_product_review', $product_review, $response, $request ); + + return $response; + } + + /** + * Bulk create, update and delete items. + * + * @since 2.7.0 + * @param WP_REST_Request $request Full details about the request. + * @return array Of WP_Error or WP_REST_Response. + */ + public function batch_items( $request ) { + $items = array_filter( $request->get_params() ); + $params = $request->get_url_params(); + $product_id = $params['product_id']; + $body_params = array(); + + foreach ( array( 'update', 'create', 'delete' ) as $batch_type ) { + if ( ! empty( $items[ $batch_type ] ) ) { + $injected_items = array(); + foreach ( $items[ $batch_type ] as $item ) { + $injected_items[] = array_merge( array( 'product_id' => $product_id ), $item ); + } + $body_params[ $batch_type ] = $injected_items; + } + } + + $request = new WP_REST_Request( $request->get_method() ); + $request->set_body_params( $body_params ); + + return parent::batch_items( $request ); + } + /** * Prepare a single product review output for response. * @@ -180,6 +469,38 @@ class WC_REST_Product_Reviews_Controller extends WC_REST_Controller { return apply_filters( 'woocommerce_rest_prepare_product_review', $response, $review, $request ); } + /** + * Prepare a single product review to be inserted into the database. + * + * @param WP_REST_Request $request Request object. + * @return array|WP_Error $prepared_review + */ + protected function prepare_item_for_database( $request ) { + $prepared_review = array( 'comment_approved' => 1, 'comment_type' => 'review' ); + + if ( isset( $request['id'] ) ) { + $prepared_review['comment_ID'] = (int) $request['id']; + } + + if ( isset( $request['review'] ) ) { + $prepared_review['comment_content'] = $request['review']; + } + + if ( isset( $request['product_id'] ) ) { + $prepared_review['comment_post_ID'] = (int) $request['product_id']; + } + + if ( isset( $request['name'] ) ) { + $prepared_review['comment_author'] = $request['name']; + } + + if ( isset( $request['email'] ) ) { + $prepared_review['comment_author_email'] = $request['email']; + } + + return apply_filters( 'rest_preprocess_product_review', $prepared_review, $request ); + } + /** * Prepare links for the request. * @@ -219,37 +540,38 @@ class WC_REST_Product_Reviews_Controller extends WC_REST_Controller { 'id' => array( 'description' => __( 'Unique identifier for the resource.', 'woocommerce' ), 'type' => 'integer', - 'context' => array( 'view' ), + 'context' => array( 'view', 'edit' ), 'readonly' => true, ), + 'review' => array( + 'description' => __( 'The content of the review.', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), 'date_created' => array( 'description' => __( "The date the review was created, in the site's timezone.", 'woocommerce' ), 'type' => 'date-time', 'context' => array( 'view', 'edit' ), - 'readonly' => true, ), 'rating' => array( 'description' => __( 'Review rating (0 to 5).', 'woocommerce' ), 'type' => 'integer', - 'context' => array( 'view' ), - 'readonly' => true, + 'context' => array( 'view', 'edit' ), ), 'name' => array( 'description' => __( 'Reviewer name.', 'woocommerce' ), 'type' => 'string', - 'context' => array( 'view' ), - 'readonly' => true, + 'context' => array( 'view', 'edit' ), ), 'email' => array( 'description' => __( 'Reviewer email.', 'woocommerce' ), 'type' => 'string', - 'context' => array( 'view' ), - 'readonly' => true, + 'context' => array( 'view', 'edit' ), ), 'verified' => array( 'description' => __( 'Shows if the reviewer bought the product or not.', 'woocommerce' ), 'type' => 'boolean', - 'context' => array( 'view' ), + 'context' => array( 'view', 'edit' ), 'readonly' => true, ), ), diff --git a/includes/api/class-wc-rest-shipping-zone-locations-controller.php b/includes/api/class-wc-rest-shipping-zone-locations-controller.php new file mode 100644 index 00000000000..26a854eb885 --- /dev/null +++ b/includes/api/class-wc-rest-shipping-zone-locations-controller.php @@ -0,0 +1,179 @@ +/locations endpoint. + * + * @author WooThemes + * @category API + * @package WooCommerce/API + * @since 2.7.0 + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + +/** + * REST API Shipping Zone Locations class. + * + * @package WooCommerce/API + * @extends WC_REST_Shipping_Zones_Controller_Base + */ +class WC_REST_Shipping_Zone_Locations_Controller extends WC_REST_Shipping_Zones_Controller_Base { + + /** + * Register the routes for Shipping Zone Locations. + */ + public function register_routes() { + register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P[\d-]+)/locations', array( + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => array( $this, 'get_items' ), + 'permission_callback' => array( $this, 'get_items_permissions_check' ), + ), + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'update_items' ), + 'permission_callback' => array( $this, 'update_items_permissions_check' ), + 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), + ), + 'schema' => array( $this, 'get_public_item_schema' ), + ) ); + } + + /** + * Get all Shipping Zone Locations. + * + * @param WP_REST_Request $request + * @return WP_REST_Response|WP_Error + */ + public function get_items( $request ) { + $zone = $this->get_zone( $request['id'] ); + + if ( is_wp_error( $zone ) ) { + return $zone; + } + + $locations = $zone->get_zone_locations(); + $data = array(); + + foreach ( $locations as $location_obj ) { + $location = $this->prepare_item_for_response( $location_obj, $request ); + $location = $this->prepare_response_for_collection( $location ); + $data[] = $location; + } + + return rest_ensure_response( $data ); + } + + /** + * Update all Shipping Zone Locations. + * + * @param WP_REST_Request $request + * @return WP_REST_Response|WP_Error + */ + public function update_items( $request ) { + $zone = $this->get_zone( $request['id'] ); + + if ( is_wp_error( $zone ) ) { + return $zone; + } + + $raw_locations = $request->get_json_params(); + $locations = array(); + + foreach ( (array) $raw_locations as $raw_location ) { + if ( empty( $raw_location['code'] ) || empty( $raw_location['type'] ) ) { + continue; + } + $locations[] = $raw_location; + } + + $zone->set_locations( $locations ); + $zone->save(); + + return $this->get_items( $request ); + } + + /** + * Prepare the Shipping Zone Location for the REST response. + * + * @param array $item Shipping Zone Location. + * @param WP_REST_Request $request Request object. + * @return WP_REST_Response $response + */ + public function prepare_item_for_response( $item, $request ) { + $context = empty( $request['context'] ) ? 'view' : $request['context']; + $data = $this->add_additional_fields_to_object( $item, $request ); + $data = $this->filter_response_by_context( $data, $context ); + + // Wrap the data in a response object. + $response = rest_ensure_response( $data ); + + $response->add_links( $this->prepare_links( $request['id'] ) ); + + return $response; + } + + /** + * Prepare links for the request. + * + * @param int $zone_id Given Shipping Zone ID. + * @return array Links for the given Shipping Zone Location. + */ + protected function prepare_links( $zone_id ) { + $base = '/' . $this->namespace . '/' . $this->rest_base . '/' . $zone_id; + $links = array( + 'collection' => array( + 'href' => rest_url( $base . '/locations' ), + ), + 'describes' => array( + 'href' => rest_url( $base ), + ), + ); + + return $links; + } + + /** + * Get the Shipping Zone Locations schema, conforming to JSON Schema + * + * @return array + */ + public function get_item_schema() { + $schema = array( + '$schema' => 'http://json-schema.org/draft-04/schema#', + 'title' => 'shipping_zone_location', + 'type' => 'object', + 'properties' => array( + 'code' => array( + 'description' => __( 'Shipping zone location code.', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + 'required' => true, + 'arg_options' => array( + 'sanitize_callback' => 'sanitize_text_field', + ), + ), + 'type' => array( + 'description' => __( 'Shipping zone location type.', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + 'required' => true, + 'arg_options' => array( + 'sanitize_callback' => 'sanitize_text_field', + ), + 'enum' => array( + 'postcode', + 'state', + 'country', + 'continent', + ), + ), + ), + ); + + return $this->add_additional_fields_schema( $schema ); + } +} diff --git a/includes/api/class-wc-rest-shipping-zone-methods-controller.php b/includes/api/class-wc-rest-shipping-zone-methods-controller.php new file mode 100644 index 00000000000..2e729101a5a --- /dev/null +++ b/includes/api/class-wc-rest-shipping-zone-methods-controller.php @@ -0,0 +1,217 @@ +/methods endpoint. + * + * @author WooThemes + * @category API + * @package WooCommerce/API + * @since 2.7.0 + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + +/** + * REST API Shipping Zone Methods class. + * + * @package WooCommerce/API + * @extends WC_REST_Shipping_Zones_Controller_Base + */ +class WC_REST_Shipping_Zone_Methods_Controller extends WC_REST_Shipping_Zones_Controller_Base { + + /** + * Register the routes for Shipping Zone Methods. + */ + public function register_routes() { + register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P[\d-]+)/methods', array( + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => array( $this, 'get_items' ), + 'permission_callback' => array( $this, 'get_items_permissions_check' ), + ), + 'schema' => array( $this, 'get_public_item_schema' ), + ) ); + + register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P[\d-]+)/methods/(?P[\d-]+)', array( + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => array( $this, 'get_item' ), + 'permission_callback' => array( $this, 'get_items_permissions_check' ), + ), + 'schema' => array( $this, 'get_public_item_schema' ), + ) ); + } + + /** + * Get a single Shipping Zone Method. + * + * @param WP_REST_Request $request + * @return WP_REST_Response|WP_Error + */ + public function get_item( $request ) { + $zone = $this->get_zone( $request['zone_id'] ); + + if ( is_wp_error( $zone ) ) { + return $zone; + } + + $instance_id = (int) $request['instance_id']; + $methods = $zone->get_shipping_methods(); + $method = false; + + foreach ( $methods as $method_obj ) { + if ( $instance_id === $method_obj->instance_id ) { + $method = $method_obj; + break; + } + } + + if ( false === $method ) { + return new WP_Error( 'woocommerce_rest_shipping_zone_method_invalid', __( "Resource doesn't exist.", 'woocommerce' ), array( 'status' => 404 ) ); + } + + $data = $this->prepare_item_for_response( $method, $request ); + + return rest_ensure_response( $data ); + } + + /** + * Get all Shipping Zone Methods. + * + * @param WP_REST_Request $request + * @return WP_REST_Response|WP_Error + */ + public function get_items( $request ) { + $zone = $this->get_zone( $request['zone_id'] ); + + if ( is_wp_error( $zone ) ) { + return $zone; + } + + $methods = $zone->get_shipping_methods(); + $data = array(); + + foreach ( $methods as $method_obj ) { + $method = $this->prepare_item_for_response( $method_obj, $request ); + $data[] = $method; + } + + return rest_ensure_response( $data ); + } + + /** + * Prepare the Shipping Zone Method for the REST response. + * + * @param array $item Shipping Zone Method. + * @param WP_REST_Request $request Request object. + * @return WP_REST_Response $response + */ + public function prepare_item_for_response( $item, $request ) { + $method = array( + 'instance_id' => $item->instance_id, + 'title' => $item->instance_settings['title'], + 'order' => $item->method_order, + 'enabled' => ( 'yes' === $item->enabled ), + 'method_id' => $item->id, + 'method_title' => $item->method_title, + 'method_description' => $item->method_description, + ); + + $context = empty( $request['context'] ) ? 'view' : $request['context']; + $data = $this->add_additional_fields_to_object( $method, $request ); + $data = $this->filter_response_by_context( $data, $context ); + + // Wrap the data in a response object. + $response = rest_ensure_response( $data ); + + $response->add_links( $this->prepare_links( $request['zone_id'], $item->instance_id ) ); + + $response = $this->prepare_response_for_collection( $response ); + + return $response; + } + + /** + * Prepare links for the request. + * + * @param int $zone_id Given Shipping Zone ID. + * @param int $instance_id Given Shipping Zone Method Instance ID. + * @return array Links for the given Shipping Zone Method. + */ + protected function prepare_links( $zone_id, $instance_id ) { + $base = '/' . $this->namespace . '/' . $this->rest_base . '/' . $zone_id; + $links = array( + 'self' => array( + 'href' => rest_url( $base . '/methods/' . $instance_id ), + ), + 'collection' => array( + 'href' => rest_url( $base . '/methods' ), + ), + 'describes' => array( + 'href' => rest_url( $base ), + ), + ); + + return $links; + } + + /** + * Get the Shipping Zone Methods schema, conforming to JSON Schema + * + * @return array + */ + public function get_item_schema() { + $schema = array( + '$schema' => 'http://json-schema.org/draft-04/schema#', + 'title' => 'shipping_zone_method', + 'type' => 'object', + 'properties' => array( + 'instance_id' => array( + 'description' => __( 'Shipping method instance ID.', 'woocommerce' ), + 'type' => 'integer', + 'context' => array( 'view' ), + ), + 'title' => array( + 'description' => __( 'Shipping method customer facing title.', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view' ), + ), + 'order' => array( + 'description' => __( 'Shipping method sort order.', 'woocommerce' ), + 'type' => 'integer', + 'context' => array( 'view', 'edit' ), + 'required' => false, + 'arg_options' => array( + 'sanitize_callback' => 'absint', + ), + ), + 'enabled' => array( + 'description' => __( 'Shipping method enabled status.', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + 'required' => false, + ), + 'method_id' => array( + 'description' => __( 'Shipping method ID.', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view' ), + ), + 'method_title' => array( + 'description' => __( 'Shipping method title.', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view' ), + ), + 'method_description' => array( + 'description' => __( 'Shipping method description.', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view' ), + ), + ), + ); + + return $this->add_additional_fields_schema( $schema ); + } +} diff --git a/includes/api/class-wc-rest-shipping-zones-controller.php b/includes/api/class-wc-rest-shipping-zones-controller.php new file mode 100644 index 00000000000..5edaf4fa177 --- /dev/null +++ b/includes/api/class-wc-rest-shipping-zones-controller.php @@ -0,0 +1,253 @@ +namespace, '/' . $this->rest_base, array( + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => array( $this, 'get_items' ), + 'permission_callback' => array( $this, 'get_items_permissions_check' ), + ), + array( + 'methods' => WP_REST_Server::CREATABLE, + 'callback' => array( $this, 'create_item' ), + 'permission_callback' => array( $this, 'create_item_permissions_check' ), + 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ), + ), + 'schema' => array( $this, 'get_public_item_schema' ), + ) ); + + register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P[\d-]+)', array( + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => array( $this, 'get_item' ), + 'permission_callback' => array( $this, 'get_items_permissions_check' ), + ), + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'update_item' ), + 'permission_callback' => array( $this, 'update_items_permissions_check' ), + 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), + ), + 'schema' => array( $this, 'get_public_item_schema' ), + ) ); + } + + /** + * Get a single Shipping Zone. + * + * @param WP_REST_Request $request + * @return WP_REST_Response + */ + public function get_item( $request ) { + $zone = $this->get_zone( $request->get_param( 'id' ) ); + + if ( is_wp_error( $zone ) ) { + return $zone; + } + + $data = $zone->get_data(); + $data = $this->prepare_item_for_response( $data, $request ); + $data = $this->prepare_response_for_collection( $data ); + + return rest_ensure_response( $data ); + } + + /** + * Get all Shipping Zones. + * + * @param WP_REST_Request $request + * @return WP_REST_Response + */ + public function get_items( $request ) { + $rest_of_the_world = WC_Shipping_Zones::get_zone_by( 'zone_id', 0 ); + + $zones = WC_Shipping_Zones::get_zones(); + array_unshift( $zones, $rest_of_the_world->get_data() ); + $data = array(); + + foreach ( $zones as $zone_obj ) { + $zone = $this->prepare_item_for_response( $zone_obj, $request ); + $zone = $this->prepare_response_for_collection( $zone ); + $data[] = $zone; + } + + return rest_ensure_response( $data ); + } + + /** + * Create a single Shipping Zone. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Request|WP_Error + */ + public function create_item( $request ) { + $zone = new WC_Shipping_Zone( null ); + + if ( ! is_null( $request->get_param( 'name' ) ) ) { + $zone->set_zone_name( $request->get_param( 'name' ) ); + } + + if ( ! is_null( $request->get_param( 'order' ) ) ) { + $zone->set_zone_order( $request->get_param( 'order' ) ); + } + + $zone->create(); + + if ( $zone->get_id() !== 0 ) { + $request->set_param( 'id', $zone->get_id() ); + $response = $this->get_item( $request ); + $response->set_status( 201 ); + $response->header( 'Location', rest_url( sprintf( '/%s/%s/%d', $this->namespace, $this->rest_base, $zone->get_id() ) ) ); + return $response; + } else { + return new WP_Error( 'woocommerce_rest_shipping_zone_not_created', __( "Resource cannot be created. Check to make sure 'order' and 'name' are present.", 'woocommerce' ), array( 'status' => 500 ) ); + } + } + + /** + * Update a single Shipping Zone. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Request|WP_Error + */ + public function update_item( $request ) { + $zone = $this->get_zone( $request->get_param( 'id' ) ); + + if ( is_wp_error( $zone ) ) { + return $zone; + } + + $zone_changed = false; + + if ( ! is_null( $request->get_param( 'name' ) ) ) { + $zone->set_zone_name( $request->get_param( 'name' ) ); + $zone_changed = true; + } + + if ( ! is_null( $request->get_param( 'order' ) ) ) { + $zone->set_zone_order( $request->get_param( 'order' ) ); + $zone_changed = true; + } + + if ( $zone_changed ) { + $zone->save(); + } + + return $this->get_item( $request ); + } + + /** + * Prepare the Shipping Zone for the REST response. + * + * @param array $item Shipping Zone. + * @param WP_REST_Request $request Request object. + * @return WP_REST_Response $response + */ + public function prepare_item_for_response( $item, $request ) { + $data = array( + 'id' => (int) $item['zone_id'], + 'name' => $item['zone_name'], + 'order' => (int) $item['zone_order'], + ); + + $context = empty( $request['context'] ) ? 'view' : $request['context']; + $data = $this->add_additional_fields_to_object( $data, $request ); + $data = $this->filter_response_by_context( $data, $context ); + + // Wrap the data in a response object. + $response = rest_ensure_response( $data ); + + $response->add_links( $this->prepare_links( $data['id'] ) ); + + return $response; + } + + /** + * Prepare links for the request. + * + * @param int $zone_id Given Shipping Zone ID. + * @return array Links for the given Shipping Zone. + */ + protected function prepare_links( $zone_id ) { + $base = '/' . $this->namespace . '/' . $this->rest_base; + $links = array( + 'self' => array( + 'href' => rest_url( trailingslashit( $base ) . $zone_id ), + ), + 'collection' => array( + 'href' => rest_url( $base ), + ), + 'describedby' => array( + 'href' => rest_url( trailingslashit( $base ) . $zone_id . '/locations' ), + ), + ); + + return $links; + } + + /** + * Get the Shipping Zones schema, conforming to JSON Schema + * + * @return array + */ + public function get_item_schema() { + $schema = array( + '$schema' => 'http://json-schema.org/draft-04/schema#', + 'title' => 'shipping_zone', + 'type' => 'object', + 'properties' => array( + 'id' => array( + 'description' => __( 'Unique identifier for the resource.', 'woocommerce' ), + 'type' => 'integer', + 'context' => array( 'view', 'edit' ), + 'readonly' => true, + ), + 'name' => array( + 'description' => __( 'Shipping zone name.', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + 'required' => true, + 'arg_options' => array( + 'sanitize_callback' => 'sanitize_text_field', + ), + ), + 'order' => array( + 'description' => __( 'Shipping zone order.', 'woocommerce' ), + 'type' => 'integer', + 'context' => array( 'view', 'edit' ), + 'required' => false, + 'arg_options' => array( + 'sanitize_callback' => 'absint', + ), + ), + ), + ); + + return $this->add_additional_fields_schema( $schema ); + } +} diff --git a/includes/api/class-wc-rest-system-status-controller.php b/includes/api/class-wc-rest-system-status-controller.php new file mode 100644 index 00000000000..e9a9236e53d --- /dev/null +++ b/includes/api/class-wc-rest-system-status-controller.php @@ -0,0 +1,821 @@ +namespace, '/' . $this->rest_base, array( + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => array( $this, 'get_items' ), + 'permission_callback' => array( $this, 'get_items_permissions_check' ), + 'args' => $this->get_collection_params(), + ), + 'schema' => array( $this, 'get_public_item_schema' ), + ) ); + } + + /** + * Check whether a given request has permission to view system status. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|boolean + */ + public function get_items_permissions_check( $request ) { + if ( ! wc_rest_check_manager_permissions( 'system_status', 'read' ) ) { + return new WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot view.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); + } + return true; + } + + /** + * Get a system status info, by section. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|WP_REST_Response + */ + public function get_items( $request ) { + $schema = $this->get_item_schema(); + $mappings = $this->get_item_mappings(); + $response = array(); + + foreach ( $mappings as $section => $values ) { + settype( $values, $schema['properties'][ $section ]['type'] ); + foreach ( $values as $key => $value ) { + if ( isset( $schema['properties'][ $section ]['properties'][ $key ]['type'] ) ) { + settype( $values[ $key ], $schema['properties'][ $section ]['properties'][ $key ]['type'] ); + } + } + $response[ $section ] = $values; + } + + return rest_ensure_response( $response ); + } + + /** + * Get the system status schema, conforming to JSON Schema. + * + * @return array + */ + public function get_item_schema() { + $schema = array( + '$schema' => 'http://json-schema.org/draft-04/schema#', + 'title' => 'system_status', + 'type' => 'object', + 'properties' => array( + 'environment' => array( + 'description' => __( 'Environment', 'woocommerce' ), + 'type' => 'array', + 'context' => array( 'view', 'edit' ), + 'properties' => array( + 'home_url' => array( + 'description' => __( 'Home URL', 'woocommerce' ), + 'type' => 'string', + 'format' => 'uri', + 'context' => array( 'view', 'edit' ), + ), + 'site_url' => array( + 'description' => __( 'Site URL', 'woocommerce' ), + 'type' => 'string', + 'format' => 'uri', + 'context' => array( 'view', 'edit' ), + ), + 'wc_version' => array( + 'description' => __( 'WooCommerce Version', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'log_directory' => array( + 'description' => __( 'Log Directory', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'log_directory_writable' => array( + 'description' => __( 'Is Log Directory Writable?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'wp_version' => array( + 'description' => __( 'WordPress Version', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'wp_multisite' => array( + 'description' => __( 'Is WordPress Multisite?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'wp_memory_limit' => array( + 'description' => __( 'WordPress Memory Limit', 'woocommerce' ), + 'type' => 'integer', + 'context' => array( 'view', 'edit' ), + ), + 'wp_debug_mode' => array( + 'description' => __( 'Is WordPress Debug Mode Active?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'wp_cron' => array( + 'description' => __( 'Are WordPress Cron Jobs Enabled?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'language' => array( + 'description' => __( 'WordPress Language', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'server_info' => array( + 'description' => __( 'Server Info', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'php_version' => array( + 'description' => __( 'PHP Version', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'php_post_max_size' => array( + 'description' => __( 'PHP Post Max Size', 'woocommerce' ), + 'type' => 'integer', + 'context' => array( 'view', 'edit' ), + ), + 'php_max_execution_time' => array( + 'description' => __( 'PHP Max Execution Time', 'woocommerce' ), + 'type' => 'integer', + 'context' => array( 'view', 'edit' ), + ), + 'php_max_input_vars' => array( + 'description' => __( 'PHP Max Input Vars', 'woocommerce' ), + 'type' => 'integer', + 'context' => array( 'view', 'edit' ), + ), + 'curl_version' => array( + 'description' => __( 'cURL Version', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'suhosin_installed' => array( + 'description' => __( 'Is SUHOSIN Installed?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'max_upload_size' => array( + 'description' => __( 'Max Upload Size', 'woocommerce' ), + 'type' => 'integer', + 'context' => array( 'view', 'edit' ), + ), + 'mysql_version' => array( + 'description' => __( 'MySQL Version', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'default_timezone' => array( + 'description' => __( 'Default Timezone', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'fsockopen_or_curl_enabled' => array( + 'description' => __( 'Is fsockopen/cURL Enabled?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'soapclient_enabled' => array( + 'description' => __( 'Is SoapClient Class Enabled?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'domdocument_enabled' => array( + 'description' => __( 'Is DomDocument Class Enabled?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'gzip_enabled' => array( + 'description' => __( 'Is GZip Enabled?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'mbstring_enabled' => array( + 'description' => __( 'Is mbstring Enabled?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'remote_post_successful' => array( + 'description' => __( 'Remote POST Successful?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'remote_post_response' => array( + 'description' => __( 'Remote POST Response', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'remote_get_successful' => array( + 'description' => __( 'Remote GET Successful?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'remote_get_response' => array( + 'description' => __( 'Remote GET Response', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + ), + ), + 'database' => array( + 'description' => __( 'Database', 'woocommerce' ), + 'type' => 'array', + 'context' => array( 'view', 'edit' ), + 'properties' => array( + 'wc_database_version' => array( + 'description' => __( 'WC Database Version', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'database_prefix' => array( + 'description' => __( 'Database Prefix', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'maxmind_geoip_database' => array( + 'description' => __( 'MaxMind GeoIP Database', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'database_tables' => array( + 'description' => __( 'Database Tables', 'woocommerce' ), + 'type' => 'array', + 'context' => array( 'view', 'edit' ), + ), + ) + ), + 'active_plugins' => array( + 'description' => __( 'Active Plugins', 'woocommerce' ), + 'type' => 'array', + 'context' => array( 'view', 'edit' ), + ), + 'theme' => array( + 'description' => __( 'Theme', 'woocommerce' ), + 'type' => 'array', + 'context' => array( 'view', 'edit' ), + 'properties' => array( + 'name' => array( + 'description' => __( 'Theme Name', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'version' => array( + 'description' => __( 'Theme Version', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'version_latest' => array( + 'description' => __( 'Latest Version Of Theme', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'author_url' => array( + 'description' => __( 'Theme Author URL', 'woocommerce' ), + 'type' => 'string', + 'format' => 'uri', + 'context' => array( 'view', 'edit' ), + ), + 'is_child_theme' => array( + 'description' => __( 'Is this theme a child theme?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'has_woocommerce_support' => array( + 'description' => __( 'Does the theme declare WooCommerce support?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'has_woocommerce_file' => array( + 'description' => __( 'Does the theme have a woocommerce.php file?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'has_outdated_templates' => array( + 'description' => __( 'Does this theme have outdated templates?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'overrides' => array( + 'description' => __( 'Template Overrides', 'woocommerce' ), + 'type' => 'array', + 'context' => array( 'view', 'edit' ), + ), + 'parent_name' => array( + 'description' => __( 'Parent Theme Name', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'parent_version' => array( + 'description' => __( 'Parent Theme Version', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'parent_author_url' => array( + 'description' => __( 'Parent Theme Author URL', 'woocommerce' ), + 'type' => 'string', + 'format' => 'uri', + 'context' => array( 'view', 'edit' ), + ), + ) + ), + 'settings' => array( + 'description' => __( 'Settings', 'woocommerce' ), + 'type' => 'array', + 'context' => array( 'view', 'edit' ), + 'properties' => array( + 'api_enabled' => array( + 'description' => __( 'REST API Enabled?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'force_ssl' => array( + 'description' => __( 'SSL Forced?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'currency' => array( + 'description' => __( 'Currency', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'currency_symbol' => array( + 'description' => __( 'Currency Symbol', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'currency_position' => array( + 'description' => __( 'Currency Position', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'thousand_separator' => array( + 'description' => __( 'Thousand Separator', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'decimal_separator' => array( + 'description' => __( 'Decimal Separator', 'woocommerce' ), + 'type' => 'string', + 'context' => array( 'view', 'edit' ), + ), + 'number_of_decimals' => array( + 'description' => __( 'Number of Decimals', 'woocommerce' ), + 'type' => 'integer', + 'context' => array( 'view', 'edit' ), + ), + 'geolocation_enabled' => array( + 'description' => __( 'Geolocation Enabled?', 'woocommerce' ), + 'type' => 'boolean', + 'context' => array( 'view', 'edit' ), + ), + 'taxonomies' => array( + 'description' => __( 'Taxonomy Terms for Product/Order Statuses', 'woocommerce' ), + 'type' => 'array', + 'context' => array( 'view', 'edit' ), + ), + ) + ), + 'pages' => array( + 'description' => __( 'WooCommerce Pages', 'woocommerce' ), + 'type' => 'array', + 'context' => array( 'view', 'edit' ), + ), + ) + ); + + return $this->add_additional_fields_schema( $schema ); + } + + /** + * Return an array of sections and the data associated with each. + * + * @return array + */ + public function get_item_mappings() { + return array( + 'environment' => $this->get_environment_info(), + 'database' => $this->get_database_info(), + 'active_plugins' => $this->get_active_plugins(), + 'theme' => $this->get_theme_info(), + 'settings' => $this->get_settings(), + 'pages' => $this->get_pages(), + ); + } + + /** + * Get array of environment information. Includes thing like software + * versions, and various server settings. + * + * @return array + */ + public function get_environment_info() { + global $wpdb; + + // Figure out cURL version, if installed. + $curl_version = ''; + if ( function_exists( 'curl_version' ) ) { + $curl_version = curl_version(); + $curl_version = $curl_version['version'] . ', ' . $curl_version['ssl_version']; + } + + // WP memory limit + $wp_memory_limit = wc_let_to_num( WP_MEMORY_LIMIT ); + if ( function_exists( 'memory_get_usage' ) ) { + $wp_memory_limit = max( $wp_memory_limit, wc_let_to_num( @ini_get( 'memory_limit' ) ) ); + } + + // Test POST requests + $post_response = wp_safe_remote_post( 'https://www.paypal.com/cgi-bin/webscr', array( + 'timeout' => 60, + 'user-agent' => 'WooCommerce/' . WC()->version, + 'httpversion' => '1.1', + 'body' => array( + 'cmd' => '_notify-validate' + ) + ) ); + $post_response_successful = false; + if ( ! is_wp_error( $post_response ) && $post_response['response']['code'] >= 200 && $post_response['response']['code'] < 300 ) { + $post_response_successful = true; + } + + // Test GET requests + $get_response = wp_safe_remote_get( 'https://woocommerce.com/wc-api/product-key-api?request=ping&network=' . ( is_multisite() ? '1' : '0' ) ); + $get_response_successful = false; + if ( ! is_wp_error( $post_response ) && $post_response['response']['code'] >= 200 && $post_response['response']['code'] < 300 ) { + $get_response_successful = true; + } + + // Return all environment info. Described by JSON Schema. + return array( + 'home_url' => get_option( 'home' ), + 'site_url' => get_option( 'siteurl' ), + 'version' => WC()->version, + 'log_directory' => WC_LOG_DIR, + 'log_directory_writable' => ( @fopen( WC_LOG_DIR . 'test-log.log', 'a' ) ? true : false ), + 'wp_version' => get_bloginfo('version'), + 'wp_multisite' => is_multisite(), + 'wp_memory_limit' => $wp_memory_limit, + 'wp_debug_mode' => ( defined( 'WP_DEBUG' ) && WP_DEBUG ), + 'wp_cron' => ! ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ), + 'language' => get_locale(), + 'server_info' => $_SERVER['SERVER_SOFTWARE'], + 'php_version' => phpversion(), + 'php_post_max_size' => wc_let_to_num( ini_get( 'post_max_size' ) ), + 'php_max_execution_time' => ini_get( 'max_execution_time' ), + 'php_max_input_vars' => ini_get( 'max_input_vars' ), + 'curl_version' => $curl_version, + 'suhosin_installed' => extension_loaded( 'suhosin' ), + 'max_upload_size' => wp_max_upload_size(), + 'mysql_version' => ( ! empty( $wpdb->is_mysql ) ? $wpdb->db_version() : '' ), + 'default_timezone' => date_default_timezone_get(), + 'fsockopen_or_curl_enabled' => ( function_exists( 'fsockopen' ) || function_exists( 'curl_init' ) ), + 'soapclient_enabled' => class_exists( 'SoapClient' ), + 'domdocument_enabled' => class_exists( 'DOMDocument' ), + 'gzip_enabled' => is_callable( 'gzopen' ), + 'mbstring_enabled' => extension_loaded( 'mbstring' ), + 'remote_post_successful' => $post_response_successful, + 'remote_post_response' => ( is_wp_error( $post_response ) ? $post_response->get_error_message() : $post_response['response']['code'] ), + 'remote_get_successful' => $get_response_successful, + 'remote_get_response' => ( is_wp_error( $get_response ) ? $get_response->get_error_message() : $get_response['response']['code'] ), + ); + } + + /** + * Get array of database information. Version, prefix, and table existence. + * + * @return array + */ + public function get_database_info() { + global $wpdb; + + // WC Core tables to check existence of + $tables = array( + 'woocommerce_sessions', + 'woocommerce_api_keys', + 'woocommerce_attribute_taxonomies', + 'woocommerce_downloadable_product_permissions', + 'woocommerce_order_items', + 'woocommerce_order_itemmeta', + 'woocommerce_tax_rates', + 'woocommerce_tax_rate_locations', + 'woocommerce_shipping_zones', + 'woocommerce_shipping_zone_locations', + 'woocommerce_shipping_zone_methods', + 'woocommerce_payment_tokens', + 'woocommerce_payment_tokenmeta', + ); + + if ( get_option( 'db_version' ) < 34370 ) { + $tables[] = 'woocommerce_termmeta'; + } + $table_exists = array(); + foreach ( $tables as $table ) { + $table_exists[ $table ] = ( $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE %s;", $wpdb->prefix . $table ) ) === $wpdb->prefix . $table ); + } + + // Return all database info. Described by JSON Schema. + return array( + 'wc_database_version' => get_option( 'woocommerce_db_version' ), + 'database_prefix' => $wpdb->prefix, + 'maxmind_geoip_database' => WC_Geolocation::get_local_database_path(), + 'database_tables' => $table_exists, + ); + } + + /** + * Get a list of plugins active on the site. + * + * @return array + */ + public function get_active_plugins() { + require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); + + // Get both site plugins and network plugins + $active_plugins = (array) get_option( 'active_plugins', array() ); + if ( is_multisite() ) { + $network_activated_plugins = array_keys( get_site_option( 'active_sitewide_plugins', array() ) ); + $active_plugins = array_merge( $active_plugins, $network_activated_plugins ); + } + + $active_plugins_data = array(); + foreach ( $active_plugins as $plugin ) { + $data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); + $dirname = dirname( $plugin ); + $theme_version_latest = ''; + if ( strstr( $data['PluginURI'], 'woothemes.com' ) ) { + if ( false === ( $version_data = get_transient( md5( $plugin ) . '_version_data' ) ) ) { + $changelog = wp_safe_remote_get( 'http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $dirname . '/changelog.txt' ); + $cl_lines = explode( "\n", wp_remote_retrieve_body( $changelog ) ); + if ( ! empty( $cl_lines ) ) { + foreach ( $cl_lines as $line_num => $cl_line ) { + if ( preg_match( '/^[0-9]/', $cl_line ) ) { + $date = str_replace( '.' , '-' , trim( substr( $cl_line , 0 , strpos( $cl_line , '-' ) ) ) ); + $version = preg_replace( '~[^0-9,.]~' , '' ,stristr( $cl_line , "version" ) ); + $update = trim( str_replace( "*" , "" , $cl_lines[ $line_num + 1 ] ) ); + $version_data = array( 'date' => $date , 'version' => $version , 'update' => $update , 'changelog' => $changelog ); + set_transient( md5( $plugin ) . '_version_data', $version_data, DAY_IN_SECONDS ); + break; + } + } + } + } + $theme_version_latest = $version_data['version']; + } else { + include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); + $slug = explode( '/', $plugin ); + $slug = explode( '.', end( $slug ) ); + $slug = $slug[0]; + + $api = plugins_api( 'plugin_information', array( + 'slug' => $slug, + 'fields' => array( + 'sections' => false, + 'tags' => false, + ) + ) ); + + if ( is_object( $api ) && ! is_wp_error( $api ) ) { + $theme_version_latest = $api->version; + } + } + + // convert plugin data to json response format. + $active_plugins_data[] = array( + 'plugin' => $plugin, + 'name' => $data['Name'], + 'version' => $data['Version'], + 'version_latest' => $theme_version_latest, + 'url' => $data['PluginURI'], + 'author_name' => $data['AuthorName'], + 'author_url' => esc_url_raw( $data['AuthorURI'] ), + 'network_activated' => $data['Network'], + ); + } + + return $active_plugins_data; + } + + /** + * Get info on the current active theme, info on parent theme (if presnet) + * and a list of template overrides. + * + * @return array + */ + public function get_theme_info() { + $active_theme = wp_get_theme(); + + // Get parent theme info if this theme is a child theme, otherwise + // pass empty info in the response. + if ( is_child_theme() ) { + $parent_theme = wp_get_theme( $active_theme->Template ); + $parent_theme_info = array( + 'parent_name' => $parent_theme->Name, + 'parent_version' => $parent_theme->Version, + 'parent_version_latest' => WC_Admin_Status::get_latest_theme_version( $parent_theme ), + 'parent_author_url' => $parent_theme->{'Author URI'}, + ); + } else { + $parent_theme_info = array( 'parent_name' => '', 'parent_version' => '', 'parent_version_latest' => '', 'parent_author_url' => '' ); + } + + /** + * Scan the theme directory for all WC templates to see if our theme + * overrides any of them. + */ + $override_files = array(); + $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 ) ) { + $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_template_directory() . '/' . $file ) ) { + $theme_file = get_template_directory() . '/' . $file; + } elseif ( file_exists( get_template_directory() . '/woocommerce/' . $file ) ) { + $theme_file = get_template_directory() . '/woocommerce/' . $file; + } else { + $theme_file = false; + } + + if ( ! empty( $theme_file ) ) { + $core_version = WC_Admin_Status::get_file_version( WC()->plugin_path() . '/templates/' . $file ); + $theme_version = WC_Admin_Status::get_file_version( $theme_file ); + if ( $core_version && ( empty( $theme_version ) || version_compare( $theme_version, $core_version, '<' ) ) ) { + if ( ! $outdated_templates ) { + $outdated_templates = true; + } + } + $override_files[] = array( + 'file' => str_replace( WP_CONTENT_DIR . '/themes/', '', $theme_file ), + 'version' => $theme_version, + 'core_version' => $core_version, + ); + } + } + + $active_theme_info = array( + 'name' => $active_theme->Name, + 'version' => $active_theme->Version, + 'version_latest' => WC_Admin_Status::get_latest_theme_version( $active_theme ), + 'author_url' => esc_url_raw( $active_theme->{'Author URI'} ), + 'is_child_theme' => is_child_theme(), + 'has_woocommerce_support' => ( current_theme_supports( 'woocommerce' ) || in_array( $active_theme->template, wc_get_core_supported_themes() ) ), + 'has_woocommerce_file' => ( file_exists( get_stylesheet_directory() . '/woocommerce.php' ) || file_exists( get_template_directory() . '/woocommerce.php' ) ), + 'has_outdated_templates' => $outdated_templates, + 'overrides' => $override_files, + ); + + return array_merge( $active_theme_info, $parent_theme_info ); + } + + /** + * Get some setting values for the site that are useful for debugging + * purposes. For full settings access, use the settings api. + * + * @return array + */ + public function get_settings() { + // Get a list of terms used for product/order taxonomies + $term_response = array(); + $terms = get_terms( 'product_type', array( 'hide_empty' => 0 ) ); + foreach ( $terms as $term ) { + $term_response[ $term->slug ] = strtolower( $term->name ); + } + + // Return array of useful settings for debugging. + return array( + 'api_enabled' => 'yes' === get_option( 'woocommerce_api_enabled' ), + 'force_ssl' => 'yes' === get_option( 'woocommerce_force_ssl_checkout' ), + 'currency' => get_woocommerce_currency(), + 'currency_symbol' => get_woocommerce_currency_symbol(), + 'currency_position' => get_option( 'woocommerce_currency_pos' ), + 'thousand_separator' => wc_get_price_thousand_separator(), + 'decimal_separator' => wc_get_price_decimal_separator(), + 'number_of_decimals' => wc_get_price_decimals(), + 'geolocation_enabled' => in_array( get_option( 'woocommerce_default_customer_address' ), array( 'geolocation_ajax', 'geolocation' ) ), + 'taxonomies' => $term_response, + ); + } + + /** + * Returns a mini-report on WC pages and if they are configured correctly: + * Present, visible, and including the correct shortcode. + * + * @return array + */ + public function get_pages() { + // WC pages to check against + $check_pages = array( + _x( 'Shop Base', 'Page setting', 'woocommerce' ) => array( + 'option' => 'woocommerce_shop_page_id', + 'shortcode' => '', + ), + _x( 'Cart', 'Page setting', 'woocommerce' ) => array( + 'option' => 'woocommerce_cart_page_id', + 'shortcode' => '[' . apply_filters( 'woocommerce_cart_shortcode_tag', 'woocommerce_cart' ) . ']', + ), + _x( 'Checkout', 'Page setting', 'woocommerce' ) => array( + 'option' => 'woocommerce_checkout_page_id', + 'shortcode' => '[' . apply_filters( 'woocommerce_checkout_shortcode_tag', 'woocommerce_checkout' ) . ']', + ), + _x( 'My Account', 'Page setting', 'woocommerce' ) => array( + 'option' => 'woocommerce_myaccount_page_id', + 'shortcode' => '[' . apply_filters( 'woocommerce_my_account_shortcode_tag', 'woocommerce_my_account' ) . ']', + ), + ); + + $pages_output = array(); + foreach ( $check_pages as $page_name => $values ) { + $errors = array(); + $page_id = get_option( $values['option'] ); + $page_set = $page_exists = $page_visible = false; + $shortcode_present = $shortcode_required = false; + + // Page checks + if ( $page_id ) { + $page_set = true; + } + if ( get_post( $page_id ) ) { + $page_exists = true; + } + if ( 'publish' === get_post_status( $page_id ) ) { + $page_visible = true; + } + + // Shortcode checks + if ( $values['shortcode'] && get_post( $page_id ) ) { + $shortcode_required = true; + $page = get_post( $page_id ); + if ( strstr( $page->post_content, $values['shortcode'] ) ) { + $shortcode_present = true; + } + } + + // Wrap up our findings into an output array + $pages_output[] = array( + 'page_name' => $page_name, + 'page_id' => $page_id, + 'page_set' => $page_set, + 'page_exists' => $page_exists, + 'page_visible' => $page_visible, + 'shortcode' => $values['shortcode'], + 'shortcode_required' => $shortcode_required, + 'shortcode_present' => $shortcode_present, + ); + } + + return $pages_output; + } + + /** + * Get any query params needed. + * + * @return array + */ + public function get_collection_params() { + return array( + 'context' => $this->get_context_param( array( 'default' => 'view' ) ), + ); + } + +} diff --git a/includes/class-wc-ajax.php b/includes/class-wc-ajax.php index 2b3ddabb9ed..6fa67474aeb 100644 --- a/includes/class-wc-ajax.php +++ b/includes/class-wc-ajax.php @@ -3243,7 +3243,10 @@ class WC_AJAX { $method_id = $wpdb->get_var( $wpdb->prepare( "SELECT method_id FROM {$wpdb->prefix}woocommerce_shipping_zone_methods WHERE instance_id = %d", $instance_id ) ); if ( isset( $data['deleted'] ) ) { + $shipping_method = WC_Shipping_Zones::get_shipping_method( $instance_id ); + $option_key = $shipping_method->get_instance_option_key(); if ( $wpdb->delete( "{$wpdb->prefix}woocommerce_shipping_zone_methods", array( 'instance_id' => $instance_id ) ) ) { + delete_option( $option_key ); do_action( 'woocommerce_shipping_zone_method_deleted', $instance_id, $method_id, $zone_id ); } continue; diff --git a/includes/class-wc-api.php b/includes/class-wc-api.php index 68d7fa42104..6e3abec8f8d 100644 --- a/includes/class-wc-api.php +++ b/includes/class-wc-api.php @@ -110,10 +110,8 @@ class WC_API extends WC_Legacy_API { * @since 2.6.0 */ private function rest_api_init() { - global $wp_version; - // REST API was included starting WordPress 4.4. - if ( version_compare( $wp_version, 4.4, '<' ) ) { + if ( ! class_exists( 'WP_REST_Server' ) ) { return; } @@ -143,9 +141,11 @@ class WC_API extends WC_Legacy_API { // Abstract controllers. include_once( dirname( __FILE__ ) . '/abstracts/abstract-wc-rest-controller.php' ); include_once( dirname( __FILE__ ) . '/abstracts/abstract-wc-rest-posts-controller.php' ); + include_once( dirname( __FILE__ ) . '/abstracts/abstract-wc-rest-shipping-zones-controller.php' ); include_once( dirname( __FILE__ ) . '/abstracts/abstract-wc-rest-terms-controller.php' ); include_once( dirname( __FILE__ ) . '/abstracts/abstract-wc-settings-api.php' ); + // REST API controllers. include_once( dirname( __FILE__ ) . '/api/class-wc-rest-coupons-controller.php' ); include_once( dirname( __FILE__ ) . '/api/class-wc-rest-customer-downloads-controller.php' ); @@ -165,10 +165,14 @@ class WC_API extends WC_Legacy_API { include_once( dirname( __FILE__ ) . '/api/class-wc-rest-reports-controller.php' ); include_once( dirname( __FILE__ ) . '/api/class-wc-rest-settings-controller.php' ); include_once( dirname( __FILE__ ) . '/api/class-wc-rest-settings-options-controller.php' ); + include_once( dirname( __FILE__ ) . '/api/class-wc-rest-shipping-zones-controller.php' ); + include_once( dirname( __FILE__ ) . '/api/class-wc-rest-shipping-zone-locations-controller.php' ); + include_once( dirname( __FILE__ ) . '/api/class-wc-rest-shipping-zone-methods-controller.php' ); include_once( dirname( __FILE__ ) . '/api/class-wc-rest-tax-classes-controller.php' ); include_once( dirname( __FILE__ ) . '/api/class-wc-rest-taxes-controller.php' ); include_once( dirname( __FILE__ ) . '/api/class-wc-rest-webhook-deliveries.php' ); include_once( dirname( __FILE__ ) . '/api/class-wc-rest-webhooks-controller.php' ); + include_once( dirname( __FILE__ ) . '/api/class-wc-rest-system-status-controller.php' ); } /** @@ -198,10 +202,14 @@ class WC_API extends WC_Legacy_API { 'WC_REST_Reports_Controller', 'WC_REST_Settings_Controller', 'WC_REST_Settings_Options_Controller', + 'WC_REST_Shipping_Zones_Controller', + 'WC_REST_Shipping_Zone_Locations_Controller', + 'WC_REST_Shipping_Zone_Methods_Controller', 'WC_REST_Tax_Classes_Controller', 'WC_REST_Taxes_Controller', 'WC_REST_Webhook_Deliveries_Controller', 'WC_REST_Webhooks_Controller', + 'WC_REST_System_Status_Controller', ); foreach ( $controllers as $controller ) { diff --git a/includes/class-wc-breadcrumb.php b/includes/class-wc-breadcrumb.php index 0b324c41f3c..aba3d2f19cc 100644 --- a/includes/class-wc-breadcrumb.php +++ b/includes/class-wc-breadcrumb.php @@ -74,7 +74,7 @@ class WC_Breadcrumb { 'is_tax' ); - if ( ( ! is_front_page() && ! ( is_post_type_archive() && get_option( 'page_on_front' ) == wc_get_page_id( 'shop' ) ) ) || is_paged() ) { + if ( ( ! is_front_page() && ! ( is_post_type_archive() && intval( get_option( 'page_on_front' ) ) === wc_get_page_id( 'shop' ) ) ) || is_paged() ) { foreach ( $conditionals as $conditional ) { if ( call_user_func( $conditional ) ) { call_user_func( array( $this, 'add_crumbs_' . substr( $conditional, 3 ) ) ); diff --git a/includes/class-wc-form-handler.php b/includes/class-wc-form-handler.php index df46f551b62..4b11ab44fbb 100644 --- a/includes/class-wc-form-handler.php +++ b/includes/class-wc-form-handler.php @@ -211,11 +211,6 @@ class WC_Form_Handler { $user->user_email = $account_email; } - if ( ! empty( $pass1 ) && ! wp_check_password( $pass_cur, $current_user->user_pass, $current_user->ID ) ) { - wc_add_notice( __( 'Your current password is incorrect.', 'woocommerce' ), 'error' ); - $save_pass = false; - } - if ( ! empty( $pass_cur ) && empty( $pass1 ) && empty( $pass2 ) ) { wc_add_notice( __( 'Please fill out all password fields.', 'woocommerce' ), 'error' ); $save_pass = false; @@ -228,6 +223,9 @@ class WC_Form_Handler { } elseif ( ( ! empty( $pass1 ) || ! empty( $pass2 ) ) && $pass1 !== $pass2 ) { wc_add_notice( __( 'New passwords do not match.', 'woocommerce' ), 'error' ); $save_pass = false; + } elseif ( ! empty( $pass1 ) && ! wp_check_password( $pass_cur, $current_user->user_pass, $current_user->ID ) ) { + wc_add_notice( __( 'Your current password is incorrect.', 'woocommerce' ), 'error' ); + $save_pass = false; } if ( $pass1 && $save_pass ) { @@ -873,9 +871,12 @@ class WC_Form_Handler { if ( ! empty( $_POST['login'] ) && wp_verify_nonce( $nonce_value, 'woocommerce-login' ) ) { try { - $creds = array(); - $username = trim( $_POST['username'] ); + $creds = array( + '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'] ); @@ -904,10 +905,17 @@ class WC_Form_Handler { $creds['user_login'] = $username; } - $creds['user_password'] = $_POST['password']; - $creds['remember'] = isset( $_POST['rememberme'] ); - $secure_cookie = is_ssl() ? true : false; - $user = wp_signon( apply_filters( 'woocommerce_login_credentials', $creds ), $secure_cookie ); + // 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 ); + + 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' ); + } + } + + // Perform the login + $user = wp_signon( apply_filters( 'woocommerce_login_credentials', $creds ), is_ssl() ); if ( is_wp_error( $user ) ) { $message = $user->get_error_message(); @@ -987,7 +995,7 @@ class WC_Form_Handler { do_action( 'woocommerce_customer_reset_password', $user ); - wp_redirect( add_query_arg( 'reset', 'true', remove_query_arg( array( 'key', 'login', 'reset-link-sent' ) ) ) ); + wp_redirect( add_query_arg( 'password-reset', 'true', wc_get_page_permalink( 'myaccount' ) ) ); exit; } } diff --git a/includes/class-wc-install.php b/includes/class-wc-install.php index 57bfc7942fe..5bea84ac6bc 100644 --- a/includes/class-wc-install.php +++ b/includes/class-wc-install.php @@ -72,6 +72,9 @@ class WC_Install { 'wc_update_260_refunds', 'wc_update_260_db_version', ), + '2.7.0' => array( + 'wc_update_270_webhooks', + ), ); /** @var object Background update class */ diff --git a/includes/class-wc-logger.php b/includes/class-wc-logger.php index 7a6c19c05b5..54a3b810a59 100644 --- a/includes/class-wc-logger.php +++ b/includes/class-wc-logger.php @@ -124,4 +124,29 @@ class WC_Logger { return $result; } + /** + * Remove/delete the chosen file. + * + * @param string $handle + * + * @return bool + */ + public function remove( $handle ) { + $removed = false; + $file = wc_get_log_file_path( $handle ); + + if ( is_file( $file ) && is_writable( $file ) ) { + // Close first to be certain no processes keep it alive after it is unlinked. + $this->close( $handle ); + $removed = unlink( $file ); + } elseif ( is_file( trailingslashit( WC_LOG_DIR ) . $handle . '.log' ) && is_writable( trailingslashit( WC_LOG_DIR ) . $handle . '.log' ) ) { + $this->close( $handle ); + $removed = unlink( trailingslashit( WC_LOG_DIR ) . $handle . '.log' ); + } + + do_action( 'woocommerce_log_remove', $handle, $removed ); + + return $removed; + } + } diff --git a/includes/class-wc-order-factory.php b/includes/class-wc-order-factory.php index 530104be857..c5da64f000b 100644 --- a/includes/class-wc-order-factory.php +++ b/includes/class-wc-order-factory.php @@ -10,7 +10,7 @@ if ( ! defined( 'ABSPATH' ) ) { * The WooCommerce order factory creating the right order objects. * * @class WC_Order_Factory - * @version 2.2.0 + * @version 2.7.0 * @package WooCommerce/Classes * @category Class * @author WooThemes @@ -23,7 +23,7 @@ class WC_Order_Factory { * @param bool $the_order (default: false) * @return WC_Order|bool */ - public function get_order( $the_order = false ) { + public static function get_order( $the_order = false ) { global $post; if ( false === $the_order ) { @@ -31,7 +31,7 @@ class WC_Order_Factory { } elseif ( is_numeric( $the_order ) ) { $the_order = get_post( $the_order ); } elseif ( $the_order instanceof WC_Order ) { - $the_order = get_post( $the_order->id ); + $the_order = get_post( $the_order->get_id() ); } if ( ! $the_order || ! is_object( $the_order ) ) { @@ -56,4 +56,49 @@ class WC_Order_Factory { return new $classname( $the_order ); } + + /** + * Get order item. + * @param int + * @return WC_Order_Item + */ + public static function get_order_item( $item_id = 0 ) { + global $wpdb; + + if ( is_numeric( $item_id ) ) { + $item_data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}woocommerce_order_items WHERE order_item_id = %d LIMIT 1;", $item_id ) ); + $item_type = $item_data->order_item_type; + } elseif ( $item_id instanceof WC_Order_Item ) { + $item_data = $item_id->get_data(); + $item_type = $item_data->get_type(); + } elseif( is_object( $item_id ) && ! empty( $item_id->order_item_type ) ) { + $item_data = $item_id; + $item_type = $item_id->order_item_type; + } else { + $item_data = false; + $item_type = false; + } + + if ( $item_data && $item_type ) { + switch ( $item_type ) { + case 'line_item' : + case 'product' : + return new WC_Order_Item_Product( $item_data ); + break; + case 'coupon' : + return new WC_Order_Item_Coupon( $item_data ); + break; + case 'fee' : + return new WC_Order_Item_Fee( $item_data ); + break; + case 'shipping' : + return new WC_Order_Item_Shipping( $item_data ); + break; + case 'tax' : + return new WC_Order_Item_Tax( $item_data ); + break; + } + } + return new WC_Order_Item(); + } } diff --git a/includes/class-wc-order-item-coupon.php b/includes/class-wc-order-item-coupon.php new file mode 100644 index 00000000000..8229ed18dde --- /dev/null +++ b/includes/class-wc-order-item-coupon.php @@ -0,0 +1,187 @@ + 0, + 'order_item_id' => 0, + 'code' => '', + 'discount' => 0, + 'discount_tax' => 0, + ); + + /** + * offsetGet for ArrayAccess/Backwards compatibility. + * @deprecated Add deprecation notices in future release. + * @param string $offset + * @return mixed + */ + public function offsetGet( $offset ) { + if ( 'discount_amount' === $offset ) { + $offset = 'discount'; + } elseif ( 'discount_amount_tax' === $offset ) { + $offset = 'discount_tax'; + } + return parent::offsetGet( $offset ); + } + + /** + * offsetSet for ArrayAccess/Backwards compatibility. + * @deprecated Add deprecation notices in future release. + * @param string $offset + * @param mixed $value + */ + public function offsetSet( $offset, $value ) { + if ( 'discount_amount' === $offset ) { + $offset = 'discount'; + } elseif ( 'discount_amount_tax' === $offset ) { + $offset = 'discount_tax'; + } + parent::offsetSet( $offset, $value ); + } + + /** + * offsetExists for ArrayAccess + * @param string $offset + * @return bool + */ + public function offsetExists( $offset ) { + if ( in_array( $offset, array( 'discount_amount', 'discount_amount_tax' ) ) ) { + return true; + } + return parent::offsetExists( $offset ); + } + + /** + * Read/populate data properties specific to this order item. + */ + public function read( $id ) { + parent::read( $id ); + if ( $this->get_id() ) { + $this->set_discount( get_metadata( 'order_item', $this->get_id(), 'discount_amount', true ) ); + $this->set_discount_tax( get_metadata( 'order_item', $this->get_id(), 'discount_amount_tax', true ) ); + } + } + + /** + * Save properties specific to this order item. + * @return int Item ID + */ + public function save() { + parent::save(); + if ( $this->get_id() ) { + wc_update_order_item_meta( $this->get_id(), 'discount_amount', $this->get_discount() ); + wc_update_order_item_meta( $this->get_id(), 'discount_amount_tax', $this->get_discount_tax() ); + } + + return $this->get_id(); + } + + /** + * Internal meta keys we don't want exposed as part of meta_data. + * @return array() + */ + protected function get_internal_meta_keys() { + return array( 'discount_amount', 'discount_amount_tax' ); + } + + /* + |-------------------------------------------------------------------------- + | Setters + |-------------------------------------------------------------------------- + */ + + /** + * Set order item name. + * @param string $value + */ + public function set_name( $value ) { + $this->set_code( $value ); + } + + /** + * Set code. + * @param string $value + */ + public function set_code( $value ) { + $this->_data['code'] = wc_clean( $value ); + } + + /** + * Set discount amount. + * @param string $value + */ + public function set_discount( $value ) { + $this->_data['discount'] = wc_format_decimal( $value ); + } + + /** + * Set discounted tax amount. + * @param string $value + */ + public function set_discount_tax( $value ) { + $this->_data['discount_tax'] = wc_format_decimal( $value ); + } + + /* + |-------------------------------------------------------------------------- + | Getters + |-------------------------------------------------------------------------- + */ + + /** + * Get order item type. + * @return string + */ + public function get_type() { + return 'coupon'; + } + + /** + * Get order item name. + * @return string + */ + public function get_name() { + return $this->get_code(); + } + + /** + * Get coupon code. + * @return string + */ + public function get_code() { + return $this->_data['code']; + } + + /** + * Get discount amount. + * @return string + */ + public function get_discount() { + return wc_format_decimal( $this->_data['discount'] ); + } + + /** + * Get discounted tax amount. + * @return string + */ + public function get_discount_tax() { + return wc_format_decimal( $this->_data['discount_tax'] ); + } +} diff --git a/includes/class-wc-order-item-fee.php b/includes/class-wc-order-item-fee.php new file mode 100644 index 00000000000..47332d6b64f --- /dev/null +++ b/includes/class-wc-order-item-fee.php @@ -0,0 +1,231 @@ + 0, + 'order_item_id' => 0, + 'name' => '', + 'tax_class' => '', + 'tax_status' => 'taxable', + 'total' => '', + 'total_tax' => '', + 'taxes' => array( + 'total' => array() + ) + ); + + /** + * offsetGet for ArrayAccess/Backwards compatibility. + * @deprecated Add deprecation notices in future release. + * @param string $offset + * @return mixed + */ + public function offsetGet( $offset ) { + if ( 'line_total' === $offset ) { + $offset = 'total'; + } elseif ( 'line_tax' === $offset ) { + $offset = 'total_tax'; + } elseif ( 'line_tax_data' === $offset ) { + $offset = 'taxes'; + } + return parent::offsetGet( $offset ); + } + + /** + * offsetSet for ArrayAccess/Backwards compatibility. + * @deprecated Add deprecation notices in future release. + * @param string $offset + * @param mixed $value + */ + public function offsetSet( $offset, $value ) { + if ( 'line_total' === $offset ) { + $offset = 'total'; + } elseif ( 'line_tax' === $offset ) { + $offset = 'total_tax'; + } elseif ( 'line_tax_data' === $offset ) { + $offset = 'taxes'; + } + parent::offsetSet( $offset, $value ); + } + + /** + * offsetExists for ArrayAccess + * @param string $offset + * @return bool + */ + public function offsetExists( $offset ) { + if ( in_array( $offset, array( 'line_total', 'line_tax', 'line_tax_data' ) ) ) { + return true; + } + return parent::offsetExists( $offset ); + } + + /** + * Read/populate data properties specific to this order item. + */ + public function read( $id ) { + parent::read( $id ); + if ( $this->get_id() ) { + $this->set_tax_class( get_metadata( 'order_item', $this->get_id(), '_tax_class', true ) ); + $this->set_tax_status( get_metadata( 'order_item', $this->get_id(), '_tax_status', true ) ); + $this->set_total( get_metadata( 'order_item', $this->get_id(), '_line_total', true ) ); + $this->set_total_tax( get_metadata( 'order_item', $this->get_id(), '_line_tax', true ) ); + $this->set_taxes( get_metadata( 'order_item', $this->get_id(), '_line_tax_data', true ) ); + } + } + + /** + * Save properties specific to this order item. + * @return int Item ID + */ + public function save() { + parent::save(); + if ( $this->get_id() ) { + wc_update_order_item_meta( $this->get_id(), '_tax_class', $this->get_tax_class() ); + wc_update_order_item_meta( $this->get_id(), '_tax_status', $this->get_tax_status() ); + wc_update_order_item_meta( $this->get_id(), '_line_total', $this->get_total() ); + wc_update_order_item_meta( $this->get_id(), '_line_tax', $this->get_total_tax() ); + wc_update_order_item_meta( $this->get_id(), '_line_tax_data', $this->get_taxes() ); + } + + return $this->get_id(); + } + + /* + |-------------------------------------------------------------------------- + | Setters + |-------------------------------------------------------------------------- + */ + + /** + * Set tax class. + * @param string $value + */ + public function set_tax_class( $value ) { + $this->_data['tax_class'] = $value; + } + + /** + * Set tax_status. + * @param string $value + */ + public function set_tax_status( $value ) { + if ( in_array( $value, array( 'taxable', 'none' ) ) ) { + $this->_data['tax_status'] = $value; + } else { + $this->_data['tax_status'] = 'taxable'; + } + } + + /** + * Set total. + * @param string $value + */ + public function set_total( $value ) { + $this->_data['total'] = wc_format_decimal( $value ); + } + + /** + * Set total tax. + * @param string $value + */ + public function set_total_tax( $value ) { + $this->_data['total_tax'] = wc_format_decimal( $value ); + } + + /** + * Set taxes. + * + * This is an array of tax ID keys with total amount values. + * @param array $raw_tax_data + */ + public function set_taxes( $raw_tax_data ) { + $raw_tax_data = maybe_unserialize( $raw_tax_data ); + $tax_data = array( + 'total' => array(), + ); + if ( ! empty( $raw_tax_data['total'] ) ) { + $tax_data['total'] = array_map( 'wc_format_decimal', $raw_tax_data['total'] ); + } + $this->_data['taxes'] = $tax_data; + } + + /* + |-------------------------------------------------------------------------- + | Getters + |-------------------------------------------------------------------------- + */ + + /** + * Get order item name. + * @return string + */ + public function get_name() { + return $this->_data['name'] ? $this->_data['name'] : __( 'Fee', 'woocommerce' ); + } + + /** + * Get order item type. + * @return string + */ + public function get_type() { + return 'fee'; + } + + /** + * Get tax class. + * @return string + */ + public function get_tax_class() { + return $this->_data['tax_class']; + } + + /** + * Get tax status. + * @return string + */ + public function get_tax_status() { + return $this->_data['tax_status']; + } + + /** + * Get total fee. + * @return string + */ + public function get_total() { + return wc_format_decimal( $this->_data['total'] ); + } + + /** + * Get total tax. + * @return string + */ + public function get_total_tax() { + return wc_format_decimal( $this->_data['total_tax'] ); + } + + /** + * Get fee taxes. + * @return array + */ + public function get_taxes() { + return $this->_data['taxes']; + } +} diff --git a/includes/class-wc-order-item-meta.php b/includes/class-wc-order-item-meta.php index aef65beaddf..c20cc28f30b 100644 --- a/includes/class-wc-order-item-meta.php +++ b/includes/class-wc-order-item-meta.php @@ -1,7 +1,6 @@ meta = array_filter( (array) $item ); return; } - $this->item = $item; $this->meta = array_filter( (array) $item['item_meta'] ); $this->product = $product; diff --git a/includes/class-wc-order-item-product.php b/includes/class-wc-order-item-product.php new file mode 100644 index 00000000000..88772eedbbe --- /dev/null +++ b/includes/class-wc-order-item-product.php @@ -0,0 +1,412 @@ + 0, + 'order_item_id' => 0, + 'name' => '', + 'product_id' => 0, + 'variation_id' => 0, + 'qty' => 0, + 'tax_class' => '', + 'subtotal' => 0, + 'subtotal_tax' => 0, + 'total' => 0, + 'total_tax' => 0, + 'taxes' => array( + 'subtotal' => array(), + 'total' => array() + ), + ); + + /** + * offsetGet for ArrayAccess/Backwards compatibility. + * @deprecated Add deprecation notices in future release. + * @param string $offset + * @return mixed + */ + public function offsetGet( $offset ) { + if ( 'line_subtotal' === $offset ) { + $offset = 'subtotal'; + } elseif ( 'line_subtotal_tax' === $offset ) { + $offset = 'subtotal_tax'; + } elseif ( 'line_total' === $offset ) { + $offset = 'total'; + } elseif ( 'line_tax' === $offset ) { + $offset = 'total_tax'; + } elseif ( 'line_tax_data' === $offset ) { + $offset = 'taxes'; + } + return parent::offsetGet( $offset ); + } + + /** + * offsetSet for ArrayAccess/Backwards compatibility. + * @deprecated Add deprecation notices in future release. + * @param string $offset + * @param mixed $value + */ + public function offsetSet( $offset, $value ) { + if ( 'line_subtotal' === $offset ) { + $offset = 'subtotal'; + } elseif ( 'line_subtotal_tax' === $offset ) { + $offset = 'subtotal_tax'; + } elseif ( 'line_total' === $offset ) { + $offset = 'total'; + } elseif ( 'line_tax' === $offset ) { + $offset = 'total_tax'; + } elseif ( 'line_tax_data' === $offset ) { + $offset = 'taxes'; + } + parent::offsetSet( $offset, $value ); + } + + /** + * offsetExists for ArrayAccess + * @param string $offset + * @return bool + */ + public function offsetExists( $offset ) { + if ( in_array( $offset, array( 'line_subtotal', 'line_subtotal_tax', 'line_total', 'line_tax', 'line_tax_data', 'item_meta_array', 'item_meta' ) ) ) { + return true; + } + return parent::offsetExists( $offset ); + } + + /** + * Read/populate data properties specific to this order item. + */ + public function read( $id ) { + parent::read( $id ); + if ( $this->get_id() ) { + $this->set_product_id( get_metadata( 'order_item', $this->get_id(), '_product_id', true ) ); + $this->set_variation_id( get_metadata( 'order_item', $this->get_id(), '_variation_id', true ) ); + $this->set_qty( get_metadata( 'order_item', $this->get_id(), '_qty', true ) ); + $this->set_tax_class( get_metadata( 'order_item', $this->get_id(), '_tax_class', true ) ); + $this->set_subtotal( get_metadata( 'order_item', $this->get_id(), '_line_subtotal', true ) ); + $this->set_subtotal_tax( get_metadata( 'order_item', $this->get_id(), '_line_subtotal_tax', true ) ); + $this->set_total( get_metadata( 'order_item', $this->get_id(), '_line_total', true ) ); + $this->set_total_tax( get_metadata( 'order_item', $this->get_id(), '_line_tax', true ) ); + $this->set_taxes( get_metadata( 'order_item', $this->get_id(), '_line_tax_data', true ) ); + } + } + + /** + * Save properties specific to this order item. + * @return int Item ID + */ + public function save() { + parent::save(); + if ( $this->get_id() ) { + wc_update_order_item_meta( $this->get_id(), '_product_id', $this->get_product_id() ); + wc_update_order_item_meta( $this->get_id(), '_variation_id', $this->get_variation_id() ); + wc_update_order_item_meta( $this->get_id(), '_qty', $this->get_qty() ); + wc_update_order_item_meta( $this->get_id(), '_tax_class', $this->get_tax_class() ); + wc_update_order_item_meta( $this->get_id(), '_line_subtotal', $this->get_subtotal() ); + wc_update_order_item_meta( $this->get_id(), '_line_subtotal_tax', $this->get_subtotal_tax() ); + wc_update_order_item_meta( $this->get_id(), '_line_total', $this->get_total() ); + wc_update_order_item_meta( $this->get_id(), '_line_tax', $this->get_total_tax() ); + wc_update_order_item_meta( $this->get_id(), '_line_tax_data', $this->get_taxes() ); + } + + return $this->get_id(); + } + + /** + * Internal meta keys we don't want exposed as part of meta_data. + * @return array() + */ + protected function get_internal_meta_keys() { + return array( '_product_id', '_variation_id', '_qty', '_tax_class', '_line_subtotal', '_line_subtotal_tax', '_line_total', '_line_tax', '_line_tax_data' ); + } + + /** + * Get the associated product. + * @return WC_Product|bool + */ + public function get_product() { + if ( $this->get_variation_id() ) { + $product = wc_get_product( $this->get_variation_id() ); + } else { + $product = wc_get_product( $this->get_product_id() ); + } + + // Backwards compatible filter from WC_Order::get_product_from_item() + if ( has_filter( 'woocommerce_get_product_from_item' ) ) { + $product = apply_filters( 'woocommerce_get_product_from_item', $product, $this, wc_get_order( $this->get_order_id() ) ); + } + + return apply_filters( 'woocommerce_order_item_product', $product, $this ); + } + + /** + * Get the Download URL. + * @param int $download_id + * @return string + */ + public function get_item_download_url( $download_id ) { + $order = $this->get_order(); + + return $order ? add_query_arg( array( + 'download_file' => $this->get_variation_id() ? $this->get_variation_id() : $this->get_product_id(), + 'order' => $order->get_order_key(), + 'email' => urlencode( $order->get_billing_email() ), + 'key' => $download_id + ), trailingslashit( home_url() ) ) : ''; + } + + /** + * Get any associated downloadable files. + * @return array + */ + public function get_item_downloads() { + global $wpdb; + + $files = array(); + $product = $this->get_product(); + $order = $this->get_order(); + + if ( $product && $order && $product->is_downloadable() && $order->is_download_permitted() ) { + $download_ids = $wpdb->get_col( + $wpdb->prepare( + "SELECT download_id FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions WHERE user_email = %s AND order_key = %s AND product_id = %d ORDER BY permission_id", + $order->get_billing_email(), + $order->get_order_key(), + $this->get_variation_id() ? $this->get_variation_id() : $this->get_product_id() + ) + ); + + foreach ( $download_ids as $download_id ) { + if ( $product->has_file( $download_id ) ) { + $files[ $download_id ] = $product->get_file( $download_id ); + $files[ $download_id ]['download_url'] = $this->get_item_download_url( $download_id ); + } + } + } + + return apply_filters( 'woocommerce_get_item_downloads', $files, $this, $order ); + } + + /** + * Get tax status. + * @return string + */ + public function get_tax_status() { + $product = $this->get_product(); + return $product ? $product->get_tax_status() : 'taxable'; + } + + /* + |-------------------------------------------------------------------------- + | Setters + |-------------------------------------------------------------------------- + */ + + /** + * Set qty. + * @param int $value + */ + public function set_qty( $value ) { + $this->_data['qty'] = wc_stock_amount( $value ); + } + + /** + * Set tax class. + * @param string $value + */ + public function set_tax_class( $value ) { + $this->_data['tax_class'] = $value; + } + + /** + * Set Product ID + * @param int $value + */ + public function set_product_id( $value ) { + $this->_data['product_id'] = absint( $value ); + } + + /** + * Set variation ID. + * @param int $value + */ + public function set_variation_id( $value ) { + $this->_data['variation_id'] = absint( $value ); + } + + /** + * Line subtotal (before discounts). + * @param string $value + */ + public function set_subtotal( $value ) { + $this->_data['subtotal'] = wc_format_decimal( $value ); + } + + /** + * Line total (after discounts). + * @param string $value + */ + public function set_total( $value ) { + $this->_data['total'] = wc_format_decimal( $value ); + } + + /** + * Line subtotal tax (before discounts). + * @param string $value + */ + public function set_subtotal_tax( $value ) { + $this->_data['subtotal_tax'] = wc_format_decimal( $value ); + } + + /** + * Line total tax (after discounts). + * @param string $value + */ + public function set_total_tax( $value ) { + $this->_data['total_tax'] = wc_format_decimal( $value ); + } + + /** + * Set line taxes. + * @param array $raw_tax_data + */ + public function set_taxes( $raw_tax_data ) { + $raw_tax_data = maybe_unserialize( $raw_tax_data ); + $tax_data = array( + 'total' => array(), + 'subtotal' => array() + ); + if ( ! empty( $raw_tax_data['total'] ) && ! empty( $raw_tax_data['subtotal'] ) ) { + $tax_data['total'] = array_map( 'wc_format_decimal', $raw_tax_data['total'] ); + $tax_data['subtotal'] = array_map( 'wc_format_decimal', $raw_tax_data['subtotal'] ); + } + $this->_data['taxes'] = $tax_data; + } + + /** + * Set variation data (stored as meta data - write only). + * @param array $data Key/Value pairs + */ + public function set_variation( $data ) { + foreach ( $data as $key => $value ) { + $this->_meta_data[ str_replace( 'attribute_', '', $key ) ] = $value; + } + } + + /** + * Set properties based on passed in product object. + * @param WC_Product $product + */ + public function set_product( $product ) { + if ( $product ) { + $this->set_product_id( $product->get_id() ); + $this->set_name( $product->get_title() ); + $this->set_tax_class( $product->get_tax_class() ); + $this->set_variation_id( is_callable( array( $product, 'get_variation_id' ) ) ? $product->get_variation_id() : 0 ); + $this->set_variation( is_callable( array( $product, 'get_variation_attributes' ) ) ? $product->get_variation_attributes() : array() ); + } + } + + /* + |-------------------------------------------------------------------------- + | Getters + |-------------------------------------------------------------------------- + */ + + /** + * Get order item type. + * @return string + */ + public function get_type() { + return 'line_item'; + } + + /** + * Get product ID. + * @return int + */ + public function get_product_id() { + return absint( $this->_data['product_id'] ); + } + + /** + * Get variation ID. + * @return int + */ + public function get_variation_id() { + return absint( $this->_data['variation_id'] ); + } + + /** + * Get qty. + * @return int + */ + public function get_qty() { + return wc_stock_amount( $this->_data['qty'] ); + } + + /** + * Get tax class. + * @return string + */ + public function get_tax_class() { + return $this->_data['tax_class']; + } + + /** + * Get subtotal. + * @return string + */ + public function get_subtotal() { + return wc_format_decimal( $this->_data['subtotal'] ); + } + + /** + * Get subtotal tax. + * @return string + */ + public function get_subtotal_tax() { + return wc_format_decimal( $this->_data['subtotal_tax'] ); + } + + /** + * Get total. + * @return string + */ + public function get_total() { + return wc_format_decimal( $this->_data['total'] ); + } + + /** + * Get total tax. + * @return string + */ + public function get_total_tax() { + return wc_format_decimal( $this->_data['total_tax'] ); + } + + /** + * Get fee taxes. + * @return array + */ + public function get_taxes() { + return $this->_data['taxes']; + } +} diff --git a/includes/class-wc-order-item-shipping.php b/includes/class-wc-order-item-shipping.php new file mode 100644 index 00000000000..ba51826e5cf --- /dev/null +++ b/includes/class-wc-order-item-shipping.php @@ -0,0 +1,233 @@ + 0, + 'order_item_id' => 0, + 'method_title' => '', + 'method_id' => '', + 'total' => 0, + 'total_tax' => 0, + 'taxes' => array( + 'total' => array() + ), + ); + + /** + * offsetGet for ArrayAccess/Backwards compatibility. + * @deprecated Add deprecation notices in future release. + * @param string $offset + * @return mixed + */ + public function offsetGet( $offset ) { + if ( 'cost' === $offset ) { + $offset = 'total'; + } + return parent::offsetGet( $offset ); + } + + /** + * offsetSet for ArrayAccess/Backwards compatibility. + * @deprecated Add deprecation notices in future release. + * @param string $offset + * @param mixed $value + */ + public function offsetSet( $offset, $value ) { + if ( 'cost' === $offset ) { + $offset = 'total'; + } + parent::offsetSet( $offset, $value ); + } + + /** + * offsetExists for ArrayAccess + * @param string $offset + * @return bool + */ + public function offsetExists( $offset ) { + if ( in_array( $offset, array( 'cost' ) ) ) { + return true; + } + return parent::offsetExists( $offset ); + } + + /** + * Read/populate data properties specific to this order item. + */ + public function read( $id ) { + parent::read( $id ); + if ( $this->get_id() ) { + $this->set_method_id( get_metadata( 'order_item', $this->get_id(), 'method_id', true ) ); + $this->set_total( get_metadata( 'order_item', $this->get_id(), 'cost', true ) ); + $this->set_total_tax( get_metadata( 'order_item', $this->get_id(), 'total_tax', true ) ); + $this->set_taxes( get_metadata( 'order_item', $this->get_id(), 'taxes', true ) ); + } + } + + /** + * Save properties specific to this order item. + * @return int Item ID + */ + public function save() { + parent::save(); + if ( $this->get_id() ) { + wc_update_order_item_meta( $this->get_id(), 'method_id', $this->get_method_id() ); + wc_update_order_item_meta( $this->get_id(), 'cost', $this->get_total() ); + wc_update_order_item_meta( $this->get_id(), 'total_tax', $this->get_total_tax() ); + wc_update_order_item_meta( $this->get_id(), 'taxes', $this->get_taxes() ); + } + + return $this->get_id(); + } + + /** + * Internal meta keys we don't want exposed as part of meta_data. + * @return array() + */ + protected function get_internal_meta_keys() { + return array( 'method_id', 'cost', 'total_tax', 'taxes' ); + } + + /* + |-------------------------------------------------------------------------- + | Setters + |-------------------------------------------------------------------------- + */ + + /** + * Set order item name. + * @param string $value + */ + public function set_name( $value ) { + $this->set_method_title( $value ); + } + + /** + * Set code. + * @param string $value + */ + public function set_method_title( $value ) { + $this->_data['method_title'] = wc_clean( $value ); + } + + /** + * Set shipping method id. + * @param string $value + */ + public function set_method_id( $value ) { + $this->_data['method_id'] = wc_clean( $value ); + } + + /** + * Set total. + * @param string $value + */ + public function set_total( $value ) { + $this->_data['total'] = wc_format_decimal( $value ); + } + + /** + * Set total tax. + * @param string $value + */ + public function set_total_tax( $value ) { + $this->_data['total_tax'] = wc_format_decimal( $value ); + } + + /** + * Set taxes. + * + * This is an array of tax ID keys with total amount values. + * @param array $raw_tax_data + */ + public function set_taxes( $raw_tax_data ) { + $raw_tax_data = maybe_unserialize( $raw_tax_data ); + $tax_data = array( + 'total' => array() + ); + if ( ! empty( $raw_tax_data['total'] ) ) { + $tax_data['total'] = array_map( 'wc_format_decimal', $raw_tax_data['total'] ); + } + $this->_data['taxes'] = $tax_data; + $this->set_total_tax( array_sum( $tax_data['total'] ) ); + } + + /* + |-------------------------------------------------------------------------- + | Getters + |-------------------------------------------------------------------------- + */ + + /** + * Get order item type. + * @return string + */ + public function get_type() { + return 'shipping'; + } + + /** + * Get order item name. + * @return string + */ + public function get_name() { + return $this->get_method_title(); + } + + /** + * Get title. + * @return string + */ + public function get_method_title() { + return $this->_data['method_title'] ? $this->_data['method_title'] : __( 'Shipping', 'woocommerce' ); + } + + /** + * Get method ID. + * @return string + */ + public function get_method_id() { + return $this->_data['method_id']; + } + + /** + * Get total cost. + * @return string + */ + public function get_total() { + return wc_format_decimal( $this->_data['total'] ); + } + + /** + * Get total tax. + * @return string + */ + public function get_total_tax() { + return wc_format_decimal( $this->_data['total_tax'] ); + } + + /** + * Get taxes. + * @return array + */ + public function get_taxes() { + return $this->_data['taxes']; + } +} diff --git a/includes/class-wc-order-item-tax.php b/includes/class-wc-order-item-tax.php new file mode 100644 index 00000000000..5a3cc70a442 --- /dev/null +++ b/includes/class-wc-order-item-tax.php @@ -0,0 +1,210 @@ + 0, + 'order_item_id' => 0, + 'rate_code' => '', + 'rate_id' => 0, + 'label' => '', + 'compound' => false, + 'tax_total' => 0, + 'shipping_tax_total' => 0 + ); + + /** + * Read/populate data properties specific to this order item. + */ + public function read( $id ) { + parent::read( $id ); + if ( $this->get_id() ) { + $this->set_rate_id( get_metadata( 'order_item', $this->get_id(), 'rate_id', true ) ); + $this->set_label( get_metadata( 'order_item', $this->get_id(), 'label', true ) ); + $this->set_compound( get_metadata( 'order_item', $this->get_id(), 'compound', true ) ); + $this->set_tax_total( get_metadata( 'order_item', $this->get_id(), 'tax_amount', true ) ); + $this->set_shipping_tax_total( get_metadata( 'order_item', $this->get_id(), 'shipping_tax_amount', true ) ); + } + } + + /** + * Save properties specific to this order item. + * @return int Item ID + */ + public function save() { + parent::save(); + if ( $this->get_id() ) { + wc_update_order_item_meta( $this->get_id(), 'rate_id', $this->get_rate_id() ); + wc_update_order_item_meta( $this->get_id(), 'label', $this->get_label() ); + wc_update_order_item_meta( $this->get_id(), 'compound', $this->get_compound() ); + wc_update_order_item_meta( $this->get_id(), 'tax_amount', $this->get_tax_total() ); + wc_update_order_item_meta( $this->get_id(), 'shipping_tax_amount', $this->get_shipping_tax_total() ); + } + + return $this->get_id(); + } + + /** + * Internal meta keys we don't want exposed as part of meta_data. + * @return array() + */ + protected function get_internal_meta_keys() { + return array( 'rate_id', 'label', 'compound', 'tax_amount', 'shipping_tax_amount' ); + } + + /** + * Is this a compound tax rate? + * @return boolean + */ + public function is_compound() { + return $this->get_compound(); + } + + /* + |-------------------------------------------------------------------------- + | Setters + |-------------------------------------------------------------------------- + */ + + /** + * Set order item name. + * @param string $value + */ + public function set_name( $value ) { + $this->set_rate_code( $value ); + } + + /** + * Set item name. + * @param string $value + */ + public function set_rate_code( $value ) { + $this->_data['rate_code'] = wc_clean( $value ); + } + + /** + * Set item name. + * @param string $value + */ + public function set_label( $value ) { + $this->_data['label'] = wc_clean( $value ); + } + + /** + * Set tax rate id. + * @param int $value + */ + public function set_rate_id( $value ) { + $this->_data['rate_id'] = absint( $value ); + } + + /** + * Set tax total. + * @param string $value + */ + public function set_tax_total( $value ) { + $this->_data['tax_total'] = wc_format_decimal( $value ); + } + + /** + * Set shipping_tax_total + * @param string $value + */ + public function set_shipping_tax_total( $value ) { + $this->_data['shipping_tax_total'] = wc_format_decimal( $value ); + } + + /** + * Set compound + * @param bool $value + */ + public function set_compound( $value ) { + $this->_data['compound'] = (bool) $value; + } + + /* + |-------------------------------------------------------------------------- + | Getters + |-------------------------------------------------------------------------- + */ + + /** + * Get order item type. + * @return string + */ + public function get_type() { + return 'tax'; + } + + /** + * Get rate code/name. + * @return string + */ + public function get_name() { + return $this->get_rate_code(); + } + + /** + * Get rate code/name. + * @return string + */ + public function get_rate_code() { + return $this->_data['rate_code']; + } + + /** + * Get label. + * @return string + */ + public function get_label() { + return $this->_data['label'] ? $this->_data['label'] : __( 'Tax', 'woocommerce' ); + } + + /** + * Get tax rate ID. + * @return int + */ + public function get_rate_id() { + return absint( $this->_data['rate_id'] ); + } + + /** + * Get tax_total + * @return string + */ + public function get_tax_total() { + return wc_format_decimal( $this->_data['tax_total'] ); + } + + /** + * Get shipping_tax_total + * @return string + */ + public function get_shipping_tax_total() { + return wc_format_decimal( $this->_data['shipping_tax_total'] ); + } + + /** + * Get compound. + * @return bool + */ + public function get_compound() { + return (bool) $this->_data['compound']; + } +} diff --git a/includes/class-wc-order-item.php b/includes/class-wc-order-item.php new file mode 100644 index 00000000000..c728ba84942 --- /dev/null +++ b/includes/class-wc-order-item.php @@ -0,0 +1,428 @@ + 0, + 'order_item_id' => 0, + 'name' => '', + 'type' => '', + ); + + /** + * May store an order to prevent retriving it multiple times. + * @var object + */ + protected $_order; + + /** + * Stores meta in cache for future reads. + * A group must be set to to enable caching. + * @var string + */ + protected $_cache_group = 'order_itemmeta'; + + /** + * Meta type. This should match up with + * the types avaiable at https://codex.wordpress.org/Function_Reference/add_metadata. + * WP defines 'post', 'user', 'comment', and 'term'. + */ + protected $_meta_type = 'order_item'; + + /** + * Constructor. + * @param int|object|array $order_item ID to load from the DB (optional) or already queried data. + */ + public function __construct( $item = 0 ) { + if ( $item instanceof WC_Order_Item ) { + if ( $this->is_type( $item->get_type() ) ) { + $this->set_all( $item->get_data() ); + } + } elseif ( is_array( $item ) ) { + $this->set_all( $item ); + } else { + $this->read( $item ); + } + } + + /** + * Set all data based on input array. + * @param array $data + * @access private + */ + public function set_all( $data ) { + foreach ( $data as $key => $value ) { + if ( is_callable( array( $this, "set_$key" ) ) ) { + $this->{"set_$key"}( $value ); + } else { + $this->_data[ $key ] = $value; + } + } + } + + /** + * Type checking + * @param string|array $Type + * @return boolean + */ + public function is_type( $type ) { + return is_array( $type ) ? in_array( $this->get_type(), $type ) : $type === $this->get_type(); + } + + /** + * Get qty. + * @return int + */ + public function get_qty() { + return 1; + } + + /** + * Get parent order object. + * @return int + */ + public function get_order() { + if ( ! $this->_order ) { + $this->_order = wc_get_order( $this->get_order_id() ); + } + return $this->_order; + } + + /* + |-------------------------------------------------------------------------- + | Getters + |-------------------------------------------------------------------------- + */ + + /** + * Get order item ID. + * @return int + */ + public function get_id() { + return $this->get_order_item_id(); + } + + /** + * Get order ID this meta belongs to. + * @return int + */ + public function get_order_id() { + return absint( $this->_data['order_id'] ); + } + + /** + * Get order item ID this meta belongs to. + * @return int + */ + protected function get_order_item_id() { + return absint( $this->_data['order_item_id'] ); + } + + /** + * Get order item name. + * @return string + */ + public function get_name() { + return $this->_data['name']; + } + + /** + * Get order item type. + * @return string + */ + public function get_type() { + return $this->_data['type']; + } + + /* + |-------------------------------------------------------------------------- + | Setters + |-------------------------------------------------------------------------- + */ + + /** + * Set ID + * @param int $value + */ + public function set_id( $value ) { + $this->set_order_item_id( $value ); + } + + /** + * Set order ID. + * @param int $value + */ + public function set_order_id( $value ) { + $this->_data['order_id'] = absint( $value ); + } + + /** + * Set order item ID. + * @param int $value + */ + protected function set_order_item_id( $value ) { + $this->_data['order_item_id'] = absint( $value ); + } + + /** + * Set order item name. + * @param string $value + */ + public function set_name( $value ) { + $this->_data['name'] = wc_clean( $value ); + } + + /** + * Set order item type. + * @param string $value + */ + protected function set_type( $value ) { + $this->_data['type'] = wc_clean( $value ); + } + + /* + |-------------------------------------------------------------------------- + | CRUD methods + |-------------------------------------------------------------------------- + | + | Methods which create, read, update and delete data from the database. + | + */ + + /** + * Insert data into the database. + * @since 2.7.0 + */ + public function create() { + global $wpdb; + + $wpdb->insert( $wpdb->prefix . 'woocommerce_order_items', array( + 'order_item_name' => $this->get_name(), + 'order_item_type' => $this->get_type(), + 'order_id' => $this->get_order_id() + ) ); + $this->set_id( $wpdb->insert_id ); + + do_action( 'woocommerce_new_order_item', $this->get_id(), $this, $this->get_order_id() ); + } + + /** + * Update data in the database. + * @since 2.7.0 + */ + public function update() { + global $wpdb; + + $wpdb->update( $wpdb->prefix . 'woocommerce_order_items', array( + 'order_item_name' => $this->get_name(), + 'order_item_type' => $this->get_type(), + 'order_id' => $this->get_order_id() + ), array( 'order_item_id' => $this->get_id() ) ); + + do_action( 'woocommerce_update_order_item', $this->get_id(), $this, $this->get_order_id() ); + } + + /** + * Read from the database. + * @since 2.7.0 + * @param int|object $item ID of object to read, or already queried object. + */ + public function read( $item ) { + global $wpdb; + + if ( is_numeric( $item ) && ! empty( $item ) ) { + $data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}woocommerce_order_items WHERE order_item_id = %d LIMIT 1;", $item ) ); + } elseif ( ! empty( $item->order_item_id ) ) { + $data = $item; + } else { + $data = false; + } + + if ( $data ) { + $this->set_order_id( $data->order_id ); + $this->set_id( $data->order_item_id ); + $this->set_name( $data->order_item_name ); + $this->set_type( $data->order_item_type ); + $this->read_meta_data(); + } + } + + /** + * Save data to the database. + * @since 2.7.0 + * @return int Item ID + */ + public function save() { + if ( ! $this->get_id() ) { + $this->create(); + } else { + $this->update(); + } + $this->save_meta_data(); + + return $this->get_id(); + } + + /** + * Delete data from the database. + * @since 2.7.0 + */ + public function delete() { + if ( $this->get_id() ) { + global $wpdb; + do_action( 'woocommerce_before_delete_order_item', $this->get_id() ); + $wpdb->delete( $wpdb->prefix . 'woocommerce_order_items', array( 'order_item_id' => $this->get_id() ) ); + $wpdb->delete( $wpdb->prefix . 'woocommerce_order_itemmeta', array( 'order_item_id' => $this->get_id() ) ); + do_action( 'woocommerce_delete_order_item', $this->get_id() ); + } + } + + /* + |-------------------------------------------------------------------------- + | Meta Data Handling + |-------------------------------------------------------------------------- + */ + + /** + * Expands things like term slugs before return. + * @param string $hideprefix (default: _) + * @return array + */ + public function get_formatted_meta_data( $hideprefix = '_' ) { + $formatted_meta = array(); + $meta_data = $this->get_meta_data(); + + foreach ( $meta_data as $meta ) { + if ( "" === $meta->value || is_serialized( $meta->value ) || ( ! empty( $hideprefix ) && substr( $meta->key, 0, 1 ) === $hideprefix ) ) { + continue; + } + + $attribute_key = urldecode( str_replace( 'attribute_', '', $meta->key ) ); + $display_key = wc_attribute_label( $attribute_key, is_callable( array( $this, 'get_product' ) ) ? $this->get_product() : false ); + $display_value = $meta->value; + + if ( taxonomy_exists( $attribute_key ) ) { + $term = get_term_by( 'slug', $meta->value, $attribute_key ); + if ( ! is_wp_error( $term ) && is_object( $term ) && $term->name ) { + $display_value = $term->name; + } + } + + $formatted_meta[ $meta->meta_id ] = (object) array( + 'key' => $meta->key, + 'value' => $meta->key, + 'display_key' => apply_filters( 'woocommerce_order_item_display_meta_key', $display_key ), + 'display_value' => apply_filters( 'woocommerce_order_item_display_meta_value', $display_value ), + ); + } + + return $formatted_meta; + } + + /* + |-------------------------------------------------------------------------- + | Array Access Methods + |-------------------------------------------------------------------------- + | + | For backwards compat with legacy arrays. + | + */ + + /** + * offsetSet for ArrayAccess + * @param string $offset + * @param mixed $value + */ + public function offsetSet( $offset, $value ) { + if ( 'item_meta_array' === $offset ) { + foreach ( $value as $meta_id => $meta ) { + $this->update_meta_data( $meta->key, $meta->value, $meta_id ); + } + return; + } + + if ( array_key_exists( $offset, $this->_data ) ) { + $this->_data[ $offset ] = $value; + } + + $this->update_meta_data( '_' . $offset, $value ); + } + + /** + * offsetUnset for ArrayAccess + * @param string $offset + */ + public function offsetUnset( $offset ) { + if ( 'item_meta_array' === $offset || 'item_meta' === $offset ) { + $this->_meta_data = array(); + return; + } + + if ( array_key_exists( $offset, $this->_data ) ) { + unset( $this->_data[ $offset ] ); + } + + $this->delete_meta_data( '_' . $offset ); + } + + /** + * offsetExists for ArrayAccess + * @param string $offset + * @return bool + */ + public function offsetExists( $offset ) { + if ( 'item_meta_array' === $offset || 'item_meta' === $offset || array_key_exists( $offset, $this->_data ) ) { + return true; + } + return array_key_exists( '_' . $offset, wp_list_pluck( $this->_meta_data, 'value', 'key' ) ); + } + + /** + * offsetGet for ArrayAccess + * @param string $offset + * @return mixed + */ + public function offsetGet( $offset ) { + if ( 'item_meta_array' === $offset ) { + $return = array(); + + foreach ( $this->_meta_data as $meta ) { + $return[ $meta->meta_id ] = $meta; + } + + return $return; + } + + $meta_values = wp_list_pluck( $this->_meta_data, 'value', 'key' ); + + if ( 'item_meta' === $offset ) { + return $meta_values; + } elseif ( array_key_exists( $offset, $this->_data ) ) { + return $this->_data[ $offset ]; + } elseif ( array_key_exists( '_' . $offset, $meta_values ) ) { + // Item meta was expanded in previous versions, with prefixes removed. This maintains support. + return $meta_values[ '_' . $offset ]; + } + + return null; + } +} diff --git a/includes/class-wc-order-refund.php b/includes/class-wc-order-refund.php index b3ab4ce106e..46f0f5efc62 100644 --- a/includes/class-wc-order-refund.php +++ b/includes/class-wc-order-refund.php @@ -1,113 +1,191 @@ _data = array_merge( $this->_data, array( + 'refund_amount' => '', + 'refund_reason' => '', + 'refunded_by' => 0, + ) ); + parent::__construct( $order ); + } /** - * Init/load the refund object. Called from the constructor. - * - * @param string|int|object|WC_Order_Refund $refund Refund to init - * @uses WP_POST + * Insert data into the database. + * @since 2.7.0 */ - protected function init( $refund ) { - if ( is_numeric( $refund ) ) { - $this->id = absint( $refund ); - $this->post = get_post( $refund ); - $this->get_refund( $this->id ); - } elseif ( $refund instanceof WC_Order_Refund ) { - $this->id = absint( $refund->id ); - $this->post = $refund->post; - $this->get_refund( $this->id ); - } elseif ( isset( $refund->ID ) ) { - $this->id = absint( $refund->ID ); - $this->post = $refund; - $this->get_refund( $this->id ); + public function create() { + parent::create(); + + // Store additonal order data + if ( $this->get_id() ) { + $this->update_post_meta( '_refund_amount', $this->get_refund_amount() ); + $this->update_post_meta( '_refunded_by', $this->get_refunded_by() ); + $this->update_post_meta( '_refund_reason', $this->get_refund_reason() ); } } /** - * Gets an refund from the database. - * - * @since 2.2 - * @param int $id - * @return bool + * Read from the database. + * @since 2.7.0 + * @param int $id ID of object to read. */ - public function get_refund( $id = 0 ) { - if ( ! $id ) { - return false; + public function read( $id ) { + parent::read( $id ); + + // Read additonal order data + if ( $this->get_id() ) { + $post_object = get_post( $id ); + $this->set_refund_amount( get_post_meta( $this->get_id(), '_refund_amount', true ) ); + + // post_author was used before refunded_by meta. + $this->set_refunded_by( metadata_exists( 'post', $this->get_id(), '_refunded_by' ) ? get_post_meta( $this->get_id(), '_refunded_by', true ) : absint( $post_object->post_author ) ); + + // post_excerpt was used before refund_reason meta. + $this->set_refund_reason( metadata_exists( 'post', $this->get_id(), '_refund_reason' ) ? get_post_meta( $this->get_id(), '_refund_reason', true ) : absint( $post_object->post_excerpt ) ); } - - if ( $result = get_post( $id ) ) { - $this->populate( $result ); - - return true; - } - - return false; } /** - * Populates an refund from the loaded post data. - * - * @param mixed $result + * Update data in the database. + * @since 2.7.0 */ - public function populate( $result ) { - // Standard post data - $this->id = $result->ID; - $this->date = $result->post_date; - $this->modified_date = $result->post_modified; - $this->reason = $result->post_excerpt; + public function update() { + parent::update(); + + // Store additonal order data + $this->update_post_meta( '_refund_amount', $this->get_refund_amount() ); + $this->update_post_meta( '_refunded_by', $this->get_refunded_by() ); + $this->update_post_meta( '_refund_reason', $this->get_refund_reason() ); + } + + /** + * Get internal type (post type.) + * @return string + */ + public function get_type() { + return 'shop_order_refund'; + } + + /** + * Get a title for the new post type. + */ + protected function get_post_title() { + return sprintf( __( 'Refund – %s', 'woocommerce' ), strftime( _x( '%b %d, %Y @ %I:%M %p', 'Order date parsed by strftime', 'woocommerce' ) ) ); + } + + /** + * Set refunded amount. + * @param string $value + */ + public function set_refund_amount( $value ) { + $this->_data['refund_amount'] = wc_format_decimal( $value ); } /** * Get refunded amount. - * * @since 2.2 * @return int|float */ public function get_refund_amount() { - return apply_filters( 'woocommerce_refund_amount', (double) $this->refund_amount, $this ); + return apply_filters( 'woocommerce_refund_amount', (double) $this->_data['refund_amount'], $this ); } /** * Get formatted refunded amount. - * * @since 2.4 * @return string */ public function get_formatted_refund_amount() { - return apply_filters( 'woocommerce_formatted_refund_amount', wc_price( $this->refund_amount, array('currency' => $this->get_order_currency()) ), $this ); + return apply_filters( 'woocommerce_formatted_refund_amount', wc_price( $this->get_refund_amount(), array( 'currency' => $this->get_currency() ) ), $this ); } + /** + * Set refund reason. + * @param string $value + */ + public function set_refund_reason( $value ) { + $this->_data['refund_reason'] = $value; + } /** - * Get refunded amount. - * + * Get refund reason. * @since 2.2 * @return int|float */ public function get_refund_reason() { - return apply_filters( 'woocommerce_refund_reason', $this->reason, $this ); + return apply_filters( 'woocommerce_refund_reason', $this->_data['refund_reason'], $this ); + } + + /** + * Set refunded by. + * @param int $value + */ + public function set_refunded_by( $value ) { + $this->_data['refunded_by'] = absint( $value ); + } + + /** + * Get ID of user who did the refund. + * @since 2.7 + * @return int + */ + public function get_refunded_by() { + return absint( $this->_data['refunded_by'] ); + } + + /** + * Magic __get method for backwards compatibility. + * @param string $key + * @return mixed + */ + public function __get( $key ) { + _doing_it_wrong( $key, 'Refund properties should not be accessed directly.', '2.7' ); + + /** + * Maps legacy vars to new getters. + */ + if ( 'reason' === $key ) { + return $this->get_refund_reason(); + } elseif ( 'refund_amount' === $key ) { + return $this->get_refund_amount(); + } + return parent::__get( $key ); + } + + /** + * Gets an refund from the database. + * @deprecated 2.7 + * @param int $id (default: 0). + * @return bool + */ + public function get_refund( $id = 0 ) { + _deprecated_function( 'get_refund', '2.7', 'read' ); + if ( ! $id ) { + return false; + } + if ( $result = get_post( $id ) ) { + $this->populate( $result ); + return true; + } + return false; } } diff --git a/includes/class-wc-order.php b/includes/class-wc-order.php index d8ff76290ce..df383a3dba9 100644 --- a/includes/class-wc-order.php +++ b/includes/class-wc-order.php @@ -1,11 +1,13 @@ _data = array_merge( $this->_data, array( + 'billing' => array( + 'first_name' => '', + 'last_name' => '', + 'company' => '', + 'address_1' => '', + 'address_2' => '', + 'city' => '', + 'state' => '', + 'postcode' => '', + 'country' => '', + 'email' => '', + 'phone' => '', + ), + 'shipping' => array( + 'first_name' => '', + 'last_name' => '', + 'company' => '', + 'address_1' => '', + 'address_2' => '', + 'city' => '', + 'state' => '', + 'postcode' => '', + 'country' => '', + ), + 'payment_method' => '', + 'payment_method_title' => '', + 'transaction_id' => '', + 'customer_ip_address' => '', + 'customer_user_agent' => '', + 'created_via' => '', + 'customer_note' => '', + 'date_completed' => '', + 'date_paid' => '', + 'cart_hash' => '', + ) ); + parent::__construct( $order ); + } + + /** + * When a payment is complete this function is called. + * + * Most of the time this should mark an order as 'processing' so that admin can process/post the items. + * If the cart contains only downloadable items then the order is 'completed' since the admin needs to take no action. + * Stock levels are reduced at this point. + * Sales are also recorded for products. + * Finally, record the date of payment. + * + * Order must exist. + * + * @param string $transaction_id Optional transaction id to store in post meta. + * @return bool success + */ + public function payment_complete( $transaction_id = '' ) { + if ( ! $this->get_id() ) { + return false; + } + + do_action( 'woocommerce_pre_payment_complete', $this->get_id() ); + + if ( ! empty( WC()->session ) ) { + WC()->session->set( 'order_awaiting_payment', false ); + } + + if ( $this->has_status( apply_filters( 'woocommerce_valid_order_statuses_for_payment_complete', array( 'on-hold', 'pending', 'failed', 'cancelled' ), $this ) ) ) { + $order_needs_processing = false; + + if ( sizeof( $this->get_items() ) > 0 ) { + foreach ( $this->get_items() as $item ) { + if ( $item->is_type( 'line_item' ) && ( $product = $item->get_product() ) ) { + $virtual_downloadable_item = $product->is_downloadable() && $product->is_virtual(); + + if ( apply_filters( 'woocommerce_order_item_needs_processing', ! $virtual_downloadable_item, $product, $this->get_id() ) ) { + $order_needs_processing = true; + break; + } + } + } + } + + if ( ! empty( $transaction_id ) ) { + $this->set_transaction_id( $transaction_id ); + } + + $this->set_status( apply_filters( 'woocommerce_payment_complete_order_status', $order_needs_processing ? 'processing' : 'completed', $this->get_id() ) ); + $this->set_date_paid( current_time( 'timestamp' ) ); + $this->save(); + + do_action( 'woocommerce_payment_complete', $this->get_id() ); + } else { + do_action( 'woocommerce_payment_complete_order_status_' . $this->get_status(), $this->get_id() ); + } + + return true; + } /** * Gets order total - formatted for display. - * * @return string */ public function get_formatted_order_total( $tax_display = '', $display_refunded = true ) { - $formatted_total = wc_price( $this->get_total(), array( 'currency' => $this->get_order_currency() ) ); + $formatted_total = wc_price( $this->get_total(), array( 'currency' => $this->get_currency() ) ); $order_total = $this->get_total(); $total_refunded = $this->get_total_refunded(); $tax_string = ''; @@ -35,12 +160,12 @@ class WC_Order extends WC_Abstract_Order { if ( 'itemized' == get_option( 'woocommerce_tax_total_display' ) ) { foreach ( $this->get_tax_totals() as $code => $tax ) { - $tax_amount = ( $total_refunded && $display_refunded ) ? wc_price( WC_Tax::round( $tax->amount - $this->get_total_tax_refunded_by_rate_id( $tax->rate_id ) ), array( 'currency' => $this->get_order_currency() ) ) : $tax->formatted_amount; + $tax_amount = ( $total_refunded && $display_refunded ) ? wc_price( WC_Tax::round( $tax->amount - $this->get_total_tax_refunded_by_rate_id( $tax->rate_id ) ), array( 'currency' => $this->get_currency() ) ) : $tax->formatted_amount; $tax_string_array[] = sprintf( '%s %s', $tax_amount, $tax->label ); } } else { $tax_amount = ( $total_refunded && $display_refunded ) ? $this->get_total_tax() - $this->get_total_tax_refunded() : $this->get_total_tax(); - $tax_string_array[] = sprintf( '%s %s', wc_price( $tax_amount, array( 'currency' => $this->get_order_currency() ) ), WC()->countries->tax_or_vat() ); + $tax_string_array[] = sprintf( '%s %s', wc_price( $tax_amount, array( 'currency' => $this->get_currency() ) ), WC()->countries->tax_or_vat() ); } if ( ! empty( $tax_string_array ) ) { $tax_string = ' ' . sprintf( __( '(includes %s)', 'woocommerce' ), implode( ', ', $tax_string_array ) ); @@ -48,7 +173,7 @@ class WC_Order extends WC_Abstract_Order { } if ( $total_refunded && $display_refunded ) { - $formatted_total = '' . strip_tags( $formatted_total ) . ' ' . wc_price( $order_total - $total_refunded, array( 'currency' => $this->get_order_currency() ) ) . $tax_string . ''; + $formatted_total = '' . strip_tags( $formatted_total ) . ' ' . wc_price( $order_total - $total_refunded, array( 'currency' => $this->get_currency() ) ) . $tax_string . ''; } else { $formatted_total .= $tax_string; } @@ -56,19 +181,1108 @@ class WC_Order extends WC_Abstract_Order { return apply_filters( 'woocommerce_get_formatted_order_total', $formatted_total, $this ); } + /* + |-------------------------------------------------------------------------- + | CRUD methods + |-------------------------------------------------------------------------- + | + | Methods which create, read, update and delete orders from the database. + | Written in abstract fashion so that the way orders are stored can be + | changed more easily in the future. + | + | A save method is included for convenience (chooses update or create based + | on if the order exists yet). + | + */ + + /** + * Insert data into the database. + * @since 2.7.0 + */ + public function create() { + parent::create(); + + // Store additonal order data + if ( $this->get_id() ) { + $this->update_post_meta( '_billing_first_name', $this->get_billing_first_name() ); + $this->update_post_meta( '_billing_last_name', $this->get_billing_last_name() ); + $this->update_post_meta( '_billing_company', $this->get_billing_company() ); + $this->update_post_meta( '_billing_address_1', $this->get_billing_address_1() ); + $this->update_post_meta( '_billing_address_2', $this->get_billing_address_2() ); + $this->update_post_meta( '_billing_city', $this->get_billing_city() ); + $this->update_post_meta( '_billing_state', $this->get_billing_state() ); + $this->update_post_meta( '_billing_postcode', $this->get_billing_postcode() ); + $this->update_post_meta( '_billing_country', $this->get_billing_country() ); + $this->update_post_meta( '_billing_email', $this->get_billing_email() ); + $this->update_post_meta( '_billing_phone', $this->get_billing_phone() ); + $this->update_post_meta( '_shipping_first_name', $this->get_shipping_first_name() ); + $this->update_post_meta( '_shipping_last_name', $this->get_shipping_last_name() ); + $this->update_post_meta( '_shipping_company', $this->get_shipping_company() ); + $this->update_post_meta( '_shipping_address_1', $this->get_shipping_address_1() ); + $this->update_post_meta( '_shipping_address_2', $this->get_shipping_address_2() ); + $this->update_post_meta( '_shipping_city', $this->get_shipping_city() ); + $this->update_post_meta( '_shipping_state', $this->get_shipping_state() ); + $this->update_post_meta( '_shipping_postcode', $this->get_shipping_postcode() ); + $this->update_post_meta( '_shipping_country', $this->get_shipping_country() ); + $this->update_post_meta( '_payment_method', $this->get_payment_method() ); + $this->update_post_meta( '_payment_method_title', $this->get_payment_method_title() ); + $this->update_post_meta( '_transaction_id', $this->get_transaction_id() ); + $this->update_post_meta( '_customer_ip_address', $this->get_customer_ip_address() ); + $this->update_post_meta( '_customer_user_agent', $this->get_customer_user_agent() ); + $this->update_post_meta( '_created_via', $this->get_created_via() ); + $this->update_post_meta( '_customer_note', $this->get_customer_note() ); + $this->update_post_meta( '_date_completed', $this->get_date_completed() ); + $this->update_post_meta( '_date_paid', $this->get_date_paid() ); + $this->update_post_meta( '_cart_hash', $this->get_cart_hash() ); + do_action( 'woocommerce_new_order', $this->get_id() ); + } + } + + /** + * Read from the database. + * @since 2.7.0 + * @param int $id ID of object to read. + */ + public function read( $id ) { + parent::read( $id ); + + // Read additonal order data + if ( $order_id = $this->get_id() ) { + $post_object = get_post( $this->get_id() ); + $this->set_billing_first_name( get_post_meta( $order_id, '_billing_first_name', true ) ); + $this->set_billing_last_name( get_post_meta( $order_id, '_billing_last_name', true ) ); + $this->set_billing_company( get_post_meta( $order_id, '_billing_company', true ) ); + $this->set_billing_address_1( get_post_meta( $order_id, '_billing_address_1', true ) ); + $this->set_billing_address_2( get_post_meta( $order_id, '_billing_address_2', true ) ); + $this->set_billing_city( get_post_meta( $order_id, '_billing_city', true ) ); + $this->set_billing_state( get_post_meta( $order_id, '_billing_state', true ) ); + $this->set_billing_postcode( get_post_meta( $order_id, '_billing_postcode', true ) ); + $this->set_billing_country( get_post_meta( $order_id, '_billing_country', true ) ); + $this->set_billing_email( get_post_meta( $order_id, '_billing_email', true ) ); + $this->set_billing_phone( get_post_meta( $order_id, '_billing_phone', true ) ); + $this->set_shipping_first_name( get_post_meta( $order_id, '_shipping_first_name', true ) ); + $this->set_shipping_last_name( get_post_meta( $order_id, '_shipping_last_name', true ) ); + $this->set_shipping_company( get_post_meta( $order_id, '_shipping_company', true ) ); + $this->set_shipping_address_1( get_post_meta( $order_id, '_shipping_address_1', true ) ); + $this->set_shipping_address_2( get_post_meta( $order_id, '_shipping_address_2', true ) ); + $this->set_shipping_city( get_post_meta( $order_id, '_shipping_city', true ) ); + $this->set_shipping_state( get_post_meta( $order_id, '_shipping_state', true ) ); + $this->set_shipping_postcode( get_post_meta( $order_id, '_shipping_postcode', true ) ); + $this->set_shipping_country( get_post_meta( $order_id, '_shipping_country', true ) ); + $this->set_payment_method( get_post_meta( $order_id, '_payment_method', true ) ); + $this->set_payment_method_title( get_post_meta( $order_id, '_payment_method_title', true ) ); + $this->set_transaction_id( get_post_meta( $order_id, '_transaction_id', true ) ); + $this->set_customer_ip_address( get_post_meta( $order_id, '_customer_ip_address', true ) ); + $this->set_customer_user_agent( get_post_meta( $order_id, '_customer_user_agent', true ) ); + $this->set_created_via( get_post_meta( $order_id, '_created_via', true ) ); + $this->set_customer_note( get_post_meta( $order_id, '_customer_note', true ) ); + $this->set_date_completed( get_post_meta( $order_id, '_completed_date', true ) ); + $this->set_date_paid( get_post_meta( $order_id, '_paid_date', true ) ); + $this->set_cart_hash( get_post_meta( $order_id, '_cart_hash', true ) ); + $this->set_customer_note( $post_object->post_excerpt ); + + // Map user data + if ( ! $this->get_billing_email() && ( $user = $this->get_user() ) ) { + $this->set_billing_email( $user->user_email ); + } + } + } + + /** + * Update data in the database. + * @since 2.7.0 + */ + public function update() { + // Store additonal order data + $this->update_post_meta( '_billing_first_name', $this->get_billing_first_name() ); + $this->update_post_meta( '_billing_last_name', $this->get_billing_last_name() ); + $this->update_post_meta( '_billing_company', $this->get_billing_company() ); + $this->update_post_meta( '_billing_address_1', $this->get_billing_address_1() ); + $this->update_post_meta( '_billing_address_2', $this->get_billing_address_2() ); + $this->update_post_meta( '_billing_city', $this->get_billing_city() ); + $this->update_post_meta( '_billing_state', $this->get_billing_state() ); + $this->update_post_meta( '_billing_postcode', $this->get_billing_postcode() ); + $this->update_post_meta( '_billing_country', $this->get_billing_country() ); + $this->update_post_meta( '_billing_email', $this->get_billing_email() ); + $this->update_post_meta( '_billing_phone', $this->get_billing_phone() ); + $this->update_post_meta( '_shipping_first_name', $this->get_shipping_first_name() ); + $this->update_post_meta( '_shipping_last_name', $this->get_shipping_last_name() ); + $this->update_post_meta( '_shipping_company', $this->get_shipping_company() ); + $this->update_post_meta( '_shipping_address_1', $this->get_shipping_address_1() ); + $this->update_post_meta( '_shipping_address_2', $this->get_shipping_address_2() ); + $this->update_post_meta( '_shipping_city', $this->get_shipping_city() ); + $this->update_post_meta( '_shipping_state', $this->get_shipping_state() ); + $this->update_post_meta( '_shipping_postcode', $this->get_shipping_postcode() ); + $this->update_post_meta( '_shipping_country', $this->get_shipping_country() ); + $this->update_post_meta( '_payment_method', $this->get_payment_method() ); + $this->update_post_meta( '_payment_method_title', $this->get_payment_method_title() ); + $this->update_post_meta( '_transaction_id', $this->get_transaction_id() ); + $this->update_post_meta( '_customer_ip_address', $this->get_customer_ip_address() ); + $this->update_post_meta( '_customer_user_agent', $this->get_customer_user_agent() ); + $this->update_post_meta( '_created_via', $this->get_created_via() ); + $this->update_post_meta( '_customer_note', $this->get_customer_note() ); + $this->update_post_meta( '_date_completed', $this->get_date_completed() ); + $this->update_post_meta( '_date_paid', $this->get_date_paid() ); + $this->update_post_meta( '_cart_hash', $this->get_cart_hash() ); + + $customer_changed = $this->update_post_meta( '_customer_user', $this->get_customer_id() ); + + // Update parent + parent::update(); + + // If customer changed, update any downloadable permissions + if ( $customer_changed ) { + $wpdb->update( $wpdb->prefix . "woocommerce_downloadable_product_permissions", + array( + 'user_id' => $this->get_customer_id(), + 'user_email' => $this->get_billing_email(), + ), + array( + 'order_id' => $this->get_id(), + ), + array( + '%d', + '%s', + ), + array( + '%d', + ) + ); + } + + // Handle status change + $this->status_transition(); + } + + /** + * Set order status. + * @since 2.7.0 + * @param string $new_status Status to change the order to. No internal wc- prefix is required. + * @param string $note (default: '') Optional note to add. + * @param bool $manual_update is this a manual order status change? + * @param array details of change + */ + public function set_status( $new_status, $note = '', $manual_update = false ) { + $result = parent::set_status( $new_status ); + + if ( ! empty( $result['from'] ) && $result['from'] !== $result['to'] ) { + $this->_status_transition = array( + 'from' => ! empty( $this->_status_transition['from'] ) ? $this->_status_transition['from'] : $result['from'], + 'to' => $result['to'], + 'note' => $note, + 'manual' => (bool) $manual_update, + ); + + if ( 'pending' === $result['from'] && ! $manual_update ) { + $this->set_date_paid( current_time( 'timestamp' ) ); + } + + if ( 'completed' === $result['to'] ) { + $this->set_date_completed( current_time( 'timestamp' ) ); + } + } + + return $result; + } + + /** + * Updates status of order immediately. Order must exist. + * @uses WC_Order::set_status() + */ + public function update_status( $new_status, $note = '', $manual = false ) { + if ( ! $this->get_id() ) { + return false; + } + $this->set_status( $new_status, $note, $manual ); + $this->save(); + return true; + } + + /** + * Handle the status transition. + */ + protected function status_transition() { + if ( $this->_status_transition ) { + if ( ! empty( $this->_status_transition['from'] ) ) { + $transition_note = sprintf( __( 'Order status changed from %s to %s.', 'woocommerce' ), wc_get_order_status_name( $this->_status_transition['from'] ), wc_get_order_status_name( $this->_status_transition['to'] ) ); + + do_action( 'woocommerce_order_status_' . $this->_status_transition['from'] . '_to_' . $this->_status_transition['to'], $this->get_id() ); + do_action( 'woocommerce_order_status_changed', $this->get_id(), $this->_status_transition['from'], $this->_status_transition['to'] ); + } else { + $transition_note = sprintf( __( 'Order status set to %s.', 'woocommerce' ), wc_get_order_status_name( $this->_status_transition['to'] ) ); + } + + do_action( 'woocommerce_order_status_' . $this->_status_transition['to'], $this->get_id() ); + + // Note the transition occured + $this->add_order_note( trim( $this->_status_transition['note'] . ' ' . $transition_note ), 0, $this->_status_transition['manual'] ); + + // This has ran, so reset status transition variable + $this->_status_transition = false; + } + } + + /* + |-------------------------------------------------------------------------- + | Getters + |-------------------------------------------------------------------------- + | + | Methods for getting data from the order object. + | + */ + + /** + * Get billing_first_name + * @return string + */ + public function get_billing_first_name() { + return $this->_data['billing']['first_name']; + } + + /** + * Get billing_last_name + * @return string + */ + public function get_billing_last_name() { + return $this->_data['billing']['last_name']; + } + + /** + * Get billing_company + * @return string + */ + public function get_billing_company() { + return $this->_data['billing']['company']; + } + + /** + * Get billing_address_1 + * @return string + */ + public function get_billing_address_1() { + return $this->_data['billing']['address_1']; + } + + /** + * Get billing_address_2 + * @return string $value + */ + public function get_billing_address_2() { + return $this->_data['billing']['address_2']; + } + + /** + * Get billing_city + * @return string $value + */ + public function get_billing_city() { + return $this->_data['billing']['city']; + } + + /** + * Get billing_state + * @return string + */ + public function get_billing_state() { + return $this->_data['billing']['state']; + } + + /** + * Get billing_postcode + * @return string + */ + public function get_billing_postcode() { + return $this->_data['billing']['postcode']; + } + + /** + * Get billing_country + * @return string + */ + public function get_billing_country() { + return $this->_data['billing']['country']; + } + + /** + * Get billing_email + * @return string + */ + public function get_billing_email() { + return $this->_data['billing']['email']; + } + + /** + * Get billing_phone + * @return string + */ + public function get_billing_phone() { + return $this->_data['billing']['phone']; + } + + /** + * Get shipping_first_name + * @return string + */ + public function get_shipping_first_name() { + return $this->_data['shipping']['first_name']; + } + + /** + * Get shipping_last_name + * @return string + */ + public function get_shipping_last_name() { + return $this->_data['shipping']['last_name']; + } + + /** + * Get shipping_company + * @return string + */ + public function get_shipping_company() { + return $this->_data['shipping']['company']; + } + + /** + * Get shipping_address_1 + * @return string + */ + public function get_shipping_address_1() { + return $this->_data['shipping']['address_1']; + } + + /** + * Get shipping_address_2 + * @return string + */ + public function get_shipping_address_2() { + return $this->_data['shipping']['address_2']; + } + + /** + * Get shipping_city + * @return string + */ + public function get_shipping_city() { + return $this->_data['shipping']['city']; + } + + /** + * Get shipping_state + * @return string + */ + public function get_shipping_state() { + return $this->_data['shipping']['state']; + } + + /** + * Get shipping_postcode + * @return string + */ + public function get_shipping_postcode() { + return $this->_data['shipping']['postcode']; + } + + /** + * Get shipping_country + * @return string + */ + public function get_shipping_country() { + return $this->_data['shipping']['country']; + } + + /** + * Get the payment method. + * @return string + */ + public function get_payment_method() { + return $this->_data['payment_method']; + } + + /** + * Get payment_method_title + * @return string + */ + public function get_payment_method_title() { + return $this->_data['payment_method_title']; + } + + /** + * Get transaction_id + * @return string + */ + public function get_transaction_id() { + return $this->_data['transaction_id']; + } + + /** + * Get customer_ip_address + * @return string + */ + public function get_customer_ip_address() { + return $this->_data['customer_ip_address']; + } + + /** + * Get customer_user_agent + * @return string + */ + public function get_customer_user_agent() { + return $this->_data['customer_user_agent']; + } + + /** + * Get created_via + * @return string + */ + public function get_created_via() { + return $this->_data['created_via']; + } + + /** + * Get customer_note + * @return string + */ + public function get_customer_note() { + return $this->_data['customer_note']; + } + + /** + * Get date_completed + * @return int + */ + public function get_date_completed() { + return absint( $this->_data['date_completed'] ); + } + + /** + * Get date_paid + * @return int + */ + public function get_date_paid() { + return absint( $this->_data['date_paid'] ); + } + + /** + * Returns the requested address in raw, non-formatted way. + * @since 2.4.0 + * @param string $type Billing or shipping. Anything else besides 'billing' will return shipping address. + * @return array The stored address after filter. + */ + public function get_address( $type = 'billing' ) { + return apply_filters( 'woocommerce_get_order_address', isset( $this->_data[ $type ] ) ? $this->_data[ $type ] : array(), $type, $this ); + } + + /** + * Get a formatted shipping address for the order. + * + * @return string + */ + public function get_shipping_address_map_url() { + $address = apply_filters( 'woocommerce_shipping_address_map_url_parts', $this->get_address( 'shipping' ), $this ); + return apply_filters( 'woocommerce_shipping_address_map_url', 'http://maps.google.com/maps?&q=' . urlencode( implode( ', ', $address ) ) . '&z=16', $this ); + } + + /** + * Get a formatted billing full name. + * @return string + */ + public function get_formatted_billing_full_name() { + return sprintf( _x( '%1$s %2$s', 'full name', 'woocommerce' ), $this->get_billing_first_name(), $this->get_billing_last_name() ); + } + + /** + * Get a formatted shipping full name. + * @return string + */ + public function get_formatted_shipping_full_name() { + return sprintf( _x( '%1$s %2$s', 'full name', 'woocommerce' ), $this->get_shipping_first_name(), $this->get_shipping_last_name() ); + } + + /** + * Get a formatted billing address for the order. + * @return string + */ + public function get_formatted_billing_address() { + return WC()->countries->get_formatted_address( apply_filters( 'woocommerce_order_formatted_billing_address', $this->get_address( 'billing' ), $this ) ); + } + + /** + * Get a formatted shipping address for the order. + * @return string + */ + public function get_formatted_shipping_address() { + if ( $this->get_shipping_address_1() || $this->get_shipping_address_2() ) { + return WC()->countries->get_formatted_address( apply_filters( 'woocommerce_order_formatted_shipping_address', $this->get_address( 'shipping' ), $this ) ); + } else { + return ''; + } + } + + /** + * Get cart hash + * @return string + */ + public function get_cart_hash() { + return $this->_data['cart_hash']; + } + + /* + |-------------------------------------------------------------------------- + | Setters + |-------------------------------------------------------------------------- + | + | Functions for setting order data. These should not update anything in the + | database itself and should only change what is stored in the class + | object. However, for backwards compatibility pre 2.7.0 some of these + | setters may handle both. + | + */ + + /** + * Set billing_first_name + * @param string $value + */ + public function set_billing_first_name( $value ) { + $this->_data['billing']['first_name'] = $value; + } + + /** + * Set billing_last_name + * @param string $value + */ + public function set_billing_last_name( $value ) { + $this->_data['billing']['last_name'] = $value; + } + + /** + * Set billing_company + * @param string $value + */ + public function set_billing_company( $value ) { + $this->_data['billing']['company'] = $value; + } + + /** + * Set billing_address_1 + * @param string $value + */ + public function set_billing_address_1( $value ) { + $this->_data['billing']['address_1'] = $value; + } + + /** + * Set billing_address_2 + * @param string $value + */ + public function set_billing_address_2( $value ) { + $this->_data['billing']['address_2'] = $value; + } + + /** + * Set billing_city + * @param string $value + */ + public function set_billing_city( $value ) { + $this->_data['billing']['city'] = $value; + } + + /** + * Set billing_state + * @param string $value + */ + public function set_billing_state( $value ) { + $this->_data['billing']['state'] = $value; + } + + /** + * Set billing_postcode + * @param string $value + */ + public function set_billing_postcode( $value ) { + $this->_data['billing']['postcode'] = $value; + } + + /** + * Set billing_country + * @param string $value + */ + public function set_billing_country( $value ) { + $this->_data['billing']['country'] = $value; + } + + /** + * Set billing_email + * @param string $value + */ + public function set_billing_email( $value ) { + $value = sanitize_email( $value ); + $this->_data['billing']['email'] = is_email( $value ) ? $value : ''; + } + + /** + * Set billing_phone + * @param string $value + */ + public function set_billing_phone( $value ) { + $this->_data['billing']['phone'] = $value; + } + + /** + * Set shipping_first_name + * @param string $value + */ + public function set_shipping_first_name( $value ) { + $this->_data['shipping']['first_name'] = $value; + } + + /** + * Set shipping_last_name + * @param string $value + */ + public function set_shipping_last_name( $value ) { + $this->_data['shipping']['last_name'] = $value; + } + + /** + * Set shipping_company + * @param string $value + */ + public function set_shipping_company( $value ) { + $this->_data['shipping']['company'] = $value; + } + + /** + * Set shipping_address_1 + * @param string $value + */ + public function set_shipping_address_1( $value ) { + $this->_data['shipping']['address_1'] = $value; + } + + /** + * Set shipping_address_2 + * @param string $value + */ + public function set_shipping_address_2( $value ) { + $this->_data['shipping']['address_2'] = $value; + } + + /** + * Set shipping_city + * @param string $value + */ + public function set_shipping_city( $value ) { + $this->_data['shipping']['city'] = $value; + } + + /** + * Set shipping_state + * @param string $value + */ + public function set_shipping_state( $value ) { + $this->_data['shipping']['state'] = $value; + } + + /** + * Set shipping_postcode + * @param string $value + */ + public function set_shipping_postcode( $value ) { + $this->_data['shipping']['postcode'] = $value; + } + + /** + * Set shipping_country + * @param string $value + */ + public function set_shipping_country( $value ) { + $this->_data['shipping']['country'] = $value; + } + + /** + * Set the payment method. + * @param string $payment_method Supports WC_Payment_Gateway for bw compatibility with < 2.7 + */ + public function set_payment_method( $payment_method = '' ) { + if ( is_object( $payment_method ) ) { + $this->set_payment_method( $payment_method->id ); + $this->set_payment_method_title( $payment_method->get_title() ); + } elseif ( '' === $payment_method ) { + $this->_data['payment_method'] = ''; + $this->_data['payment_method_title'] = ''; + } else { + $this->_data['payment_method'] = $payment_method; + } + } + + /** + * Set payment_method_title + * @param string $value + */ + public function set_payment_method_title( $value ) { + $this->_data['payment_method_title'] = $value; + } + + /** + * Set transaction_id + * @param string $value + */ + public function set_transaction_id( $value ) { + $this->_data['transaction_id'] = $value; + } + + /** + * Set customer_ip_address + * @param string $value + */ + public function set_customer_ip_address( $value ) { + $this->_data['customer_ip_address'] = $value; + } + + /** + * Set customer_user_agent + * @param string $value + */ + public function set_customer_user_agent( $value ) { + $this->_data['customer_user_agent'] = $value; + } + + /** + * Set created_via + * @param string $value + */ + public function set_created_via( $value ) { + $this->_data['created_via'] = $value; + } + + /** + * Set customer_note + * @param string $value + */ + public function set_customer_note( $value ) { + $this->_data['customer_note'] = $value; + } + + /** + * Set date_completed + * @param string $timestamp + */ + public function set_date_completed( $timestamp ) { + $this->_data['date_completed'] = is_numeric( $timestamp ) ? $timestamp : strtotime( $timestamp ); + } + + /** + * Set date_paid + * @param string $timestamp + */ + public function set_date_paid( $timestamp ) { + $this->_data['date_paid'] = is_numeric( $timestamp ) ? $timestamp : strtotime( $timestamp ); + } + + /** + * Set cart hash + * @param string $value + */ + public function set_cart_hash( $value ) { + $this->_data['cart_hash'] = $value; + } + + /* + |-------------------------------------------------------------------------- + | Conditionals + |-------------------------------------------------------------------------- + | + | Checks if a condition is true or false. + | + */ + + /** + * See if order matches cart_hash. + * @return bool + */ + public function has_cart_hash( $cart_hash = '' ) { + return hash_equals( $this->get_cart_hash(), $cart_hash ); + } + + /** + * Checks if an order can be edited, specifically for use on the Edit Order screen. + * @return bool + */ + public function is_editable() { + return apply_filters( 'wc_order_is_editable', in_array( $this->get_status(), array( 'pending', 'on-hold', 'auto-draft' ) ), $this ); + } + + /** + * Returns if an order has been paid for based on the order status. + * @since 2.5.0 + * @return bool + */ + public function is_paid() { + return apply_filters( 'woocommerce_order_is_paid', $this->has_status( apply_filters( 'woocommerce_order_is_paid_statuses', array( 'processing', 'completed' ) ) ), $this ); + } + + /** + * Checks if product download is permitted. + * + * @return bool + */ + public function is_download_permitted() { + return apply_filters( 'woocommerce_order_is_download_permitted', $this->has_status( 'completed' ) || ( 'yes' === get_option( 'woocommerce_downloads_grant_access_after_payment' ) && $this->has_status( 'processing' ) ), $this ); + } + + /** + * Checks if an order needs display the shipping address, based on shipping method. + * @return bool + */ + public function needs_shipping_address() { + if ( 'no' === get_option( 'woocommerce_calc_shipping' ) ) { + return false; + } + + $hide = apply_filters( 'woocommerce_order_hide_shipping_address', array( 'local_pickup' ), $this ); + $needs_address = false; + + foreach ( $this->get_shipping_methods() as $shipping_method ) { + // Remove any instance IDs after : + $shipping_method_id = current( explode( ':', $shipping_method['method_id'] ) ); + + if ( ! in_array( $shipping_method_id, $hide ) ) { + $needs_address = true; + break; + } + } + + return apply_filters( 'woocommerce_order_needs_shipping_address', $needs_address, $hide, $this ); + } + + /** + * Returns true if the order contains a downloadable product. + * @return bool + */ + public function has_downloadable_item() { + foreach ( $this->get_items() as $item ) { + if ( $item->is_type( 'line_item' ) && ( $product = $item->get_product() ) && $product->is_downloadable() && $product->has_file() ) { + return true; + } + } + return false; + } + + /** + * Checks if an order needs payment, based on status and order total. + * + * @return bool + */ + public function needs_payment() { + $valid_order_statuses = apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $this ); + return apply_filters( 'woocommerce_order_needs_payment', ( $this->has_status( $valid_order_statuses ) && $this->get_total() > 0 ), $this, $valid_order_statuses ); + } + + /* + |-------------------------------------------------------------------------- + | URLs and Endpoints + |-------------------------------------------------------------------------- + */ + + /** + * Generates a URL so that a customer can pay for their (unpaid - pending) order. Pass 'true' for the checkout version which doesn't offer gateway choices. + * + * @param bool $on_checkout + * @return string + */ + public function get_checkout_payment_url( $on_checkout = false ) { + $pay_url = wc_get_endpoint_url( 'order-pay', $this->get_id(), wc_get_page_permalink( 'checkout' ) ); + + if ( 'yes' == get_option( 'woocommerce_force_ssl_checkout' ) || is_ssl() ) { + $pay_url = str_replace( 'http:', 'https:', $pay_url ); + } + + if ( $on_checkout ) { + $pay_url = add_query_arg( 'key', $this->get_order_key(), $pay_url ); + } else { + $pay_url = add_query_arg( array( 'pay_for_order' => 'true', 'key' => $this->get_order_key() ), $pay_url ); + } + + return apply_filters( 'woocommerce_get_checkout_payment_url', $pay_url, $this ); + } + + /** + * Generates a URL for the thanks page (order received). + * + * @return string + */ + public function get_checkout_order_received_url() { + $order_received_url = wc_get_endpoint_url( 'order-received', $this->get_id(), wc_get_page_permalink( 'checkout' ) ); + + if ( 'yes' === get_option( 'woocommerce_force_ssl_checkout' ) || is_ssl() ) { + $order_received_url = str_replace( 'http:', 'https:', $order_received_url ); + } + + $order_received_url = add_query_arg( 'key', $this->get_order_key(), $order_received_url ); + + return apply_filters( 'woocommerce_get_checkout_order_received_url', $order_received_url, $this ); + } + + /** + * Generates a URL so that a customer can cancel their (unpaid - pending) order. + * + * @param string $redirect + * + * @return string + */ + public function get_cancel_order_url( $redirect = '' ) { + return apply_filters( 'woocommerce_get_cancel_order_url', wp_nonce_url( add_query_arg( array( + 'cancel_order' => 'true', + 'order' => $this->get_order_key(), + 'order_id' => $this->get_id(), + 'redirect' => $redirect + ), $this->get_cancel_endpoint() ), 'woocommerce-cancel_order' ) ); + } + + /** + * Generates a raw (unescaped) cancel-order URL for use by payment gateways. + * + * @param string $redirect + * + * @return string The unescaped cancel-order URL. + */ + public function get_cancel_order_url_raw( $redirect = '' ) { + return apply_filters( 'woocommerce_get_cancel_order_url_raw', add_query_arg( array( + 'cancel_order' => 'true', + 'order' => $this->get_order_key(), + 'order_id' => $this->get_id(), + 'redirect' => $redirect, + '_wpnonce' => wp_create_nonce( 'woocommerce-cancel_order' ) + ), $this->get_cancel_endpoint() ) ); + } + + /** + * Helper method to return the cancel endpoint. + * + * @return string the cancel endpoint; either the cart page or the home page. + */ + public function get_cancel_endpoint() { + $cancel_endpoint = wc_get_page_permalink( 'cart' ); + if ( ! $cancel_endpoint ) { + $cancel_endpoint = home_url(); + } + + if ( false === strpos( $cancel_endpoint, '?' ) ) { + $cancel_endpoint = trailingslashit( $cancel_endpoint ); + } + + return $cancel_endpoint; + } + + /** + * Generates a URL to view an order from the my account page. + * + * @return string + */ + public function get_view_order_url() { + return apply_filters( 'woocommerce_get_view_order_url', wc_get_endpoint_url( 'view-order', $this->get_id(), wc_get_page_permalink( 'myaccount' ) ), $this ); + } + + /* + |-------------------------------------------------------------------------- + | Order notes. + |-------------------------------------------------------------------------- + */ + + /** + * Adds a note (comment) to the order. Order must exist. + * + * @param string $note Note to add. + * @param int $is_customer_note (default: 0) Is this a note for the customer? + * @param bool added_by_user Was the note added by a user? + * @return int Comment ID. + */ + public function add_order_note( $note, $is_customer_note = 0, $added_by_user = false ) { + if ( ! $this->get_id() ) { + return 0; + } + + if ( is_user_logged_in() && current_user_can( 'edit_shop_order', $this->get_id() ) && $added_by_user ) { + $user = get_user_by( 'id', get_current_user_id() ); + $comment_author = $user->display_name; + $comment_author_email = $user->user_email; + } else { + $comment_author = __( 'WooCommerce', 'woocommerce' ); + $comment_author_email = strtolower( __( 'WooCommerce', 'woocommerce' ) ) . '@'; + $comment_author_email .= isset( $_SERVER['HTTP_HOST'] ) ? str_replace( 'www.', '', $_SERVER['HTTP_HOST'] ) : 'noreply.com'; + $comment_author_email = sanitize_email( $comment_author_email ); + } + $commentdata = apply_filters( 'woocommerce_new_order_note_data', array( + 'comment_post_ID' => $this->get_id(), + 'comment_author' => $comment_author, + 'comment_author_email' => $comment_author_email, + 'comment_author_url' => '', + 'comment_content' => $note, + 'comment_agent' => 'WooCommerce', + 'comment_type' => 'order_note', + 'comment_parent' => 0, + 'comment_approved' => 1, + ), array( 'order_id' => $this->get_id(), 'is_customer_note' => $is_customer_note ) ); + + $comment_id = wp_insert_comment( $commentdata ); + + if ( $is_customer_note ) { + add_comment_meta( $comment_id, 'is_customer_note', 1 ); + + do_action( 'woocommerce_new_customer_note', array( 'order_id' => $this->get_id(), 'customer_note' => $commentdata['comment_content'] ) ); + } + + return $comment_id; + } + + /** + * List order notes (public) for the customer. + * + * @return array + */ + public function get_customer_order_notes() { + $notes = array(); + $args = array( + 'post_id' => $this->get_id(), + 'approve' => 'approve', + 'type' => '' + ); + + remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ) ); + + $comments = get_comments( $args ); + + foreach ( $comments as $comment ) { + if ( ! get_comment_meta( $comment->comment_ID, 'is_customer_note', true ) ) { + continue; + } + $comment->comment_content = make_clickable( $comment->comment_content ); + $notes[] = $comment; + } + + add_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ) ); + + return $notes; + } + + /* + |-------------------------------------------------------------------------- + | Refunds + |-------------------------------------------------------------------------- + */ + /** * Get order refunds. * @since 2.2 * @return array of WC_Order_Refund objects */ public function get_refunds() { - if ( empty( $this->refunds ) && ! is_array( $this->refunds ) ) { - $this->refunds = wc_get_orders( array( - 'type' => 'shop_order_refund', - 'parent' => $this->id, - 'limit' => -1, - ) ); - } + $this->refunds = wc_get_orders( array( + 'type' => 'shop_order_refund', + 'parent' => $this->get_id(), + 'limit' => -1, + ) ); return $this->refunds; } @@ -87,7 +1301,7 @@ class WC_Order extends WC_Abstract_Order { INNER JOIN $wpdb->posts AS posts ON ( posts.post_type = 'shop_order_refund' AND posts.post_parent = %d ) WHERE postmeta.meta_key = '_refund_amount' AND postmeta.post_id = posts.ID - ", $this->id ) ); + ", $this->get_id() ) ); return $total; } @@ -108,7 +1322,7 @@ class WC_Order extends WC_Abstract_Order { INNER JOIN {$wpdb->prefix}woocommerce_order_items AS order_items ON ( order_items.order_id = posts.ID AND order_items.order_item_type = 'tax' ) WHERE order_itemmeta.order_item_id = order_items.order_item_id AND order_itemmeta.meta_key IN ('tax_amount', 'shipping_tax_amount') - ", $this->id ) ); + ", $this->get_id() ) ); return abs( $total ); } @@ -129,7 +1343,7 @@ class WC_Order extends WC_Abstract_Order { INNER JOIN {$wpdb->prefix}woocommerce_order_items AS order_items ON ( order_items.order_id = posts.ID AND order_items.order_item_type = 'shipping' ) WHERE order_itemmeta.order_item_id = order_items.order_item_id AND order_itemmeta.meta_key IN ('cost') - ", $this->id ) ); + ", $this->get_id() ) ); return abs( $total ); } @@ -151,7 +1365,7 @@ class WC_Order extends WC_Abstract_Order { foreach ( $this->get_refunds() as $refund ) { foreach ( $refund->get_items( $item_type ) as $refunded_item ) { - $count += empty( $refunded_item['qty'] ) ? 0 : $refunded_item['qty']; + $count += $refunded_item->get_qty(); } } @@ -169,7 +1383,7 @@ class WC_Order extends WC_Abstract_Order { $qty = 0; foreach ( $this->get_refunds() as $refund ) { foreach ( $refund->get_items( $item_type ) as $refunded_item ) { - $qty += $refunded_item['qty']; + $qty += $refunded_item->get_qty(); } } return $qty; @@ -186,8 +1400,8 @@ class WC_Order extends WC_Abstract_Order { $qty = 0; foreach ( $this->get_refunds() as $refund ) { foreach ( $refund->get_items( $item_type ) as $refunded_item ) { - if ( isset( $refunded_item['refunded_item_id'] ) && $refunded_item['refunded_item_id'] == $item_id ) { - $qty += $refunded_item['qty']; + if ( absint( $refunded_item->get_meta( '_refunded_item_id' ) ) === $item_id ) { + $qty += $refunded_item->get_qty(); } } } @@ -205,15 +1419,8 @@ class WC_Order extends WC_Abstract_Order { $total = 0; foreach ( $this->get_refunds() as $refund ) { foreach ( $refund->get_items( $item_type ) as $refunded_item ) { - if ( isset( $refunded_item['refunded_item_id'] ) && $refunded_item['refunded_item_id'] == $item_id ) { - switch ( $item_type ) { - case 'shipping' : - $total += $refunded_item['cost']; - break; - default : - $total += $refunded_item['line_total']; - break; - } + if ( absint( $refunded_item->get_meta( '_refunded_item_id' ) ) === $item_id ) { + $total += $refunded_item->get_total(); } } } @@ -232,21 +1439,8 @@ class WC_Order extends WC_Abstract_Order { $total = 0; foreach ( $this->get_refunds() as $refund ) { foreach ( $refund->get_items( $item_type ) as $refunded_item ) { - if ( isset( $refunded_item['refunded_item_id'] ) && $refunded_item['refunded_item_id'] == $item_id ) { - switch ( $item_type ) { - case 'shipping' : - $tax_data = maybe_unserialize( $refunded_item['taxes'] ); - if ( isset( $tax_data[ $tax_id ] ) ) { - $total += $tax_data[ $tax_id ]; - } - break; - default : - $tax_data = maybe_unserialize( $refunded_item['line_tax_data'] ); - if ( isset( $tax_data['total'][ $tax_id ] ) ) { - $total += $tax_data['total'][ $tax_id ]; - } - break; - } + if ( absint( $refunded_item->get_meta( '_refunded_item_id' ) ) === $item_id ) { + $total += $refunded_item->get_total_tax(); } } } @@ -264,8 +1458,8 @@ class WC_Order extends WC_Abstract_Order { $total = 0; foreach ( $this->get_refunds() as $refund ) { foreach ( $refund->get_items( 'tax' ) as $refunded_item ) { - if ( isset( $refunded_item['rate_id'] ) && $refunded_item['rate_id'] == $rate_id ) { - $total += abs( $refunded_item['tax_amount'] ) + abs( $refunded_item['shipping_tax_amount'] ); + if ( absint( $refunded_item->get_rate_id() ) === $rate_id ) { + $total += abs( $refunded_item->tax_total() ) + abs( $refunded_item->shipping_tax_total() ); } } } diff --git a/includes/class-wc-product-variable.php b/includes/class-wc-product-variable.php index a44cfc42403..b14dbb733e8 100644 --- a/includes/class-wc-product-variable.php +++ b/includes/class-wc-product-variable.php @@ -610,7 +610,7 @@ class WC_Product_Variable extends WC_Product { 'price_html' => apply_filters( 'woocommerce_show_variation_price', $variation->get_price() === "" || $this->get_variation_price( 'min' ) !== $this->get_variation_price( 'max' ), $this, $variation ) ? '' . $variation->get_price_html() . '' : '', 'availability_html' => $availability_html, 'sku' => $variation->get_sku(), - 'weight' => $variation->get_weight() . ' ' . esc_attr( get_option('woocommerce_weight_unit' ) ), + 'weight' => $variation->get_weight() ? $variation->get_weight() . ' ' . esc_attr( get_option('woocommerce_weight_unit' ) ) : '', 'dimensions' => $variation->get_dimensions(), 'min_qty' => 1, 'max_qty' => $variation->backorders_allowed() ? '' : $variation->get_stock_quantity(), @@ -723,6 +723,33 @@ class WC_Product_Variable extends WC_Product { } } + /** + * Does a child have a weight set? + * @since 2.7.0 + * @return boolean + */ + public function child_has_weight() { + return (bool) get_post_meta( $this->id, '_child_has_weight', true ); + } + + /** + * Does a child have dimensions set? + * @since 2.7.0 + * @return boolean + */ + public function child_has_dimensions() { + return (bool) get_post_meta( $this->id, '_child_has_dimensions', true ); + } + + /** + * Returns whether or not we are showing dimensions on the product page. + * + * @return bool + */ + public function enable_dimensions_display() { + return apply_filters( 'wc_product_enable_dimensions_display', true ) && ( $this->has_dimensions() || $this->has_weight() || $this->child_has_weight() || $this->child_has_dimensions() ); + } + /** * Sync the variable product with it's children. */ @@ -740,6 +767,8 @@ class WC_Product_Variable extends WC_Product { // No published variations - product won't be purchasable. if ( ! $children ) { update_post_meta( $product_id, '_price', '' ); + delete_post_meta( $product_id, '_child_has_weight' ); + delete_post_meta( $product_id, '_child_has_dimensions' ); delete_transient( 'wc_products_onsale' ); if ( is_admin() && 'publish' === get_post_status( $product_id ) ) { @@ -826,6 +855,22 @@ class WC_Product_Variable extends WC_Product { add_post_meta( $product_id, '_price', $max_price, false ); delete_transient( 'wc_products_onsale' ); + // Sync weights + foreach ( $children as $child_id ) { + if ( get_post_meta( $child_id, '_weight', true ) ) { + update_post_meta( $product_id, '_child_has_weight', true ); + break; + } + } + + // Sync dimensions + foreach ( $children as $child_id ) { + if ( get_post_meta( $child_id, '_height', true ) || get_post_meta( $child_id, '_width', true ) || get_post_meta( $child_id, '_length', true ) ) { + update_post_meta( $product_id, '_child_has_dimensions', true ); + break; + } + } + // Sync attributes self::sync_attributes( $product_id, $children ); diff --git a/includes/class-wc-product-variation.php b/includes/class-wc-product-variation.php index 45adbbea4c3..5b67b67aeda 100644 --- a/includes/class-wc-product-variation.php +++ b/includes/class-wc-product-variation.php @@ -88,6 +88,11 @@ class WC_Product_Variation extends WC_Product { $this->product_type = 'variation'; $this->parent = ! empty( $args['parent'] ) ? $args['parent'] : wc_get_product( $this->id ); $this->post = ! empty( $this->parent->post ) ? $this->parent->post : array(); + + // The post parent is not a valid variable product so we should prevent this being created. + if ( ! is_a( $this->parent, 'WC_Product' ) ) { + throw new Exception( sprintf( 'Invalid parent for variation #%d', $this->variation_id ), 422 ); + } } /** diff --git a/includes/class-wc-query.php b/includes/class-wc-query.php index 54f98bb218b..17b0b60e9dd 100644 --- a/includes/class-wc-query.php +++ b/includes/class-wc-query.php @@ -275,7 +275,7 @@ class WC_Query { } // Special check for shops with the product archive on front - if ( $this->is_showing_page_on_front( $q ) && absint( $q->get( 'page_id' ) ) === wc_get_page_id( 'shop' ) ) { + if ( $q->is_page() && 'page' === get_option( 'show_on_front' ) && absint( $q->get( 'page_id' ) ) === wc_get_page_id( 'shop' ) ) { // This is a front-page shop $q->set( 'post_type', 'product' ); $q->set( 'page_id', '' ); diff --git a/includes/class-wc-shipping.php b/includes/class-wc-shipping.php index 1bd54dd501b..0ffd8644b3f 100644 --- a/includes/class-wc-shipping.php +++ b/includes/class-wc-shipping.php @@ -331,7 +331,14 @@ class WC_Shipping { } // Check if we need to recalculate shipping for this package - $package_hash = 'wc_ship_' . md5( json_encode( $package ) . WC_Cache_Helper::get_transient_version( 'shipping' ) ); + $package_to_hash = $package; + + // Remove data objects so hashes are consistent + foreach ( $package_to_hash['contents'] as $item_id => $item ) { + unset( $package_to_hash['contents'][ $item_id ]['data'] ); + } + + $package_hash = 'wc_ship_' . md5( json_encode( $package_to_hash ) . WC_Cache_Helper::get_transient_version( 'shipping' ) ); $status_options = get_option( 'woocommerce_status_options', array() ); $session_key = 'shipping_for_package_' . $package_key; $stored_rates = WC()->session->get( $session_key ); diff --git a/includes/class-wc-tax.php b/includes/class-wc-tax.php index 16f8d39d433..318164655cc 100644 --- a/includes/class-wc-tax.php +++ b/includes/class-wc-tax.php @@ -266,6 +266,51 @@ class WC_Tax { return $shipping_rates; } + /** + * Does the sort comparison. + */ + private static function sort_rates_callback( $rate1, $rate2 ) { + if ( $rate1->tax_rate_priority !== $rate2->tax_rate_priority ) { + return $rate1->tax_rate_priority < $rate2->tax_rate_priority ? -1 : 1; // ASC + } elseif ( $rate1->tax_rate_country !== $rate2->tax_rate_country ) { + if ( '' === $rate1->tax_rate_country ) { + return 1; + } + if ( '' === $rate2->tax_rate_country ) { + return -1; + } + return strcmp( $rate1->tax_rate_country, $rate2->tax_rate_country ) > 0 ? 1 : -1; + } elseif ( $rate1->tax_rate_state !== $rate2->tax_rate_state ) { + if ( '' === $rate1->tax_rate_state ) { + return 1; + } + if ( '' === $rate2->tax_rate_state ) { + return -1; + } + return strcmp( $rate1->tax_rate_state, $rate2->tax_rate_state ) > 0 ? 1 : -1; + } else { + return $rate1->tax_rate_id < $rate2->tax_rate_id ? -1 : 1; // Identical - use ID + } + } + + /** + * Logical sort order for tax rates based on the following in order of priority: + * - Priority + * - County code + * - State code + * @param array $rates + * @return array + * @todo remove tax_rate_order column + */ + private static function sort_rates( $rates ) { + uasort( $rates, __CLASS__ . '::sort_rates_callback' ); + $i = 0; + foreach ( $rates as $key => $rate ) { + $rates[ $key ]->tax_rate_order = $i++; + } + return $rates; + } + /** * Loop through a set of tax rates and get the matching rates (1 per priority). * @@ -338,9 +383,10 @@ class WC_Tax { LEFT OUTER JOIN {$wpdb->prefix}woocommerce_tax_rate_locations as locations2 ON tax_rates.tax_rate_id = locations2.tax_rate_id WHERE 1=1 AND " . implode( ' AND ', $criteria ) . " GROUP BY tax_rate_id - ORDER BY tax_rate_priority, tax_rate_order + ORDER BY tax_rate_priority " ); + $found_rates = self::sort_rates( $found_rates ); $matched_tax_rates = array(); $found_priority = array(); @@ -892,7 +938,7 @@ class WC_Tax { global $wpdb; // Get all the rates and locations. Snagging all at once should significantly cut down on the number of queries. - $rates = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `{$wpdb->prefix}woocommerce_tax_rates` WHERE `tax_rate_class` = %s ORDER BY `tax_rate_order`;", sanitize_title( $tax_class ) ) ); + $rates = self::sort_rates( $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `{$wpdb->prefix}woocommerce_tax_rates` WHERE `tax_rate_class` = %s;", sanitize_title( $tax_class ) ) ) ); $locations = $wpdb->get_results( "SELECT * FROM `{$wpdb->prefix}woocommerce_tax_rate_locations`" ); if ( ! empty( $rates ) ) { diff --git a/includes/class-wc-webhook.php b/includes/class-wc-webhook.php index bd716a23c90..4d9891dac9b 100644 --- a/includes/class-wc-webhook.php +++ b/includes/class-wc-webhook.php @@ -270,6 +270,10 @@ class WC_Webhook { break; case 'product': + // bulk and quick edit action hooks return a product object instead of an ID + if ( 'updated' === $event && is_a( $resource_id, 'WC_Product' ) ) { + $resource_id = $resource_id->get_id(); + } $payload = WC()->api->WC_API_Products->get_product( $resource_id ); break; @@ -581,6 +585,8 @@ class WC_Webhook { 'product.updated' => array( 'woocommerce_process_product_meta', 'woocommerce_api_edit_product', + 'woocommerce_product_quick_edit_save', + 'woocommerce_product_bulk_edit_save', ), 'product.deleted' => array( 'wp_trash_post', diff --git a/includes/gateways/paypal/class-wc-gateway-paypal.php b/includes/gateways/paypal/class-wc-gateway-paypal.php index 0dd15e46296..414f7b67582 100644 --- a/includes/gateways/paypal/class-wc-gateway-paypal.php +++ b/includes/gateways/paypal/class-wc-gateway-paypal.php @@ -56,6 +56,8 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway { self::$log_enabled = $this->debug; 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' ) ); if ( ! $this->is_valid_for_use() ) { $this->enabled = 'no'; @@ -256,6 +258,18 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway { return $order && $order->get_transaction_id(); } + /** + * Init the API class and set the username/password etc. + */ + 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::$sandbox = $this->testmode; + } + /** * Process a refund if supported. * @param int $order_id @@ -271,13 +285,9 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway { return new WP_Error( 'error', __( 'Refund Failed: No transaction ID', 'woocommerce' ) ); } - include_once( dirname( __FILE__ ) . '/includes/class-wc-gateway-paypal-refund.php' ); + $this->init_api(); - WC_Gateway_Paypal_Refund::$api_username = $this->get_option( 'api_username' ); - WC_Gateway_Paypal_Refund::$api_password = $this->get_option( 'api_password' ); - WC_Gateway_Paypal_Refund::$api_signature = $this->get_option( 'api_signature' ); - - $result = WC_Gateway_Paypal_Refund::refund_order( $order, $amount, $reason, $this->testmode ); + $result = WC_Gateway_Paypal_API_Handler::refund_transaction( $order, $amount, $reason ); if ( is_wp_error( $result ) ) { $this->log( 'Refund Failed: ' . $result->get_error_message() ); @@ -286,14 +296,49 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway { $this->log( 'Refund Result: ' . print_r( $result, true ) ); - switch ( strtolower( $result['ACK'] ) ) { + switch ( strtolower( $result->ACK ) ) { case 'success': case 'successwithwarning': - $order->add_order_note( sprintf( __( 'Refunded %s - Refund ID: %s', 'woocommerce' ), $result['GROSSREFUNDAMT'], $result['REFUNDTRANSACTIONID'] ) ); + $order->add_order_note( sprintf( __( 'Refunded %s - Refund ID: %s', 'woocommerce' ), $result->GROSSREFUNDAMT, $result->REFUNDTRANSACTIONID ) ); return true; break; } - return isset( $result['L_LONGMESSAGE0'] ) ? new WP_Error( 'error', $result['L_LONGMESSAGE0'] ) : false; + return isset( $result->L_LONGMESSAGE0 ) ? new WP_Error( 'error', $result->L_LONGMESSAGE0 ) : false; + } + + /** + * Capture payment when the order is changed from on-hold to complete or processing + * + * @param int $order_id + */ + public function capture_payment( $order_id ) { + $order = wc_get_order( $order_id ); + + if ( 'paypal' === $order->payment_method && 'pending' === get_post_meta( $order->id, '_paypal_status', true ) && $order->get_transaction_id() ) { + $this->init_api(); + $result = WC_Gateway_Paypal_API_Handler::do_capture( $order ); + + if ( is_wp_error( $result ) ) { + $this->log( 'Capture Failed: ' . $result->get_error_message() ); + $order->add_order_note( sprintf( __( 'Payment could not captured: %s', 'woocommerce' ), $result->get_error_message() ) ); + return; + } + + $this->log( 'Capture Result: ' . print_r( $result, true ) ); + + if ( ! empty( $result->PAYMENTSTATUS ) ) { + switch ( $result->PAYMENTSTATUS ) { + case 'Completed' : + $order->add_order_note( sprintf( __( 'Payment of %s was captured - Auth ID: %s, Transaction ID: %s', 'woocommerce' ), $result->AMT, $result->AUTHORIZATIONID, $result->TRANSACTIONID ) ); + update_post_meta( $order->id, '_paypal_status', $result->PAYMENTSTATUS ); + update_post_meta( $order->id, '_transaction_id', $result->TRANSACTIONID ); + break; + default : + $order->add_order_note( sprintf( __( 'Payment could not captured - Auth ID: %s, Status: %s', 'woocommerce' ), $result->AUTHORIZATIONID, $result->PAYMENTSTATUS ) ); + break; + } + } + } } } diff --git a/includes/gateways/paypal/includes/class-wc-gateway-paypal-api-handler.php b/includes/gateways/paypal/includes/class-wc-gateway-paypal-api-handler.php new file mode 100644 index 00000000000..384515097cf --- /dev/null +++ b/includes/gateways/paypal/includes/class-wc-gateway-paypal-api-handler.php @@ -0,0 +1,156 @@ + '84.0', + 'SIGNATURE' => self::$api_signature, + 'USER' => self::$api_username, + 'PWD' => self::$api_password, + 'METHOD' => 'DoCapture', + 'AUTHORIZATIONID' => $order->get_transaction_id(), + 'AMT' => number_format( is_null( $amount ) ? $order->get_total() : $amount, 2, '.', '' ), + 'CURRENCYCODE' => $order->get_order_currency(), + 'COMPLETETYPE' => 'Complete', + ); + return apply_filters( 'woocommerce_paypal_capture_request', $request, $order, $amount ); + } + + /** + * Get refund request args. + * @param WC_Order $order + * @param float $amount + * @param string $reason + * @return array + */ + public static function get_refund_request( $order, $amount = null, $reason = '' ) { + $request = array( + 'VERSION' => '84.0', + 'SIGNATURE' => self::$api_signature, + 'USER' => self::$api_username, + 'PWD' => self::$api_password, + 'METHOD' => 'RefundTransaction', + 'TRANSACTIONID' => $order->get_transaction_id(), + 'NOTE' => html_entity_decode( wc_trim_string( $reason, 255 ), ENT_NOQUOTES, 'UTF-8' ), + 'REFUNDTYPE' => 'Full', + ); + if ( ! is_null( $amount ) ) { + $request['AMT'] = number_format( $amount, 2, '.', '' ); + $request['CURRENCYCODE'] = $order->get_order_currency(); + $request['REFUNDTYPE'] = 'Partial'; + } + return apply_filters( 'woocommerce_paypal_refund_request', $request, $order, $amount, $reason ); + } + + /** + * Capture an authorization. + * @param WC_Order $order + * @param float $amount + * @return object Either an object of name value pairs for a success, or a WP_ERROR object. + */ + public static function do_capture( $order, $amount = null ) { + $raw_response = wp_safe_remote_post( + self::$sandbox ? 'https://api-3t.sandbox.paypal.com/nvp' : 'https://api-3t.paypal.com/nvp', + array( + 'method' => 'POST', + 'body' => self::get_capture_request( $order, $amount ), + 'timeout' => 70, + 'user-agent' => 'WooCommerce/' . WC()->version, + 'httpversion' => '1.1', + ) + ); + + WC_Gateway_Paypal::log( 'DoCapture Response: ' . print_r( $raw_response, true ) ); + + if ( empty( $raw_response['body'] ) ) { + return new WP_Error( 'paypal-api', 'Empty Response' ); + } elseif ( is_wp_error( $raw_response ) ) { + return $raw_response; + } + + parse_str( $raw_response['body'], $response ); + + return (object) $response; + } + + /** + * Refund an order via PayPal. + * @param WC_Order $order + * @param float $amount + * @param string $reason + * @return object Either an object of name value pairs for a success, or a WP_ERROR object. + */ + public static function refund_transaction( $order, $amount = null, $reason = '' ) { + $raw_response = wp_safe_remote_post( + self::$sandbox ? 'https://api-3t.sandbox.paypal.com/nvp' : 'https://api-3t.paypal.com/nvp', + array( + 'method' => 'POST', + 'body' => self::get_refund_request( $order, $amount, $reason ), + 'timeout' => 70, + 'user-agent' => 'WooCommerce/' . WC()->version, + 'httpversion' => '1.1', + ) + ); + + WC_Gateway_Paypal::log( 'Refund Response: ' . print_r( $raw_response, true ) ); + + if ( empty( $raw_response['body'] ) ) { + return new WP_Error( 'paypal-api', 'Empty Response' ); + } elseif ( is_wp_error( $raw_response ) ) { + return $raw_response; + } + + parse_str( $raw_response['body'], $response ); + + return (object) $response; + } +} + +/** + * Here for backwards compatibility. + * @since 2.7.0 + */ +class WC_Gateway_Paypal_Refund extends WC_Gateway_Paypal_API_Handler { + public static function get_request( $order, $amount = null, $reason = '' ) { + return self::get_refund_request( $order, $amount, $reason ); + } + public static function refund_order( $order, $amount = null, $reason = '', $sandbox = false ) { + if ( $sandbox ) { + self::$sandbox = $sandbox; + } + $result = self::refund_transaction( $order, $amount, $reason ); + if ( is_wp_error( $result ) ) { + return $result; + } else { + return (array) $result; + } + } +} diff --git a/includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php b/includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php index f33901d40a8..39eab1f89c0 100644 --- a/includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php +++ b/includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php @@ -172,7 +172,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response { * @param array $posted */ protected function payment_status_completed( $order, $posted ) { - if ( $order->has_status( 'completed' ) ) { + if ( $order->has_status( array( 'processing', 'completed' ) ) ) { WC_Gateway_Paypal::log( 'Aborting, Order #' . $order->id . ' is already complete.' ); exit; } @@ -192,7 +192,11 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response { } } else { - $this->payment_on_hold( $order, sprintf( __( 'Payment pending: %s', 'woocommerce' ), $posted['pending_reason'] ) ); + if ( 'authorization' === $posted['pending_reason'] ) { + $this->payment_on_hold( $order, __( 'Payment authorized. Change payment status to processing or complete to capture funds.', 'woocommerce' ) ); + } else { + $this->payment_on_hold( $order, sprintf( __( 'Payment pending (%s).', 'woocommerce' ), $posted['pending_reason'] ) ); + } } } @@ -304,6 +308,12 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response { if ( ! empty( $posted['payment_type'] ) ) { update_post_meta( $order->id, 'Payment type', wc_clean( $posted['payment_type'] ) ); } + if ( ! empty( $posted['txn_id'] ) ) { + update_post_meta( $order->id, '_transaction_id', wc_clean( $posted['txn_id'] ) ); + } + if ( ! empty( $posted['payment_status'] ) ) { + update_post_meta( $order->id, '_paypal_status', wc_clean( $posted['payment_status'] ) ); + } } /** diff --git a/includes/gateways/paypal/includes/class-wc-gateway-paypal-pdt-handler.php b/includes/gateways/paypal/includes/class-wc-gateway-paypal-pdt-handler.php index 69d1dd2dc6b..2ef5b944ac4 100644 --- a/includes/gateways/paypal/includes/class-wc-gateway-paypal-pdt-handler.php +++ b/includes/gateways/paypal/includes/class-wc-gateway-paypal-pdt-handler.php @@ -88,28 +88,41 @@ class WC_Gateway_Paypal_PDT_Handler extends WC_Gateway_Paypal_Response { $transaction_result = $this->validate_transaction( $transaction ); - if ( $transaction_result && 'completed' === $status ) { - if ( $order->get_total() != $amount ) { - WC_Gateway_Paypal::log( 'Payment error: Amounts do not match (amt ' . $amount . ')' ); - $this->payment_on_hold( $order, sprintf( __( 'Validation error: PayPal amounts do not match (amt %s).', 'woocommerce' ), $amount ) ); - } else { - $this->payment_complete( $order, $transaction, __( 'PDT payment completed', 'woocommerce' ) ); + WC_Gateway_Paypal::log( 'PDT Transaction Result: ' . print_r( $transaction_result, true ) ); - // Log paypal transaction fee and other meta data. - if ( ! empty( $transaction_result['mc_fee'] ) ) { - update_post_meta( $order->id, 'PayPal Transaction Fee', $transaction_result['mc_fee'] ); + update_post_meta( $order->id, '_paypal_status', $status ); + update_post_meta( $order->id, '_transaction_id', $transaction ); + + if ( $transaction_result ) { + if ( 'completed' === $status ) { + if ( $order->get_total() != $amount ) { + WC_Gateway_Paypal::log( 'Payment error: Amounts do not match (amt ' . $amount . ')' ); + $this->payment_on_hold( $order, sprintf( __( 'Validation error: PayPal amounts do not match (amt %s).', 'woocommerce' ), $amount ) ); + } else { + $this->payment_complete( $order, $transaction, __( 'PDT payment completed', 'woocommerce' ) ); + + // Log paypal transaction fee and other meta data. + if ( ! empty( $transaction_result['mc_fee'] ) ) { + update_post_meta( $order->id, 'PayPal Transaction Fee', $transaction_result['mc_fee'] ); + } + if ( ! empty( $transaction_result['payer_email'] ) ) { + update_post_meta( $order->id, 'Payer PayPal address', $transaction_result['payer_email'] ); + } + if ( ! empty( $transaction_result['first_name'] ) ) { + update_post_meta( $order->id, 'Payer first name', $transaction_result['first_name'] ); + } + if ( ! empty( $transaction_result['last_name'] ) ) { + update_post_meta( $order->id, 'Payer last name', $transaction_result['last_name'] ); + } + if ( ! empty( $transaction_result['payment_type'] ) ) { + update_post_meta( $order->id, 'Payment type', $transaction_result['payment_type'] ); + } } - if ( ! empty( $transaction_result['payer_email'] ) ) { - update_post_meta( $order->id, 'Payer PayPal address', $transaction_result['payer_email'] ); - } - if ( ! empty( $transaction_result['first_name'] ) ) { - update_post_meta( $order->id, 'Payer first name', $transaction_result['first_name'] ); - } - if ( ! empty( $transaction_result['last_name'] ) ) { - update_post_meta( $order->id, 'Payer last name', $transaction_result['last_name'] ); - } - if ( ! empty( $transaction_result['payment_type'] ) ) { - update_post_meta( $order->id, 'Payment type', $transaction_result['payment_type'] ); + } else { + if ( 'authorization' === $transaction_result['pending_reason'] ) { + $this->payment_on_hold( $order, __( 'Payment authorized. Change payment status to processing or complete to capture funds.', 'woocommerce' ) ); + } else { + $this->payment_on_hold( $order, sprintf( __( 'Payment pending (%s).', 'woocommerce' ), $transaction_result['pending_reason'] ) ); } } } diff --git a/includes/gateways/paypal/includes/class-wc-gateway-paypal-refund.php b/includes/gateways/paypal/includes/class-wc-gateway-paypal-refund.php deleted file mode 100644 index 0e80ab97ca6..00000000000 --- a/includes/gateways/paypal/includes/class-wc-gateway-paypal-refund.php +++ /dev/null @@ -1,81 +0,0 @@ - '84.0', - 'SIGNATURE' => self::$api_signature, - 'USER' => self::$api_username, - 'PWD' => self::$api_password, - 'METHOD' => 'RefundTransaction', - 'TRANSACTIONID' => $order->get_transaction_id(), - 'NOTE' => html_entity_decode( wc_trim_string( $reason, 255 ), ENT_NOQUOTES, 'UTF-8' ), - 'REFUNDTYPE' => 'Full' - ); - if ( ! is_null( $amount ) ) { - $request['AMT'] = number_format( $amount, 2, '.', '' ); - $request['CURRENCYCODE'] = $order->get_order_currency(); - $request['REFUNDTYPE'] = 'Partial'; - } - return apply_filters( 'woocommerce_paypal_refund_request', $request, $order, $amount, $reason ); - } - - /** - * Refund an order via PayPal. - * @param WC_Order $order - * @param float $amount - * @param string $reason - * @param bool $sandbox - * @return array|wp_error The parsed response from paypal, or a WP_Error object - */ - public static function refund_order( $order, $amount = null, $reason = '', $sandbox = false ) { - $response = wp_safe_remote_post( - $sandbox ? 'https://api-3t.sandbox.paypal.com/nvp' : 'https://api-3t.paypal.com/nvp', - array( - 'method' => 'POST', - 'body' => self::get_request( $order, $amount, $reason ), - 'timeout' => 70, - 'user-agent' => 'WooCommerce', - 'httpversion' => '1.1' - ) - ); - - WC_Gateway_Paypal::log( 'Refund Response: ' . print_r( $response, true ) ); - - if ( is_wp_error( $response ) ) { - return $response; - } - - if ( empty( $response['body'] ) ) { - return new WP_Error( 'paypal-refunds', 'Empty Response' ); - } - - parse_str( $response['body'], $response_array ); - - return $response_array; - } -} diff --git a/includes/shipping/flat-rate/includes/settings-flat-rate.php b/includes/shipping/flat-rate/includes/settings-flat-rate.php index e6f304cf4c3..7f0cd8a1831 100644 --- a/includes/shipping/flat-rate/includes/settings-flat-rate.php +++ b/includes/shipping/flat-rate/includes/settings-flat-rate.php @@ -44,7 +44,7 @@ if ( ! empty( $shipping_classes ) ) { 'title' => __( 'Shipping Class Costs', 'woocommerce' ), 'type' => 'title', 'default' => '', - 'description' => sprintf( __( 'These costs can optionally be added based on the %sproduct shipping class%s.', 'woocommerce' ), '', '' ) + 'description' => sprintf( __( 'These costs can optionally be added based on the %sproduct shipping class%s.', 'woocommerce' ), '', '' ) ); foreach ( $shipping_classes as $shipping_class ) { if ( ! isset( $shipping_class->term_id ) ) { diff --git a/includes/shipping/legacy-flat-rate/includes/settings-flat-rate.php b/includes/shipping/legacy-flat-rate/includes/settings-flat-rate.php index a5ee38a0542..9e3f2a307d8 100644 --- a/includes/shipping/legacy-flat-rate/includes/settings-flat-rate.php +++ b/includes/shipping/legacy-flat-rate/includes/settings-flat-rate.php @@ -71,7 +71,7 @@ if ( ! empty( $shipping_classes ) ) { 'title' => __( 'Shipping Class Costs', 'woocommerce' ), 'type' => 'title', 'default' => '', - 'description' => sprintf( __( 'These costs can optionally be added based on the %sproduct shipping class%s.', 'woocommerce' ), '', '' ) + 'description' => sprintf( __( 'These costs can optionally be added based on the %sproduct shipping class%s.', 'woocommerce' ), '', '' ) ); foreach ( $shipping_classes as $shipping_class ) { if ( ! isset( $shipping_class->term_id ) ) { diff --git a/includes/shortcodes/class-wc-shortcode-my-account.php b/includes/shortcodes/class-wc-shortcode-my-account.php index 38c0beefbf7..39033c0c597 100644 --- a/includes/shortcodes/class-wc-shortcode-my-account.php +++ b/includes/shortcodes/class-wc-shortcode-my-account.php @@ -41,6 +41,11 @@ class WC_Shortcode_My_Account { wc_add_notice( $message ); } + // After password reset, add confirmation message. + if ( ! empty( $_GET['password-reset'] ) ) { + wc_add_notice( __( 'Your password has been reset successfully.', 'woocommerce' ) ); + } + if ( isset( $wp->query_vars['lost-password'] ) ) { self::lost_password(); } else { @@ -188,12 +193,6 @@ class WC_Shortcode_My_Account { if ( ! empty( $_GET['reset-link-sent'] ) ) { return wc_get_template( 'myaccount/lost-password-confirmation.php' ); - /** - * After reset, show confirmation message. - */ - } elseif ( ! empty( $_GET['reset'] ) ) { - wc_add_notice( __( 'Your password has been reset.', 'woocommerce' ) . ' ' . __( 'Log in', 'woocommerce' ) . '' ); - /** * Process reset key / login from email confirmation link */ diff --git a/includes/walkers/class-product-cat-dropdown-walker.php b/includes/walkers/class-product-cat-dropdown-walker.php index 9e88bf608c1..5ee5bd32450 100644 --- a/includes/walkers/class-product-cat-dropdown-walker.php +++ b/includes/walkers/class-product-cat-dropdown-walker.php @@ -47,26 +47,26 @@ class WC_Product_Cat_Dropdown_Walker extends Walker { */ public function start_el( &$output, $cat, $depth = 0, $args = array(), $current_object_id = 0 ) { - if ( ! empty( $args['hierarchical'] ) ) + if ( ! empty( $args['hierarchical'] ) ) { $pad = str_repeat(' ', $depth * 3); - else + } else { $pad = ''; + } $cat_name = apply_filters( 'list_product_cats', $cat->name, $cat ); + $value = isset( $args['value'] ) && $args['value'] == 'id' ? $cat->term_id : $cat->slug; + $output .= "\t\n"; } diff --git a/includes/wc-cart-functions.php b/includes/wc-cart-functions.php index 0a1279cb365..977f4f93c4a 100644 --- a/includes/wc-cart-functions.php +++ b/includes/wc-cart-functions.php @@ -85,13 +85,14 @@ function wc_get_raw_referer() { * @access public * @param int|array $products * @param bool $show_qty Should qty's be shown? Added in 2.6.0 + * @param bool $return Return message rather than add it. */ -function wc_add_to_cart_message( $products, $show_qty = false ) { +function wc_add_to_cart_message( $products, $show_qty = false, $return = false ) { $titles = array(); $count = 0; if ( ! is_array( $products ) ) { - $products = array( $products ); + $products = array( $products => 1 ); $show_qty = false; } @@ -115,7 +116,13 @@ function wc_add_to_cart_message( $products, $show_qty = false ) { $message = sprintf( '%s %s', esc_url( wc_get_page_permalink( 'cart' ) ), esc_html__( 'View Cart', 'woocommerce' ), esc_html( $added_text ) ); } - wc_add_notice( apply_filters( 'wc_add_to_cart_message', $message, $product_id ) ); + $message = apply_filters( 'wc_add_to_cart_message', $message, $product_id ); + + if ( $return ) { + return $message; + } else { + wc_add_notice( $message ); + } } /** diff --git a/includes/wc-formatting-functions.php b/includes/wc-formatting-functions.php index d6431432ab8..d1f50f0dd3d 100644 --- a/includes/wc-formatting-functions.php +++ b/includes/wc-formatting-functions.php @@ -668,6 +668,9 @@ function wc_format_postcode( $postcode, $country ) { case 'JP' : $postcode = trim( substr_replace( $postcode, '-', 3, 0 ) ); break; + case 'PL' : + $postcode = trim( substr_replace( $postcode, '-', -3, 0 ) ); + break; case 'PT' : $postcode = trim( substr_replace( $postcode, '-', 4, 0 ) ); break; diff --git a/includes/wc-order-functions.php b/includes/wc-order-functions.php index c5c0dbb6f66..ab9d020c587 100644 --- a/includes/wc-order-functions.php +++ b/includes/wc-order-functions.php @@ -860,7 +860,7 @@ function wc_create_refund( $args = array() ) { $order = wc_get_order( $args['order_id'] ); // Refund currency is the same used for the parent order - update_post_meta( $refund_id, '_order_currency', $order->get_order_currency() ); + update_post_meta( $refund_id, '_order_currency', $order->get_currency() ); // Negative line items if ( sizeof( $args['line_items'] ) > 0 ) { @@ -917,7 +917,7 @@ function wc_create_refund( $args = array() ) { $refund->calculate_totals( false ); // Set total to total refunded which may vary from order items - $refund->set_total( wc_format_decimal( $args['amount'] ) * -1, 'total' ); + $refund->set_total( wc_format_decimal( $args['amount'] ) * -1 ); do_action( 'woocommerce_refund_created', $refund_id, $args ); } @@ -1065,3 +1065,134 @@ function wc_order_search( $term ) { return $post_ids; } + + +/** + * Update total sales amount for each product within a paid order. + * + * @since 2.7.0 + * @param int $order_id + */ +function wc_update_total_sales_counts( $order_id ) { + $order = wc_get_order( $order_id ); + + if ( ! $order || 'yes' === get_post_meta( $order_id, '_recorded_sales', true ) ) { + return; + } + + if ( sizeof( $order->get_items() ) > 0 ) { + foreach ( $order->get_items() as $item ) { + if ( $item['product_id'] > 0 ) { + update_post_meta( $item['product_id'], 'total_sales', absint( get_post_meta( $item['product_id'], 'total_sales', true ) ) + absint( $item['qty'] ) ); + } + } + } + + update_post_meta( $order_id, '_recorded_sales', 'yes' ); + + /** + * Called when sales for an order are recorded + * + * @param int $order_id order id + */ + do_action( 'woocommerce_recorded_sales', $order_id ); +} +add_action( 'woocommerce_order_status_completed', 'wc_update_total_sales_counts' ); +add_action( 'woocommerce_order_status_processing', 'wc_update_total_sales_counts' ); +add_action( 'woocommerce_order_status_on-hold', 'wc_update_total_sales_counts' ); + +/** + * Update used coupon amount for each coupon within an order. + * + * @since 2.7.0 + * @param int $order_id + */ +function wc_update_coupon_usage_counts( $order_id ) { + $order = wc_get_order( $order_id ); + $has_recorded = get_post_meta( $order_id, '_recorded_coupon_usage_counts', true ); + + if ( ! $order ) { + return; + } + + if ( $order->has_status( 'cancelled' ) && 'yes' === $has_recorded ) { + $action = 'reduce'; + delete_post_meta( $order_id, '_recorded_coupon_usage_counts' ); + } elseif ( ! $order->has_status( 'cancelled' ) && 'yes' !== $has_recorded ) { + $action = 'increase'; + update_post_meta( $order_id, '_recorded_coupon_usage_counts', 'yes' ); + } else { + return; + } + + if ( sizeof( $order->get_used_coupons() ) > 0 ) { + foreach ( $order->get_used_coupons() as $code ) { + if ( ! $code ) { + continue; + } + + $coupon = new WC_Coupon( $code ); + + if ( ! $used_by = $order->get_user_id() ) { + $used_by = $order->get_billing_email(); + } + + switch ( $action ) { + case 'reduce' : + $coupon->dcr_usage_count( $used_by ); + break; + case 'increase' : + $coupon->inc_usage_count( $used_by ); + break; + } + } + } +} +add_action( 'woocommerce_order_status_completed', 'wc_update_total_sales_counts' ); +add_action( 'woocommerce_order_status_processing', 'wc_update_total_sales_counts' ); +add_action( 'woocommerce_order_status_on-hold', 'wc_update_total_sales_counts' ); +add_action( 'woocommerce_order_status_cancelled', 'wc_update_total_sales_counts' ); + +/** + * When a payment is complete, we can reduce stock levels for items within an order. + * @since 2.7.0 + * @param int $order_id + */ +function wc_maybe_reduce_stock_levels( $order_id ) { + if ( apply_filters( 'woocommerce_payment_complete_reduce_order_stock', ! get_post_meta( $order_id, '_order_stock_reduced', true ), $order_id ) ) { + wc_reduce_stock_levels( $order_id ); + add_post_meta( $order_id, '_order_stock_reduced', '1', true ); + } +} +add_action( 'woocommerce_payment_complete', 'wc_maybe_reduce_stock_levels' ); + +/** + * Reduce stock levels for items within an order. + * @since 2.7.0 + * @param int $order_id + */ +function wc_reduce_stock_levels( $order_id ) { + $order = wc_get_order( $order_id ); + + if ( 'yes' === get_option( 'woocommerce_manage_stock' ) && $order && apply_filters( 'woocommerce_can_reduce_order_stock', true, $order ) && sizeof( $order->get_items() ) > 0 ) { + foreach ( $order->get_items() as $item ) { + if ( $item->is_type( 'line_item' ) && ( $product = $item->get_product() ) && $product->managing_stock() ) { + $qty = apply_filters( 'woocommerce_order_item_quantity', $item['qty'], $order, $item ); + $new_stock = $product->reduce_stock( $qty ); + $item_name = $product->get_sku() ? $product->get_sku(): $item['product_id']; + + if ( ! empty( $item['variation_id'] ) ) { + $order->add_order_note( sprintf( __( 'Item %s variation #%s stock reduced from %s to %s.', 'woocommerce' ), $item_name, $item['variation_id'], $new_stock + $qty, $new_stock ) ); + } else { + $order->add_order_note( sprintf( __( 'Item %s stock reduced from %s to %s.', 'woocommerce' ), $item_name, $new_stock + $qty, $new_stock ) ); + } + + if ( $new_stock < 0 ) { + do_action( 'woocommerce_product_on_backorder', array( 'product' => $product, 'order_id' => $order_id, 'quantity' => $qty_ordered ) ); + } + } + } + + do_action( 'woocommerce_reduce_order_stock', $order ); + } +} diff --git a/includes/wc-rest-functions.php b/includes/wc-rest-functions.php index ddb3dfeb2f8..083fe11c330 100644 --- a/includes/wc-rest-functions.php +++ b/includes/wc-rest-functions.php @@ -306,9 +306,10 @@ function wc_rest_check_product_term_permissions( $taxonomy, $context = 'read', $ */ function wc_rest_check_manager_permissions( $object, $context = 'read' ) { $objects = array( - 'reports' => 'view_woocommerce_reports', - 'settings' => 'manage_woocommerce', - 'attributes' => 'manage_product_terms', + 'reports' => 'view_woocommerce_reports', + 'settings' => 'manage_woocommerce', + 'system_status' => 'manage_woocommerce', + 'attributes' => 'manage_product_terms', ); $permission = current_user_can( $objects[ $object ] ); diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index c02bb358d75..462f8a582e0 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -27,7 +27,7 @@ function wc_template_redirect() { } // When on the checkout with an empty cart, redirect to cart page - elseif ( is_page( wc_get_page_id( 'checkout' ) ) && WC()->cart->is_empty() && empty( $wp->query_vars['order-pay'] ) && ! isset( $wp->query_vars['order-received'] ) ) { + elseif ( is_page( wc_get_page_id( 'checkout' ) ) && wc_get_page_id( 'checkout' ) !== wc_get_page_id( 'cart' ) && WC()->cart->is_empty() && empty( $wp->query_vars['order-pay'] ) && ! isset( $wp->query_vars['order-received'] ) ) { wc_add_notice( __( 'Checkout is not available whilst your cart is empty.', 'woocommerce' ), 'notice' ); wp_redirect( wc_get_page_permalink( 'cart' ) ); exit; @@ -337,6 +337,40 @@ function wc_product_post_class( $classes, $class = '', $post_id = '' ) { return $classes; } +/** + * Outputs hidden form inputs for each query string variable. + * @since 2.7.0 + * @param array $values Name value pairs. + * @param array $exclude Keys to exclude. + * @param string $current_key Current key we are outputting. + */ +function wc_query_string_form_fields( $values = null, $exclude = array(), $current_key = '', $return = false ) { + if ( is_null( $values ) ) { + $values = $_GET; + } + $html = ''; + + foreach ( $values as $key => $value ) { + if ( in_array( $key, $exclude, true ) ) { + continue; + } + if ( $current_key ) { + $key = $current_key . '[' . $key . ']'; + } + if ( is_array( $value ) ) { + $html .= wc_query_string_form_fields( $value, $exclude, $key, true ); + } else { + $html .= ''; + } + } + + if ( $return ) { + return $html; + } else { + echo $html; + } +} + /** Template pages ********************************************************/ if ( ! function_exists( 'woocommerce_content' ) ) { @@ -606,7 +640,7 @@ if ( ! function_exists( 'woocommerce_product_archive_description' ) ) { if ( is_search() ) { return; } - + if ( is_post_type_archive( 'product' ) && 0 === absint( get_query_var( 'paged' ) ) ) { $shop_page = get_post( wc_get_page_id( 'shop' ) ); if ( $shop_page ) { @@ -1085,7 +1119,7 @@ if ( ! function_exists( 'woocommerce_default_product_tabs' ) ) { } // Additional information tab - shows attributes - if ( $product && ( $product->has_attributes() || ( $product->enable_dimensions_display() && ( $product->has_dimensions() || $product->has_weight() ) ) ) ) { + if ( $product && ( $product->has_attributes() || $product->enable_dimensions_display() ) ) { $tabs['additional_information'] = array( 'title' => __( 'Additional Information', 'woocommerce' ), 'priority' => 20, @@ -1334,7 +1368,29 @@ if ( ! function_exists( 'woocommerce_button_proceed_to_checkout' ) ) { } } +if ( ! function_exists( 'woocommerce_widget_shopping_cart_button_view_cart' ) ) { + /** + * Output the proceed to checkout button. + * + * @subpackage Cart + */ + function woocommerce_widget_shopping_cart_button_view_cart() { + echo '' . __( 'View Cart', 'woocommerce' ) . ''; + } +} + +if ( ! function_exists( 'woocommerce_widget_shopping_cart_proceed_to_checkout' ) ) { + + /** + * Output the proceed to checkout button. + * + * @subpackage Cart + */ + function woocommerce_widget_shopping_cart_proceed_to_checkout() { + echo '' . __( 'Checkout', 'woocommerce' ) . ''; + } +} /** Mini-Cart *************************************************************/ @@ -1672,10 +1728,13 @@ if ( ! function_exists( 'woocommerce_subcategory_thumbnail' ) ) { $thumbnail_id = get_woocommerce_term_meta( $category->term_id, 'thumbnail_id', true ); if ( $thumbnail_id ) { - $image = wp_get_attachment_image_src( $thumbnail_id, $small_thumbnail_size ); - $image = $image[0]; + $image = wp_get_attachment_image_src( $thumbnail_id, $small_thumbnail_size ); + $image = $image[0]; + $image_srcset = function_exists( 'wp_get_attachment_image_srcset' ) ? wp_get_attachment_image_srcset( $thumbnail_id, $small_thumbnail_size ) : false; + $image_sizes = function_exists( 'wp_get_attachment_image_sizes' ) ? wp_get_attachment_image_sizes( $thumbnail_id, $small_thumbnail_size ) : false; } else { - $image = wc_placeholder_img_src(); + $image = wc_placeholder_img_src(); + $image_srcset = $image_sizes = false; } if ( $image ) { @@ -1683,7 +1742,12 @@ if ( ! function_exists( 'woocommerce_subcategory_thumbnail' ) ) { // Ref: https://core.trac.wordpress.org/ticket/23605 $image = str_replace( ' ', '%20', $image ); - echo '' . esc_attr( $category->name ) . ''; + // Add responsive image markup if available + if ( $image_srcset && $image_sizes ) { + echo '' . esc_attr( $category->name ) . ''; + } else { + echo '' . esc_attr( $category->name ) . ''; + } } } } @@ -1961,11 +2025,19 @@ if ( ! function_exists( 'get_product_search_form' ) ) { * @return string */ function get_product_search_form( $echo = true ) { + global $product_search_form_index; + ob_start(); + if ( empty( $product_search_form_index ) ) { + $product_search_form_index = 0; + } + do_action( 'pre_get_product_search_form' ); - wc_get_template( 'product-searchform.php' ); + wc_get_template( 'product-searchform.php', array( + 'index' => $product_search_form_index++, + ) ); $form = apply_filters( 'get_product_search_form', ob_get_clean() ); @@ -2204,3 +2276,126 @@ if ( ! function_exists( 'woocommerce_account_edit_account' ) ) { WC_Shortcode_My_Account::edit_account(); } } + + +if ( ! function_exists( 'wc_get_email_order_items' ) ) { + /** + * Get HTML for the order items to be shown in emails. + * @param WC_Order $order + * @param array $args + * @since 2.7.0 + */ + function wc_get_email_order_items( $order, $args = array() ) { + ob_start(); + + $defaults = array( + 'show_sku' => false, + 'show_image' => false, + 'image_size' => array( 32, 32 ), + 'plain_text' => false + ); + + $args = wp_parse_args( $args, $defaults ); + $template = $args['plain_text'] ? 'emails/plain/email-order-items.php' : 'emails/email-order-items.php'; + + wc_get_template( $template, array( + 'order' => $order, + 'items' => $order->get_items(), + 'show_download_links' => $order->is_download_permitted(), + 'show_sku' => $args['show_sku'], + 'show_purchase_note' => $order->is_paid(), + 'show_image' => $args['show_image'], + 'image_size' => $args['image_size'], + ) ); + + return apply_filters( 'woocommerce_email_order_items_table', ob_get_clean(), $order ); + } +} + +if ( ! function_exists( 'wc_display_item_meta' ) ) { + /** + * Display item meta data. + * @since 2.7.0 + * @param WC_Item $item + * @param array $args + * @return string|void + */ + function wc_display_item_meta( $item, $args = array() ) { + $strings = array(); + $html = ''; + $args = wp_parse_args( $args, array( + 'before' => '
    • ', + 'after' => '
    ', + 'separator' => '
  • ', + 'echo' => true, + 'autop' => false, + ) ); + + foreach ( $item->get_formatted_meta_data() as $meta_id => $meta ) { + if ( '_' === substr( $meta->key, 0, 1 ) ) { + continue; + } + $value = $args['autop'] ? wp_kses_post( wpautop( make_clickable( $meta->display_value ) ) ) : wp_kses_post( make_clickable( $meta->display_value ) ); + $strings[] = '' . wp_kses_post( $meta->display_key ) . ': ' . $value; + } + + if ( $strings ) { + $html = $args['before'] . implode( $args['separator'], $strings ) . $args['after']; + } + + $html = apply_filters( 'woocommerce_display_item_meta', $html, $item, $args ); + + if ( $args['echo'] ) { + echo $html; + } else { + return $html; + } + } +} + +if ( ! function_exists( 'wc_display_item_downloads' ) ) { + /** + * Display item download links. + * @since 2.7.0 + * @param WC_Item $item + * @param array $args + * @return string|void + */ + function wc_display_item_downloads( $item, $args = array() ) { + $strings = array(); + $html = ''; + $args = wp_parse_args( $args, array( + 'before' => '
    • ', + 'after' => '
    ', + 'separator' => '
  • ', + 'echo' => true, + 'show_url' => false, + ) ); + + if ( is_object( $item ) && $item->is_type( 'line_item' ) && ( $downloads = $item->get_item_downloads() ) ) { + $i = 0; + foreach ( $downloads as $file ) { + $i ++; + + if ( $args['show_url'] ) { + $strings[] = '' . esc_html( $file['name'] ) . ': ' . esc_html( $file['download_url'] ); + } else { + $prefix = sizeof( $downloads ) > 1 ? sprintf( __( 'Download %d', 'woocommerce' ), $i ) : __( 'Download', 'woocommerce' ); + $strings[] = '' . $prefix . ': ' . esc_html( $file['name'] ) . ''; + } + } + } + + if ( $strings ) { + $html = $args['before'] . implode( $args['separator'], $strings ) . $args['after']; + } + + $html = apply_filters( 'woocommerce_display_item_downloads', $html, $item, $args ); + + if ( $args['echo'] ) { + echo $html; + } else { + return $html; + } + } +} diff --git a/includes/wc-template-hooks.php b/includes/wc-template-hooks.php index 6795f98ddeb..275263824fb 100644 --- a/includes/wc-template-hooks.php +++ b/includes/wc-template-hooks.php @@ -204,6 +204,11 @@ add_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_for add_action( 'woocommerce_checkout_order_review', 'woocommerce_order_review', 10 ); add_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 ); +/** + * Cart widget + */ +add_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_button_view_cart', 10 ); +add_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_proceed_to_checkout', 20 ); /** * Cart. diff --git a/includes/wc-update-functions.php b/includes/wc-update-functions.php index 423538394d1..456ff7dc085 100644 --- a/includes/wc-update-functions.php +++ b/includes/wc-update-functions.php @@ -970,3 +970,20 @@ function wc_update_260_refunds() { function wc_update_260_db_version() { WC_Install::update_db_version( '2.6.0' ); } + +function wc_update_270_webhooks() { + /** + * Make sure product.update webhooks get the woocommerce_product_quick_edit_save + * and woocommerce_product_bulk_edit_save hooks. + */ + $product_update_webhooks = get_posts( array( + 'posts_per_page' => -1, + 'post_type' => 'shop_webhook', + 'meta_key' => '_topic', + 'meta_value' => 'product.updated' + ) ); + foreach ( $product_update_webhooks as $product_update_webhook ) { + $webhook = new WC_Webhook( $product_update_webhook->ID ); + $webhook->set_topic( 'product.updated' ); + } +} diff --git a/includes/wc-user-functions.php b/includes/wc-user-functions.php index 43ce6b7505e..53e3fb079f5 100644 --- a/includes/wc-user-functions.php +++ b/includes/wc-user-functions.php @@ -176,17 +176,18 @@ function wc_update_new_customer_past_orders( $customer_id ) { * @param int $order_id */ function wc_paying_customer( $order_id ) { - $order = wc_get_order( $order_id ); + $order = wc_get_order( $order_id ); + $customer_id = $order->get_customer_id(); - if ( $order->user_id > 0 && 'refund' !== $order->order_type ) { - update_user_meta( $order->user_id, 'paying_customer', 1 ); + if ( $customer_id > 0 && 'refund' !== $order->get_type() ) { + update_user_meta( $customer_id, 'paying_customer', 1 ); - $old_spent = absint( get_user_meta( $order->user_id, '_money_spent', true ) ); - update_user_meta( $order->user_id, '_money_spent', $old_spent + $order->order_total ); + $old_spent = absint( get_user_meta( $customer_id, '_money_spent', true ) ); + update_user_meta( $customer_id, '_money_spent', $old_spent + $order->order_total ); } - if ( $order->user_id > 0 && 'simple' === $order->order_type ) { - $old_count = absint( get_user_meta( $order->user_id, '_order_count', true ) ); - update_user_meta( $order->user_id, '_order_count', $old_count + 1 ); + if ( $customer_id > 0 && 'shop_order' === $order->get_type() ) { + $old_count = absint( get_user_meta( $customer_id, '_order_count', true ) ); + update_user_meta( $customer_id, '_order_count', $old_count + 1 ); } } add_action( 'woocommerce_order_status_completed', 'wc_paying_customer' ); @@ -446,7 +447,7 @@ function wc_get_customer_available_downloads( $customer_id ) { array( 'download_file' => $product_id, 'order' => $result->order_key, - 'email' => $result->user_email, + 'email' => urlencode( $result->user_email ), 'key' => $result->download_id ), home_url( '/' ) diff --git a/includes/widgets/class-wc-widget-price-filter.php b/includes/widgets/class-wc-widget-price-filter.php index fb70ebdf3dd..a9010ffb288 100644 --- a/includes/widgets/class-wc-widget-price-filter.php +++ b/includes/widgets/class-wc-widget-price-filter.php @@ -68,45 +68,6 @@ class WC_Widget_Price_Filter extends WC_Widget { wp_enqueue_script( 'wc-price-slider' ); - // Remember current filters/search - $fields = ''; - - if ( get_search_query() ) { - $fields .= ''; - } - - if ( ! empty( $_GET['post_type'] ) ) { - $fields .= ''; - } - - if ( ! empty ( $_GET['product_cat'] ) ) { - $fields .= ''; - } - - if ( ! empty( $_GET['product_tag'] ) ) { - $fields .= ''; - } - - if ( ! empty( $_GET['orderby'] ) ) { - $fields .= ''; - } - - if ( ! empty( $_GET['min_rating'] ) ) { - $fields .= ''; - } - - if ( $_chosen_attributes = WC_Query::get_layered_nav_chosen_attributes() ) { - foreach ( $_chosen_attributes as $attribute => $data ) { - $taxonomy_filter = 'filter_' . str_replace( 'pa_', '', $attribute ); - - $fields .= ''; - - if ( 'or' == $data['query_type'] ) { - $fields .= ''; - } - } - } - // Find min and max price in current result set $prices = $this->get_filtered_price(); $min = floor( $prices->min_price ); @@ -152,7 +113,7 @@ class WC_Widget_Price_Filter extends WC_Widget { - ' . $fields . ' + ' . wc_query_string_form_fields( null, array( 'min_price', 'max_price' ), '', true ) . '
  • diff --git a/includes/widgets/class-wc-widget-recently-viewed.php b/includes/widgets/class-wc-widget-recently-viewed.php index 2ef0f26fae5..5748df62552 100644 --- a/includes/widgets/class-wc-widget-recently-viewed.php +++ b/includes/widgets/class-wc-widget-recently-viewed.php @@ -75,14 +75,14 @@ class WC_Widget_Recently_Viewed extends WC_Widget { $this->widget_start( $args, $instance ); - echo '
      '; + echo apply_filters( 'woocommerce_before_widget_product_list', '
        ' ); while ( $r->have_posts() ) { $r->the_post(); wc_get_template( 'content-widget-product.php' ); } - echo '
      '; + echo apply_filters( 'woocommerce_after_widget_product_list', '
    ' ); $this->widget_end( $args ); } diff --git a/includes/widgets/class-wc-widget-top-rated-products.php b/includes/widgets/class-wc-widget-top-rated-products.php index c86b079e1ff..a6fad9a7e81 100644 --- a/includes/widgets/class-wc-widget-top-rated-products.php +++ b/includes/widgets/class-wc-widget-top-rated-products.php @@ -74,14 +74,14 @@ class WC_Widget_Top_Rated_Products extends WC_Widget { $this->widget_start( $args, $instance ); - echo '
      '; + echo apply_filters( 'woocommerce_before_widget_product_list', '
        ' ); while ( $r->have_posts() ) { $r->the_post(); wc_get_template( 'content-widget-product.php', array( 'show_rating' => true ) ); } - echo '
      '; + echo apply_filters( 'woocommerce_after_widget_product_list', '
    ' ); $this->widget_end( $args ); } diff --git a/readme.txt b/readme.txt index f444d00d4db..39d85ff8e6b 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,5 @@ === WooCommerce === -Contributors: automattic, mikejolley, jameskoster, claudiosanches, jshreve, coderkevin, woothemes, BFTrick +Contributors: automattic, mikejolley, jameskoster, claudiosanches, jshreve, coderkevin, woothemes, BFTrick, iCaleb Tags: ecommerce, e-commerce, store, sales, sell, shop, cart, checkout, downloadable, downloads, paypal, storefront Requires at least: 4.4 Tested up to: 4.5 @@ -162,6 +162,11 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc * Respect stock status and prevent the "out of stock threshold" setting affecting existing in-stock products. * Added Nigerian Provinces to i18n/state. * Improved handling of shop page rewrite rules to allow subpages. +* Redirect to login after password reset. +* When using authorizations in PayPal standard, automatically capture funds when the order goes processing/completed. +* On multisite, when a user logs into a store with an account on a site, but not the current site, rather than error, add the user to the current site as a customer. +* Show variable weights/dimensions even when parent values are not set. +* Automatically sort tax rates rather than allow clunky manual sorting. [See changelog for all versions](https://raw.githubusercontent.com/woothemes/woocommerce/master/CHANGELOG.txt). diff --git a/templates/cart/mini-cart.php b/templates/cart/mini-cart.php index c2dd4980feb..89728a0a772 100644 --- a/templates/cart/mini-cart.php +++ b/templates/cart/mini-cart.php @@ -31,7 +31,7 @@ if ( ! defined( 'ABSPATH' ) ) { cart->is_empty() ) : ?> - + cart->get_cart() as $cart_item_key => $cart_item ) { $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key ); @@ -70,7 +70,7 @@ if ( ! defined( 'ABSPATH' ) ) { ?> - +
  • @@ -86,8 +86,7 @@ if ( ! defined( 'ABSPATH' ) ) {

    - - +

    diff --git a/templates/loop/orderby.php b/templates/loop/orderby.php index f958159e5d1..f262297d35d 100644 --- a/templates/loop/orderby.php +++ b/templates/loop/orderby.php @@ -27,19 +27,5 @@ if ( ! defined( 'ABSPATH' ) ) { - $val ) { - if ( 'orderby' === $key || 'submit' === $key ) { - continue; - } - if ( is_array( $val ) ) { - foreach( $val as $innerVal ) { - echo ''; - } - } else { - echo ''; - } - } - ?> + diff --git a/templates/product-searchform.php b/templates/product-searchform.php index 44ef0d09868..9a48388c40c 100644 --- a/templates/product-searchform.php +++ b/templates/product-searchform.php @@ -16,16 +16,14 @@ * @version 2.5.0 */ -// Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) { exit; } ?> - - - + + diff --git a/templates/single-product/product-attributes.php b/templates/single-product/product-attributes.php index 9c548243674..bcf2e29380c 100644 --- a/templates/single-product/product-attributes.php +++ b/templates/single-product/product-attributes.php @@ -33,17 +33,17 @@ ob_start(); enable_dimensions_display() ) : ?> - has_weight() ) : $has_row = true; ?> + has_weight() || get_post_meta( $product->id, '_child_has_weight', true ) ) : $has_row = true; ?> - + - has_dimensions() ) : $has_row = true; ?> + has_dimensions() || get_post_meta( $product->id, '_child_has_dimensions', true ) ) : $has_row = true; ?> - + diff --git a/templates/single-product/review-meta.php b/templates/single-product/review-meta.php index 1361da943ef..77d8f62614b 100644 --- a/templates/single-product/review-meta.php +++ b/templates/single-product/review-meta.php @@ -13,11 +13,11 @@ * @see https://docs.woocommerce.com/document/template-structure/ * @author WooThemes * @package WooCommerce/Templates - * @version 2.6.0 + * @version 2.7.0 */ if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly + exit; // Exit if accessed directly. } global $comment; @@ -25,18 +25,18 @@ $verified = wc_review_is_from_verified_owner( $comment->comment_ID ); if ( '0' === $comment->comment_approved ) { ?> -

    +

    - (' . esc_attr__( 'verified owner', 'woocommerce' ) . ') '; + echo '(' . esc_attr__( 'verified owner', 'woocommerce' ) . ') '; } - ?>– : + ?>

    post_excerpt ) { return; } -echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ); +?> +
    + post_excerpt ); ?> +
    diff --git a/tests/framework/helpers/class-wc-helper-order.php b/tests/framework/helpers/class-wc-helper-order.php index 480f03e03a3..5b4ea31cd82 100644 --- a/tests/framework/helpers/class-wc-helper-order.php +++ b/tests/framework/helpers/class-wc-helper-order.php @@ -51,7 +51,7 @@ class WC_Helper_Order { $order = wc_create_order( $order_data ); // Add order products - $item_id = $order->add_product( $product, 4 ); + $item_id = $order->add_product( $product, array( 'qty' => 4 ) ); // Set billing address $billing_address = array( @@ -78,13 +78,13 @@ class WC_Helper_Order { $order->set_payment_method( $payment_gateways['bacs'] ); // Set totals - $order->set_total( 10, 'shipping' ); - $order->set_total( 0, 'cart_discount' ); - $order->set_total( 0, 'cart_discount_tax' ); - $order->set_total( 0, 'tax' ); - $order->set_total( 0, 'shipping_tax' ); - $order->set_total( 40, 'total' ); // 4 x $10 simple helper product + $order->set_shipping_total( 10 ); + $order->set_discount_total( 0 ); + $order->set_discount_tax( 0 ); + $order->set_cart_tax( 0 ); + $order->set_shipping_tax( 0 ); + $order->set_total( 40 ); // 4 x $10 simple helper product - return wc_get_order( $order->id ); + return wc_get_order( $order->get_id() ); } } diff --git a/tests/framework/helpers/class-wc-helper-product.php b/tests/framework/helpers/class-wc-helper-product.php index a3d5567f900..e2bf15c64d1 100644 --- a/tests/framework/helpers/class-wc-helper-product.php +++ b/tests/framework/helpers/class-wc-helper-product.php @@ -239,4 +239,27 @@ class WC_Helper_Product { $wpdb->query( "DELETE FROM {$wpdb->prefix}woocommerce_attribute_taxonomies WHERE attribute_id = $attribute_id" ); } + /** + * Creates a new product review on a specific product. + * + * @since 2.7 + * @param $product_id integer Product ID that the review is for + * @param $revieww_content string Content to use for the product review + * @return integer Product Review ID + */ + public static function create_product_review( $product_id, $review_content = 'Review content here' ) { + $data = array( + 'comment_post_ID' => $product_id, + 'comment_author' => 'admin', + 'comment_author_email' => 'woo@woo.local', + 'comment_author_url' => '', + 'comment_date' => '2016-01-01T11:11:11', + 'comment_content' => $review_content, + 'comment_approved' => 1, + 'comment_type' => 'review', + ); + + return wp_insert_comment( $data ); + } + } diff --git a/tests/unit-tests/api/product-reviews.php b/tests/unit-tests/api/product-reviews.php new file mode 100644 index 00000000000..88aa0e30a2e --- /dev/null +++ b/tests/unit-tests/api/product-reviews.php @@ -0,0 +1,423 @@ +endpoint = new WC_REST_Product_Reviews_Controller(); + $this->user = $this->factory->user->create( array( + 'role' => 'administrator', + ) ); + } + + /** + * Test route registration. + * + * @since 2.7.0 + */ + public function test_register_routes() { + $routes = $this->server->get_routes(); + $this->assertArrayHasKey( '/wc/v1/products/(?P[\d]+)/reviews', $routes ); + $this->assertArrayHasKey( '/wc/v1/products/(?P[\d]+)/reviews/(?P[\d]+)', $routes ); + } + + /** + * Test getting all product reviews. + * + * @since 2.7.0 + */ + public function test_get_product_reviews() { + wp_set_current_user( $this->user ); + $product = WC_Helper_Product::create_simple_product(); + // Create 10 products reviews for the product + for ( $i = 0; $i < 10; $i++ ) { + WC_Helper_Product::create_product_review( $product->id ); + } + + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/products/' . $product->id . '/reviews' ) ); + $product_reviews = $response->get_data(); + + $this->assertEquals( 200, $response->get_status() ); + $this->assertEquals( 10, count( $product_reviews ) ); + $this->assertContains( array( + 'id' => 2, + 'date_created' => '2016-01-01T11:11:11', + 'review' => 'Review content here', + 'rating' => 0, + 'name' => 'admin', + 'email' => 'woo@woo.local', + 'verified' => false, + '_links' => array( + 'self' => array( + array( + 'href' => rest_url( '/wc/v1/products/' . $product->id . '/reviews/2' ), + ), + ), + 'collection' => array( + array( + 'href' => rest_url( '/wc/v1/products/' . $product->id . '/reviews' ), + ), + ), + 'up' => array( + array( + 'href' => rest_url( '/wc/v1/products/' . $product->id ), + ), + ), + ), + ), $product_reviews ); + } + + /** + * Tests to make sure product reviews cannot be viewed without valid permissions. + * + * @since 2.7.0 + */ + public function test_get_product_reviews_without_permission() { + wp_set_current_user( 0 ); + $product = WC_Helper_Product::create_simple_product(); + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/products/' . $product->id . '/reviews' ) ); + $this->assertEquals( 401, $response->get_status() ); + } + + /** + * Tests to make sure an error is returned when an invalid product is loaded. + * + * @since 2.7.0 + */ + public function test_get_product_reviews_invalid_product() { + wp_set_current_user( $this->user ); + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/products/0/reviews' ) ); + $this->assertEquals( 404, $response->get_status() ); + } + + /** + * Tests getting a single product review. + * + * @since 2.7.0 + */ + public function test_get_product_review() { + wp_set_current_user( $this->user ); + $product = WC_Helper_Product::create_simple_product(); + $product_review_id = WC_Helper_Product::create_product_review( $product->id ); + + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/products/' . $product->id . '/reviews/' . $product_review_id ) ); + $data = $response->get_data(); + + $this->assertEquals( 200, $response->get_status() ); + $this->assertEquals( array( + 'id' => $product_review_id , + 'date_created' => '2016-01-01T11:11:11', + 'review' => 'Review content here', + 'rating' => 0, + 'name' => 'admin', + 'email' => 'woo@woo.local', + 'verified' => false, + ), $data ); + } + + /** + * Tests getting a single product review without the correct permissions. + * + * @since 2.7.0 + */ + public function test_get_product_review_without_permission() { + wp_set_current_user( 0 ); + $product = WC_Helper_Product::create_simple_product(); + $product_review_id = WC_Helper_Product::create_product_review( $product->id ); + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/products/' . $product->id . '/reviews/' . $product_review_id ) ); + $this->assertEquals( 401, $response->get_status() ); + } + + /** + * Tests getting a product review with an invalid ID. + * + * @since 2.7.0 + */ + public function test_get_product_review_invalid_id() { + wp_set_current_user( $this->user ); + $product = WC_Helper_Product::create_simple_product(); + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/products/' . $product->id . '/reviews/0' ) ); + $this->assertEquals( 404, $response->get_status() ); + } + + /** + * Tests creating a product review. + * + * @since 2.7.0 + */ + public function test_create_product_review() { + wp_set_current_user( $this->user ); + $product = WC_Helper_Product::create_simple_product(); + $request = new WP_REST_Request( 'POST', '/wc/v1/products/' . $product->id . '/reviews' ); + $request->set_body_params( array( + 'review' => 'Hello world.', + 'name' => 'Admin', + 'email' => 'woo@woo.local', + 'rating' => '5', + ) ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); + + $this->assertEquals( 201, $response->get_status() ); + $this->assertEquals( array( + 'id' => $data['id'], + 'date_created' => $data['date_created'], + 'review' => 'Hello world.', + 'rating' => 5, + 'name' => 'Admin', + 'email' => 'woo@woo.local', + 'verified' => false, + ), $data ); + } + + /** + * Tests creating a product review without required fields. + * + * @since 2.7.0 + */ + public function test_create_product_review_invalid_fields() { + wp_set_current_user( $this->user ); + $product = WC_Helper_Product::create_simple_product(); + + // missing review + $request = new WP_REST_Request( 'POST', '/wc/v1/products/' . $product->id . '/reviews' ); + $request->set_body_params( array( + 'name' => 'Admin', + 'email' => 'woo@woo.local', + ) ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); + + $this->assertEquals( 400, $response->get_status() ); + + // missing name + $request = new WP_REST_Request( 'POST', '/wc/v1/products/' . $product->id . '/reviews' ); + $request->set_body_params( array( + 'review' => 'Hello world.', + 'email' => 'woo@woo.local', + ) ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); + + $this->assertEquals( 400, $response->get_status() ); + + // missing email + $request = new WP_REST_Request( 'POST', '/wc/v1/products/' . $product->id . '/reviews' ); + $request->set_body_params( array( + 'review' => 'Hello world.', + 'name' => 'Admin', + ) ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); + + $this->assertEquals( 400, $response->get_status() ); + } + + /** + * Tests updating a product review. + * + * @since 2.7.0 + */ + public function test_update_product_review() { + wp_set_current_user( $this->user ); + $product = WC_Helper_Product::create_simple_product(); + $product_review_id = WC_Helper_Product::create_product_review( $product->id ); + + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/products/' . $product->id . '/reviews/' . $product_review_id ) ); + $data = $response->get_data(); + $this->assertEquals( 'Review content here', $data['review'] ); + $this->assertEquals( 'admin', $data['name'] ); + $this->assertEquals( 'woo@woo.local', $data['email'] ); + $this->assertEquals( 0, $data['rating'] ); + + $request = new WP_REST_Request( 'PUT', '/wc/v1/products/' . $product->id . '/reviews/' . $product_review_id ); + $request->set_body_params( array( + 'review' => 'Hello world - updated.', + 'name' => 'Justin', + 'email' => 'woo2@woo.local', + 'rating' => 3, + ) ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); + $this->assertEquals( 'Hello world - updated.', $data['review'] ); + $this->assertEquals( 'Justin', $data['name'] ); + $this->assertEquals( 'woo2@woo.local', $data['email'] ); + $this->assertEquals( 3, $data['rating'] ); + } + + /** + * Tests updating a product review without the correct permissions. + * + * @since 2.7.0 + */ + public function test_update_product_review_without_permission() { + wp_set_current_user( 0 ); + $product = WC_Helper_Product::create_simple_product(); + $product_review_id = WC_Helper_Product::create_product_review( $product->id ); + + $request = new WP_REST_Request( 'PUT', '/wc/v1/products/' . $product->id . '/reviews/' . $product_review_id ); + $request->set_body_params( array( + 'review' => 'Hello world.', + 'name' => 'Admin', + 'email' => 'woo@woo.dev', + ) ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); + + $this->assertEquals( 401, $response->get_status() ); + } + + /** + * Tests that updating a product review with an invalid id fails. + * + * @since 2.7.0 + */ + public function test_update_product_review_invalid_id() { + wp_set_current_user( $this->user ); + $product = WC_Helper_Product::create_simple_product(); + + $request = new WP_REST_Request( 'PUT', '/wc/v1/products/' . $product->id . '/reviews/0' ); + $request->set_body_params( array( + 'review' => 'Hello world.', + 'name' => 'Admin', + 'email' => 'woo@woo.dev', + ) ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); + + $this->assertEquals( 404, $response->get_status() ); + } + + /** + * Test deleting a product review. + * + * @since 2.7.0 + */ + public function test_delete_product_review() { + wp_set_current_user( $this->user ); + $product = WC_Helper_Product::create_simple_product(); + $product_review_id = WC_Helper_Product::create_product_review( $product->id ); + + $request = new WP_REST_Request( 'DELETE', '/wc/v1/products/' . $product->id . '/reviews/' . $product_review_id ); + $request->set_param( 'force', true ); + $response = $this->server->dispatch( $request ); + $this->assertEquals( 200, $response->get_status() ); + } + + /** + * Test deleting a product review without permission/creds. + * + * @since 2.7.0 + */ + public function test_delete_product_without_permission() { + wp_set_current_user( 0 ); + $product = WC_Helper_Product::create_simple_product(); + $product_review_id = WC_Helper_Product::create_product_review( $product->id ); + + $request = new WP_REST_Request( 'DELETE', '/wc/v1/products/' . $product->id . '/reviews/' . $product_review_id ); + $response = $this->server->dispatch( $request ); + + $this->assertEquals( 401, $response->get_status() ); + } + + /** + * Test deleting a product review with an invalid id. + * + * @since 2.7.0 + */ + public function test_delete_product_review_invalid_id() { + wp_set_current_user( $this->user ); + $product = WC_Helper_Product::create_simple_product(); + $product_review_id = WC_Helper_Product::create_product_review( $product->id ); + + $request = new WP_REST_Request( 'DELETE', '/wc/v1/products/' . $product->id . '/reviews/0' ); + $request->set_param( 'force', true ); + $response = $this->server->dispatch( $request ); + + $this->assertEquals( 404, $response->get_status() ); + } + + /** + * Test batch managing product reviews. + */ + public function test_product_reviews_batch() { + wp_set_current_user( $this->user ); + $product = WC_Helper_Product::create_simple_product(); + + $review_1_id = WC_Helper_Product::create_product_review( $product->id ); + $review_2_id = WC_Helper_Product::create_product_review( $product->id ); + $review_3_id = WC_Helper_Product::create_product_review( $product->id ); + $review_4_id = WC_Helper_Product::create_product_review( $product->id ); + + $request = new WP_REST_Request( 'POST', '/wc/v1/products/' . $product->id . '/reviews/batch' ); + $request->set_body_params( array( + 'update' => array( + array( + 'id' => $review_1_id, + 'review' => 'Updated review.', + ), + ), + 'delete' => array( + array( + 'id' => $review_2_id, + ), + array( + 'id' => $review_3_id, + ), + ), + 'create' => array( + array( + 'review' => 'New review.', + 'name' => 'Justin', + 'email' => 'woo3@woo.local', + ), + ), + ) ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); + + $this->assertEquals( 'Updated review.', $data['update'][0]['review'] ); + $this->assertEquals( 'New review.', $data['create'][0]['review'] ); + $this->assertEquals( $review_2_id, $data['delete'][0]['id'] ); + $this->assertEquals( $review_3_id, $data['delete'][1]['id'] ); + + $request = new WP_REST_Request( 'GET', '/wc/v1/products/' . $product->id . '/reviews' ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); + + $this->assertEquals( 3, count( $data ) ); + } + + /** + * Test the product review schema. + * + * @since 2.7.0 + */ + public function test_product_review_schema() { + wp_set_current_user( $this->user ); + $product = WC_Helper_Product::create_simple_product(); + $request = new WP_REST_Request( 'OPTIONS', '/wc/v1/products/' . $product->id . '/reviews' ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); + $properties = $data['schema']['properties']; + + $this->assertEquals( 7, count( $properties ) ); + $this->assertArrayHasKey( 'id', $properties ); + $this->assertArrayHasKey( 'review', $properties ); + $this->assertArrayHasKey( 'date_created', $properties ); + $this->assertArrayHasKey( 'rating', $properties ); + $this->assertArrayHasKey( 'name', $properties ); + $this->assertArrayHasKey( 'email', $properties ); + $this->assertArrayHasKey( 'verified', $properties ); + } + +} diff --git a/tests/unit-tests/api/shipping-zones.php b/tests/unit-tests/api/shipping-zones.php new file mode 100644 index 00000000000..714a5fd97c8 --- /dev/null +++ b/tests/unit-tests/api/shipping-zones.php @@ -0,0 +1,559 @@ +endpoint = new WC_REST_Shipping_Zones_Controller(); + $this->user = $this->factory->user->create( array( + 'role' => 'administrator', + ) ); + $this->zones = array(); + } + + /** + * Delete zones. + */ + public function tearDown() { + parent::tearDown(); + foreach( $this->zones as $zone ) { + $zone->delete(); + } + } + + /** + * Helper method to create a Shipping Zone. + * + * @param string $name Zone name. + * @param int $order Optional. Zone sort order. + * @return WC_Shipping_Zone + */ + protected function create_shipping_zone( $name, $order = 0, $locations = array() ) { + $zone = new WC_Shipping_Zone( null ); + $zone->set_zone_name( $name ); + $zone->set_zone_order( $order ); + $zone->set_locations( $locations ); + $zone->save(); + + $this->zones[] = $zone; + + return $zone; + } + + /** + * Test route registration. + * @since 2.7.0 + */ + public function test_register_routes() { + $routes = $this->server->get_routes(); + $this->assertArrayHasKey( '/wc/v1/shipping/zones', $routes ); + $this->assertArrayHasKey( '/wc/v1/shipping/zones/(?P[\d-]+)', $routes ); + $this->assertArrayHasKey( '/wc/v1/shipping/zones/(?P[\d-]+)/locations', $routes ); + $this->assertArrayHasKey( '/wc/v1/shipping/zones/(?P[\d-]+)/methods', $routes ); + $this->assertArrayHasKey( '/wc/v1/shipping/zones/(?P[\d-]+)/methods/(?P[\d-]+)', $routes ); + } + + /** + * Test getting all Shipping Zones. + * @since 2.7.0 + */ + public function test_get_zones() { + wp_set_current_user( $this->user ); + + // "Rest of the World" zone exists by default + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/shipping/zones' ) ); + $data = $response->get_data(); + + $this->assertEquals( 200, $response->get_status() ); + $this->assertEquals( count( $data ), 1 ); + $this->assertContains( array( + 'id' => 0, + 'name' => 'Rest of the World', + 'order' => 0, + '_links' => array( + 'self' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/0' ), + ), + ), + 'collection' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones' ), + ), + ), + 'describedby' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/0/locations' ), + ), + ), + ), + ), $data ); + + // Create a zone and make sure it's in the response + $this->create_shipping_zone( 'Zone 1' ); + + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/shipping/zones' ) ); + $data = $response->get_data(); + + $this->assertEquals( 200, $response->get_status() ); + $this->assertEquals( count( $data ), 2 ); + $this->assertContains( array( + 'id' => 1, + 'name' => 'Zone 1', + 'order' => 0, + '_links' => array( + 'self' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/1' ), + ), + ), + 'collection' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones' ), + ), + ), + 'describedby' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/1/locations' ), + ), + ), + ), + ), $data ); + } + + /** + * Test /shipping/zones without valid permissions/creds. + * @since 2.7.0 + */ + public function test_get_shipping_zones_without_permission() { + wp_set_current_user( 0 ); + + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/shipping/zones' ) ); + $this->assertEquals( 401, $response->get_status() ); + } + + /** + * Test /shipping/zones while Shipping is disabled in WooCommerce. + * @since 2.7.0 + */ + public function test_get_shipping_zones_disabled_shipping() { + wp_set_current_user( $this->user ); + + add_filter( 'wc_shipping_enabled', '__return_false' ); + + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/shipping/zones' ) ); + $this->assertEquals( 404, $response->get_status() ); + + remove_filter( 'wc_shipping_enabled', '__return_false' ); + } + + /** + * Test Shipping Zone schema. + * @since 2.7.0 + */ + public function test_get_shipping_zone_schema() { + $request = new WP_REST_Request( 'OPTIONS', '/wc/v1/shipping/zones' ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); + $properties = $data['schema']['properties']; + $this->assertEquals( 3, count( $properties ) ); + $this->assertArrayHasKey( 'id', $properties ); + $this->assertTrue( $properties['id']['readonly'] ); + $this->assertArrayHasKey( 'name', $properties ); + $this->assertTrue( $properties['name']['required'] ); + $this->assertArrayHasKey( 'order', $properties ); + $this->assertFalse( $properties['order']['required'] ); + } + + /** + * Test Shipping Zone create endpoint. + * @since 2.7.0 + */ + public function test_create_shipping_zone() { + wp_set_current_user( $this->user ); + + $request = new WP_REST_Request( 'POST', '/wc/v1/shipping/zones' ); + $request->set_body_params( array( + 'name' => 'Test Zone', + 'order' => 1, + ) ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); + + $this->assertEquals( 201, $response->get_status() ); + $this->assertEquals( array( + 'id' => $data['id'], + 'name' => 'Test Zone', + 'order' => 1, + '_links' => array( + 'self' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/' . $data['id'] ), + ), + ), + 'collection' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones' ), + ), + ), + 'describedby' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/' . $data['id'] . '/locations' ), + ), + ), + ), + ), $data ); + } + + /** + * Test Shipping Zone create endpoint. + * @since 2.7.0 + */ + public function test_create_shipping_zone_without_permission() { + wp_set_current_user( 0 ); + + $request = new WP_REST_Request( 'POST', '/wc/v1/shipping/zones' ); + $request->set_body_params( array( + 'name' => 'Test Zone', + 'order' => 1, + ) ); + $response = $this->server->dispatch( $request ); + $this->assertEquals( 401, $response->get_status() ); + } + + /** + * Test Shipping Zone update endpoint. + * @since 2.7.0 + */ + public function test_update_shipping_zone() { + wp_set_current_user( $this->user ); + + $zone = $this->create_shipping_zone( 'Test Zone' ); + + $request = new WP_REST_Request( 'PUT', '/wc/v1/shipping/zones/' . $zone->get_id() ); + $request->set_body_params( array( + 'name' => 'Zone Test', + 'order' => 2, + ) ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); + + $this->assertEquals( 200, $response->get_status() ); + $this->assertEquals( array( + 'id' => $zone->get_id(), + 'name' => 'Zone Test', + 'order' => 2, + '_links' => array( + 'self' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/' . $zone->get_id() ), + ), + ), + 'collection' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones' ), + ), + ), + 'describedby' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/' . $zone->get_id() . '/locations' ), + ), + ), + ), + ), $data ); + } + + /** + * Test Shipping Zone update endpoint with a bad zone ID. + * @since 2.7.0 + */ + public function test_update_shipping_zone_invalid_id() { + wp_set_current_user( $this->user ); + + $request = new WP_REST_Request( 'PUT', '/wc/v1/shipping/zones/1' ); + $request->set_body_params( array( + 'name' => 'Zone Test', + 'order' => 2, + ) ); + $response = $this->server->dispatch( $request ); + + $this->assertEquals( 404, $response->get_status() ); + } + + /** + * Test getting a single Shipping Zone. + * @since 2.7.0 + */ + public function test_get_single_shipping_zone() { + wp_set_current_user( $this->user ); + + $zone = $this->create_shipping_zone( 'Test Zone' ); + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/shipping/zones/' . $zone->get_id() ) ); + $data = $response->get_data(); + + $this->assertEquals( 200, $response->get_status() ); + $this->assertEquals( array( + 'id' => $zone->get_id(), + 'name' => 'Test Zone', + 'order' => 0, + '_links' => array( + 'self' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/' . $zone->get_id() ), + ), + ), + 'collection' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones' ), + ), + ), + 'describedby' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/' . $zone->get_id() . '/locations' ), + ), + ), + ), + ), $data ); + } + + /** + * Test getting a single Shipping Zone with a bad zone ID. + * @since 2.7.0 + */ + public function test_get_single_shipping_zone_invalid_id() { + wp_set_current_user( $this->user ); + + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/shipping/zones/1' ) ); + + $this->assertEquals( 404, $response->get_status() ); + } + + /** + * Test getting Shipping Zone Locations. + * @since 2.7.0 + */ + public function test_get_locations() { + wp_set_current_user( $this->user ); + + // Create a zone + $zone = $this->create_shipping_zone( 'Zone 1', 0, array( + array( + 'code' => 'US', + 'type' => 'country', + ), + ) ); + + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/shipping/zones/' . $zone->get_id() . '/locations' ) ); + $data = $response->get_data(); + + $this->assertEquals( 200, $response->get_status() ); + $this->assertEquals( count( $data ), 1 ); + $this->assertEquals( array( + array( + 'code' => 'US', + 'type' => 'country', + '_links' => array( + 'collection' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/' . $zone->get_id() . '/locations' ), + ), + ), + 'describes' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/' . $zone->get_id() ), + ), + ), + ), + ), + ), $data ); + } + + /** + * Test getting Shipping Zone Locations with a bad zone ID. + * @since 2.7.0 + */ + public function test_get_locations_invalid_id() { + wp_set_current_user( $this->user ); + + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/shipping/zones/1/locations' ) ); + + $this->assertEquals( 404, $response->get_status() ); + } + + /** + * Test Shipping Zone Locations update endpoint. + * @since 2.7.0 + */ + public function test_update_locations() { + wp_set_current_user( $this->user ); + + $zone = $this->create_shipping_zone( 'Test Zone' ); + + $request = new WP_REST_Request( 'PUT', '/wc/v1/shipping/zones/' . $zone->get_id() . '/locations' ); + $request->add_header( 'Content-Type', 'application/json' ); + $request->set_body( json_encode( array( + array( + 'code' => 'UK', + 'type' => 'country', + ), + array( + 'code' => 'US', // test that locations missing "type" aren't saved + ), + array( + 'code' => 'SW1A0AA', + 'type' => 'postcode', + ), + array( + 'type' => 'continent', // test that locations missing "code" aren't saved + ), + ) ) ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); + + $this->assertEquals( count( $data ), 2 ); + $this->assertEquals( array( + array( + 'code' => 'UK', + 'type' => 'country', + '_links' => array( + 'collection' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/' . $zone->get_id() . '/locations' ), + ), + ), + 'describes' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/' . $zone->get_id() ), + ), + ), + ), + ), + array( + 'code' => 'SW1A0AA', + 'type' => 'postcode', + '_links' => array( + 'collection' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/' . $zone->get_id() . '/locations' ), + ), + ), + 'describes' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/' . $zone->get_id() ), + ), + ), + ), + ), + ), $data ); + } + + /** + * Test updating Shipping Zone Locations with a bad zone ID. + * @since 2.7.0 + */ + public function test_update_locations_invalid_id() { + wp_set_current_user( $this->user ); + + $response = $this->server->dispatch( new WP_REST_Request( 'PUT', '/wc/v1/shipping/zones/1/locations' ) ); + + $this->assertEquals( 404, $response->get_status() ); + } + + /** + * Test getting all Shipping Zone Methods and getting a single Shipping Zone Method. + * @since 2.7.0 + */ + public function test_get_methods() { + wp_set_current_user( $this->user ); + + // Create a shipping method and make sure it's in the response + $zone = $this->create_shipping_zone( 'Zone 1' ); + $instance_id = $zone->add_shipping_method( 'flat_rate' ); + $methods = $zone->get_shipping_methods(); + $method = $methods[ $instance_id ]; + + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/shipping/zones/' . $zone->get_id() . '/methods' ) ); + $data = $response->get_data(); + $expected = array( + 'instance_id' => $instance_id, + 'title' => $method->instance_settings['title'], + 'order' => $method->method_order, + 'enabled' => ( 'yes' === $method->enabled ), + 'method_id' => $method->id, + 'method_title' => $method->method_title, + 'method_description' => $method->method_description, + '_links' => array( + 'self' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/' . $zone->get_id() . '/methods/' . $instance_id ), + ), + ), + 'collection' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/' . $zone->get_id() . '/methods' ), + ), + ), + 'describes' => array( + array( + 'href' => rest_url( '/wc/v1/shipping/zones/' . $zone->get_id() ), + ), + ), + ), + ); + + $this->assertEquals( 200, $response->get_status() ); + $this->assertEquals( count( $data ), 1 ); + $this->assertContains( $expected, $data ); + + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/shipping/zones/' . $zone->get_id() . '/methods/' . $instance_id ) ); + $data = $response->get_data(); + + $this->assertEquals( 200, $response->get_status() ); + $this->assertEquals( $expected, $data ); + } + + /** + * Test getting all Shipping Zone Methods with a bad zone ID. + * @since 2.7.0 + */ + public function test_get_methods_invalid_zone_id() { + wp_set_current_user( $this->user ); + + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/shipping/zones/1/methods' ) ); + + $this->assertEquals( 404, $response->get_status() ); + + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/shipping/zones/1/methods/1' ) ); + + $this->assertEquals( 404, $response->get_status() ); + } + + /** + * Test getting a single Shipping Zone Method with a bad ID. + * @since 2.7.0 + */ + public function test_get_methods_invalid_method_id() { + wp_set_current_user( $this->user ); + + $zone = $this->create_shipping_zone( 'Zone 1' ); + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/shipping/zones/' . $zone->get_id() . '/methods/1' ) ); + + $this->assertEquals( 404, $response->get_status() ); + } +} diff --git a/tests/unit-tests/api/system-status.php b/tests/unit-tests/api/system-status.php new file mode 100644 index 00000000000..3ef0e0d0d19 --- /dev/null +++ b/tests/unit-tests/api/system-status.php @@ -0,0 +1,189 @@ +endpoint = new WC_REST_System_Status_Controller(); + $this->user = $this->factory->user->create( array( + 'role' => 'administrator', + ) ); + } + + /** + * Test route registration. + */ + public function test_register_routes() { + $routes = $this->server->get_routes(); + $this->assertArrayHasKey( '/wc/v1/system_status', $routes ); + } + + /** + * Test to make sure system status cannot be accessed without valid creds + * + * @since 2.7.0 + */ + public function test_get_system_status_info_without_permission() { + wp_set_current_user( 0 ); + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/system_status' ) ); + $this->assertEquals( 401, $response->get_status() ); + } + + /** + * Test to make sure root properties are present. + * (environment, theme, database, etc). + * + * @since 2.7.0 + */ + public function test_get_system_status_info_returns_root_properties() { + wp_set_current_user( $this->user ); + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/system_status' ) ); + $data = $response->get_data(); + + $this->assertArrayHasKey( 'environment', $data ); + $this->assertArrayHasKey( 'database', $data ); + $this->assertArrayHasKey( 'active_plugins', $data ); + $this->assertArrayHasKey( 'theme', $data ); + $this->assertArrayHasKey( 'settings', $data ); + $this->assertArrayHasKey( 'pages', $data ); + } + + /** + * Test to make sure environment response is correct. + * + * @since 2.7.0 + */ + public function test_get_system_status_info_environment() { + wp_set_current_user( $this->user ); + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/system_status' ) ); + $data = $response->get_data(); + $environment = $data['environment']; + + // Make sure all expected data is present + $this->assertEquals( 30, count( $environment ) ); + + // Test some responses to make sure they match up + $this->assertEquals( get_option( 'home' ), $environment['home_url'] ); + $this->assertEquals( get_option( 'siteurl' ), $environment['site_url'] ); + $this->assertEquals( WC()->version, $environment['version'] ); + } + + /** + * Test to make sure database response is correct. + * + * @since 2.7.0 + */ + public function test_get_system_status_info_database() { + global $wpdb; + wp_set_current_user( $this->user ); + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/system_status' ) ); + $data = $response->get_data(); + $database = $data['database']; + + $this->assertEquals( get_option( 'woocommerce_db_version' ), $database['wc_database_version'] ); + $this->assertEquals( $wpdb->prefix, $database['database_prefix'] ); + $this->assertEquals( WC_Geolocation::get_local_database_path(), $database['maxmind_geoip_database'] ); + $this->assertArrayHasKey( 'woocommerce_payment_tokens', $database['database_tables'] ); + } + + /** + * Test to make sure active plugins response is correct. + * + * @since 2.7.0 + */ + public function test_get_system_status_info_active_plugins() { + wp_set_current_user( $this->user ); + + $actual_plugins = array( 'hello.php' ); + update_option( 'active_plugins', $actual_plugins ); + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/system_status' ) ); + update_option( 'active_plugins', array() ); + + $data = $response->get_data(); + $plugins = $data['active_plugins']; + + $this->assertEquals( 1, count( $plugins ) ); + $this->assertEquals( 'Hello Dolly', $plugins[0]['name'] ); + } + + /** + * Test to make sure theme response is correct. + * + * @since 2.7.0 + */ + public function test_get_system_status_info_theme() { + wp_set_current_user( $this->user ); + $active_theme = wp_get_theme(); + + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/system_status' ) ); + $data = $response->get_data(); + $theme = $data['theme']; + + $this->assertEquals( 13, count( $theme ) ); + $this->assertEquals( $active_theme->Name, $theme['name'] ); + } + + /** + * Test to make sure settings response is correct. + * + * @since 2.7.0 + */ + public function test_get_system_status_info_settings() { + wp_set_current_user( $this->user ); + + $term_response = array(); + $terms = get_terms( 'product_type', array( 'hide_empty' => 0 ) ); + foreach ( $terms as $term ) { + $term_response[ $term->slug ] = strtolower( $term->name ); + } + + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/system_status' ) ); + $data = $response->get_data(); + $settings = $data['settings']; + + $this->assertEquals( 10, count( $settings ) ); + $this->assertEquals( ( 'yes' === get_option( 'woocommerce_api_enabled' ) ), $settings['api_enabled'] ); + $this->assertEquals( get_woocommerce_currency(), $settings['currency'] ); + $this->assertEquals( $term_response, $settings['taxonomies'] ); + } + + /** + * Test to make sure pages response is correct. + * + * @since 2.7.0 + */ + public function test_get_system_status_info_pages() { + wp_set_current_user( $this->user ); + $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/system_status' ) ); + $data = $response->get_data(); + $pages = $data['pages']; + $this->assertEquals( 4, count( $pages ) ); + } + + /** + * Test system status schema. + * + * @since 2.7.0 + */ + public function test_system_status_schema() { + $request = new WP_REST_Request( 'OPTIONS', '/wc/v1/system_status' ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); + $properties = $data['schema']['properties']; + $this->assertEquals( 6, count( $properties ) ); + $this->assertArrayHasKey( 'environment', $properties ); + $this->assertArrayHasKey( 'database', $properties ); + $this->assertArrayHasKey( 'active_plugins', $properties ); + $this->assertArrayHasKey( 'theme', $properties ); + $this->assertArrayHasKey( 'settings', $properties ); + $this->assertArrayHasKey( 'pages', $properties ); + } + +} diff --git a/tests/unit-tests/cart/cart.php b/tests/unit-tests/cart/cart.php index c58dd4685cb..e70f1942807 100644 --- a/tests/unit-tests/cart/cart.php +++ b/tests/unit-tests/cart/cart.php @@ -88,14 +88,59 @@ class WC_Tests_Cart extends WC_Unit_Test_Case { $wpdb->query( "DELETE FROM {$wpdb->prefix}woocommerce_tax_rate_locations" ); WC()->cart->empty_cart(); WC()->cart->remove_coupons(); + WC_Helper_Product::delete_product( $product->id ); + + + # Test case 3 #11626 + update_post_meta( $coupon->id, 'discount_type', 'percent' ); + update_post_meta( $coupon->id, 'coupon_amount', '50' ); + update_option( 'woocommerce_prices_include_tax', 'yes' ); + update_option( 'woocommerce_calc_taxes', 'yes' ); + + $tax_rate = array( + 'tax_rate_country' => '', + 'tax_rate_state' => '', + 'tax_rate' => '19.0000', + 'tax_rate_name' => 'TAX', + 'tax_rate_priority' => '1', + 'tax_rate_compound' => '0', + 'tax_rate_shipping' => '1', + 'tax_rate_order' => '1', + 'tax_rate_class' => '' + ); + WC_Tax::_insert_tax_rate( $tax_rate ); + + $product_ids = array(); + $products_data = array( + '5.17', '3.32', '1.25', '3.50', '5.01', '3.34', '5.99', '5.51' + ); + foreach ( $products_data as $price ) { + $loop_product = WC_Helper_Product::create_simple_product(); + $product_ids[] = $loop_product->id; + update_post_meta( $loop_product->id, '_regular_price', $price ); + update_post_meta( $loop_product->id, '_price', $price ); + WC()->cart->add_to_cart( $loop_product->id, 1 ); + } + + WC()->cart->add_discount( $coupon->code ); + WC()->cart->calculate_totals(); + $cart_item = current( WC()->cart->get_cart() ); + $this->assertEquals( '16.55', WC()->cart->total ); + + // Cleanup + WC()->cart->empty_cart(); + WC()->cart->remove_coupons(); + + foreach ( $product_ids as $product_id ) { + WC_Helper_Product::delete_product( $product_id ); + } + + $wpdb->query( "DELETE FROM {$wpdb->prefix}woocommerce_tax_rates" ); + $wpdb->query( "DELETE FROM {$wpdb->prefix}woocommerce_tax_rate_locations" ); update_option( 'woocommerce_prices_include_tax', 'no' ); update_option( 'woocommerce_calc_taxes', 'no' ); - // Delete coupon WC_Helper_Coupon::delete_coupon( $coupon->id ); - - // Clean up product - WC_Helper_Product::delete_product( $product->id ); } /** @@ -124,6 +169,8 @@ class WC_Tests_Cart extends WC_Unit_Test_Case { // Create dummy product $product = WC_Helper_Product::create_simple_product(); + WC()->cart->empty_cart(); + // Add the product to the cart. Methods returns boolean on failure, string on success. $this->assertNotFalse( WC()->cart->add_to_cart( $product->id, 1 ) ); diff --git a/tests/unit-tests/cart/functions.php b/tests/unit-tests/cart/functions.php index 00960754fef..3cebc91116c 100644 --- a/tests/unit-tests/cart/functions.php +++ b/tests/unit-tests/cart/functions.php @@ -46,7 +46,7 @@ class WC_Tests_Cart_Functions extends WC_Unit_Test_Case { public function test_get_checkout_url_regular() { // Make sure pages exist WC_Install::create_pages(); - + // Get the original setting $o_setting = get_option( 'woocommerce_force_ssl_checkout' ); @@ -154,4 +154,29 @@ class WC_Tests_Cart_Functions extends WC_Unit_Test_Case { $this->assertEquals( apply_filters( 'woocommerce_get_cart_url', $cart_page_url ? $cart_page_url : '' ), wc_get_cart_url() ); } + + /** + * Test wc_add_to_cart_message + */ + public function test_wc_add_to_cart_message() { + $product = WC_Helper_Product::create_simple_product(); + + $message = wc_add_to_cart_message( array( $product->id => 1 ), false, true ); + $this->assertEquals( 'View Cart “Dummy Product” has been added to your cart.', $message ); + + $message = wc_add_to_cart_message( array( $product->id => 3 ), false, true ); + $this->assertEquals( 'View Cart “Dummy Product” has been added to your cart.', $message ); + + $message = wc_add_to_cart_message( array( $product->id => 1 ), true, true ); + $this->assertEquals( 'View Cart “Dummy Product” has been added to your cart.', $message ); + + $message = wc_add_to_cart_message( array( $product->id => 3 ), true, true ); + $this->assertEquals( 'View Cart 3 × “Dummy Product” have been added to your cart.', $message ); + + $message = wc_add_to_cart_message( $product->id, false, true ); + $this->assertEquals( 'View Cart “Dummy Product” has been added to your cart.', $message ); + + $message = wc_add_to_cart_message( $product->id, true, true ); + $this->assertEquals( 'View Cart “Dummy Product” has been added to your cart.', $message ); + } } diff --git a/tests/unit-tests/crud/orders.php b/tests/unit-tests/crud/orders.php new file mode 100644 index 00000000000..76b1e493d64 --- /dev/null +++ b/tests/unit-tests/crud/orders.php @@ -0,0 +1,1323 @@ +assertEquals( 'shop_order', $object->get_type() ); + } + + /** + * Test: get_type + */ + function test_get_order_type() { + $object = new WC_Order(); + $id = $object->save(); + $this->assertEquals( 'shop_order', $object->get_order_type() ); + } + + /** + * Test: get_data + */ + function test_get_data() { + $object = new WC_Order(); + $this->assertInternalType( 'array', $object->get_data() ); + } + + /** + * Test: get_id + */ + function test_get_id() { + $object = new WC_Order(); + $id = $object->save(); + $this->assertEquals( $id, $object->get_id() ); + } + + /** + * Test: get_parent_id + */ + function test_get_parent_id() { + $object = new WC_Order(); + $set_to = 100; + $object->set_parent_id( $set_to ); + $this->assertEquals( $set_to, $object->get_parent_id() ); + } + + /** + * Test: get_order_number + */ + function test_get_order_number() { + $object = new WC_Order(); + $id = $object->save(); + $this->assertEquals( $id, $object->get_order_number() ); + } + + /** + * Test: get_order_key + */ + function test_get_order_key() { + $object = new WC_Order(); + $set_to = 'some_key'; + $object->set_order_key( $set_to ); + $this->assertEquals( $set_to, $object->get_order_key() ); + } + + /** + * Test: get_currency + */ + function test_get_currency() { + $object = new WC_Order(); + $set_to = 'USD'; + $object->set_currency( $set_to ); + $this->assertEquals( $set_to, $object->get_currency() ); + } + + /** + * Test: get_version + */ + function test_get_version() { + $object = new WC_Order(); + $set_to = '2.7.0'; + $object->set_version( $set_to ); + $this->assertEquals( $set_to, $object->get_version() ); + } + + /** + * Test: get_prices_include_tax + */ + function test_get_prices_include_tax() { + $object = new WC_Order(); + $set_to = 'USD'; + $object->set_prices_include_tax( 1 ); + $this->assertEquals( true, $object->get_prices_include_tax() ); + } + + /** + * Test: get_date_created + */ + function test_get_date_created() { + $object = new WC_Order(); + $object->set_date_created( '2016-12-12' ); + $this->assertEquals( '1481500800', $object->get_date_created() ); + + $object->set_date_created( '1481500800' ); + $this->assertEquals( 1481500800, $object->get_date_created() ); + } + + /** + * Test: get_date_modified + */ + function test_get_date_modified() { + $object = new WC_Order(); + $object->set_date_modified( '2016-12-12' ); + $this->assertEquals( '1481500800', $object->get_date_modified() ); + + $object->set_date_modified( '1481500800' ); + $this->assertEquals( 1481500800, $object->get_date_modified() ); + } + + /** + * Test: get_customer_id + */ + function test_get_customer_id() { + $object = new WC_Order(); + $set_to = 10; + $object->set_customer_id( $set_to ); + $this->assertEquals( $set_to, $object->get_customer_id() ); + } + + /** + * Test: get_user + */ + function test_get_user() { + $object = new WC_Order(); + $this->assertEquals( false, $object->get_user() ); + $set_to = '1'; + $object->set_customer_id( $set_to ); + $this->assertInstanceOf( 'WP_User', $object->get_user() ); + } + + /** + * Test: get_discount_total + */ + function test_get_discount_total() { + $object = new WC_Order(); + $object->set_discount_total( 50 ); + $this->assertEquals( 50, $object->get_discount_total() ); + } + + /** + * Test: get_discount_tax + */ + function test_get_discount_tax() { + $object = new WC_Order(); + $object->set_discount_tax( 5 ); + $this->assertEquals( 5, $object->get_discount_tax() ); + } + + /** + * Test: get_shipping_total + */ + function test_get_shipping_total() { + $object = new WC_Order(); + $object->set_shipping_total( 5 ); + $this->assertEquals( 5, $object->get_shipping_total() ); + } + + /** + * Test: get_shipping_tax + */ + function test_get_shipping_tax() { + $object = new WC_Order(); + $object->set_shipping_tax( 5 ); + $this->assertEquals( 5, $object->get_shipping_tax() ); + } + + /** + * Test: get_cart_tax + */ + function test_get_cart_tax() { + $object = new WC_Order(); + $object->set_cart_tax( 5 ); + $this->assertEquals( 5, $object->get_cart_tax() ); + } + + /** + * Test: get_total + */ + function test_get_total() { + $object = new WC_Order(); + $object->set_total( 5 ); + $this->assertEquals( 5, $object->get_total() ); + } + + /** + * Test: get_total_tax + */ + function test_get_total_tax() { + $object = new WC_Order(); + $object->set_cart_tax( 5 ); + $object->set_shipping_tax( 5 ); + $this->assertEquals( 10, $object->get_total_tax() ); + } + + /** + * Test: get_total_discount + */ + function test_get_total_discount() { + $object = new WC_Order(); + $object->set_discount_total( 50 ); + $object->set_discount_tax( 5 ); + $this->assertEquals( 50, $object->get_total_discount() ); + $this->assertEquals( 55, $object->get_total_discount( false ) ); + } + + /** + * Test: get_subtotal + */ + function test_get_subtotal() { + $object = WC_Helper_Order::create_order(); + $this->assertEquals( 40, $object->get_subtotal() ); + } + + /** + * Test: get_tax_totals + */ + function test_get_tax_totals() { + $object = WC_Helper_Order::create_order(); + $this->assertEquals( array(), $object->get_tax_totals() ); + } + + /** + * Test: remove_order_items + */ + function test_remove_order_items() { + $product = WC_Helper_Product::create_simple_product(); + $object = new WC_Order(); + $object->save(); + $item_id = $object->add_product( $product, array( 'qty' => 4 ) ); + $item_id = $object->add_product( $product, array( 'qty' => 2 ) ); + $this->assertCount( 2, $object->get_items() ); + $object->remove_order_items(); + $this->assertCount( 0, $object->get_items() ); + } + + /** + * Test: get_items + */ + function test_get_items() { + $object = new WC_Order(); + $object->save(); + $object->add_product( WC_Helper_Product::create_simple_product(), array( 'qty' => 4 ) ); + $object->add_product( WC_Helper_Product::create_simple_product(), array( 'qty' => 2 ) ); + $this->assertCount( 2, $object->get_items() ); + } + + /** + * Test: get_fees + */ + function test_get_fees() { + $object = new WC_Order(); + $object->save(); + $object->add_fee( (object) array( + 'name' => 'Some Fee', + 'taxable' => true, + 'amount' => '100', + 'tax_class' => '', + 'tax' => '', + 'tax_data' => '', + ) ); + $this->assertCount( 1, $object->get_fees() ); + } + + /** + * Test: get_taxes + */ + function test_get_taxes() { + global $wpdb; + + update_option( 'woocommerce_calc_taxes', 'yes' ); + $tax_rate = array( + 'tax_rate_country' => '', + 'tax_rate_state' => '', + 'tax_rate' => '10.0000', + 'tax_rate_name' => 'TAX', + 'tax_rate_priority' => '1', + 'tax_rate_compound' => '0', + 'tax_rate_shipping' => '1', + 'tax_rate_order' => '1', + 'tax_rate_class' => '' + ); + WC_Tax::_insert_tax_rate( $tax_rate ); + + $object = new WC_Order(); + $object->save(); + $object->add_product( WC_Helper_Product::create_simple_product(), array( 'qty' => 4 ) ); + $object->calculate_totals(); + $this->assertCount( 1, $object->get_taxes() ); + + $object->add_tax( + array( + 'rate_id' => '100', + 'tax_total' => '100', + 'shipping_tax_total' => '0', + ) + ); + + $this->assertCount( 2, $object->get_taxes() ); + + // Cleanup + $wpdb->query( "DELETE FROM {$wpdb->prefix}woocommerce_tax_rates" ); + $wpdb->query( "DELETE FROM {$wpdb->prefix}woocommerce_tax_rate_locations" ); + update_option( 'woocommerce_calc_taxes', 'no' ); + } + + /** + * Test: get_shipping_methods + */ + function test_get_shipping_methods() { + $object = new WC_Order(); + $object->save(); + $object->add_shipping( new WC_Shipping_Rate( 'flat_rate_shipping', 'Flat rate shipping', '10', array(), 'flat_rate' ) ); + $this->assertCount( 1, $object->get_shipping_methods() ); + } + + /** + * Test: get_shipping_method + */ + function test_get_shipping_method() { + $object = new WC_Order(); + $object->save(); + $object->add_shipping( new WC_Shipping_Rate( 'flat_rate_shipping', 'Flat rate shipping', '10', array(), 'flat_rate' ) ); + $this->assertEquals( 'Flat rate shipping', $object->get_shipping_method() ); + $object->add_shipping( new WC_Shipping_Rate( 'flat_rate_shipping', 'Flat rate shipping 2', '10', array(), 'flat_rate' ) ); + $this->assertEquals( 'Flat rate shipping, Flat rate shipping 2', $object->get_shipping_method() ); + } + + /** + * Test: get_used_coupons + */ + function test_get_used_coupons() { + $object = new WC_Order(); + $object->save(); + $object->add_coupon( + array( + 'code' => '12345', + 'discount' => '10', + 'discount_tax' => '5', + ) + ); + $this->assertCount( 1, $object->get_used_coupons() ); + } + + /** + * Test: get_item_count + */ + function test_get_item_count() { + $object = new WC_Order(); + $object->save(); + $object->add_product( WC_Helper_Product::create_simple_product(), array( 'qty' => 4 ) ); + $object->add_product( WC_Helper_Product::create_simple_product(), array( 'qty' => 2 ) ); + $this->assertEquals( 6, $object->get_item_count() ); + } + + /** + * Test: get_item + */ + function test_get_item() { + $object = new WC_Order(); + $object->save(); + + $item_id = $object->add_product( WC_Helper_Product::create_simple_product(), array( 'qty' => 4 ) ); + $this->assertTrue( $object->get_item( $item_id ) instanceOf WC_Order_Item_Product ); + + $item_id = $object->add_coupon( + array( + 'code' => '12345', + 'discount' => '10', + 'discount_tax' => '5', + ) + ); + $this->assertTrue( $object->get_item( $item_id ) instanceOf WC_Order_Item_Coupon ); + } + + /** + * Test: add_payment_token + */ + function test_add_payment_token() { + $object = new WC_Order(); + $object->save(); + $this->assertFalse( $object->add_payment_token( 'fish' ) ); + $token = new WC_Payment_Token_Stub(); + $token->set_extra( __FUNCTION__ ); + $token->set_token( time() ); + $token->create(); + $this->assertTrue( 0 < $object->add_payment_token( $token ) ); + } + + /** + * Test: get_payment_tokens + */ + function test_get_payment_tokens() { + $object = new WC_Order(); + $object->save(); + $token = new WC_Payment_Token_Stub(); + $token->set_extra( __FUNCTION__ ); + $token->set_token( time() ); + $token->create(); + $object->add_payment_token( $token ); + $this->assertCount( 1, $object->get_payment_tokens() ); + } + + /** + * Test: calculate_shipping + */ + function test_calculate_shipping() { + $object = new WC_Order(); + $object->save(); + $object->add_shipping( new WC_Shipping_Rate( 'flat_rate_shipping', 'Flat rate shipping', '10', array(), 'flat_rate' ) ); + $object->add_shipping( new WC_Shipping_Rate( 'flat_rate_shipping', 'Flat rate shipping', '10', array(), 'flat_rate' ) ); + $object->calculate_shipping(); + $this->assertEquals( 20, $object->get_shipping_total() ); + } + + /** + * Test: calculate_taxes + */ + function test_calculate_taxes() { + global $wpdb; + update_option( 'woocommerce_calc_taxes', 'yes' ); + $tax_rate = array( + 'tax_rate_country' => '', + 'tax_rate_state' => '', + 'tax_rate' => '10.0000', + 'tax_rate_name' => 'TAX', + 'tax_rate_priority' => '1', + 'tax_rate_compound' => '0', + 'tax_rate_shipping' => '1', + 'tax_rate_order' => '1', + 'tax_rate_class' => '' + ); + WC_Tax::_insert_tax_rate( $tax_rate ); + + $object = new WC_Order(); + $object->save(); + $object->add_product( WC_Helper_Product::create_simple_product(), array( 'qty' => 4 ) ); + $object->add_shipping( new WC_Shipping_Rate( 'flat_rate_shipping', 'Flat rate shipping', '10', array(), 'flat_rate' ) ); + $object->calculate_taxes(); + $this->assertEquals( 5, $object->get_total_tax() ); + + // Cleanup + $wpdb->query( "DELETE FROM {$wpdb->prefix}woocommerce_tax_rates" ); + $wpdb->query( "DELETE FROM {$wpdb->prefix}woocommerce_tax_rate_locations" ); + update_option( 'woocommerce_calc_taxes', 'no' ); + } + + /** + * Test: calculate_totals + */ + function test_calculate_totals() { + global $wpdb; + update_option( 'woocommerce_calc_taxes', 'yes' ); + $tax_rate = array( + 'tax_rate_country' => '', + 'tax_rate_state' => '', + 'tax_rate' => '10.0000', + 'tax_rate_name' => 'TAX', + 'tax_rate_priority' => '1', + 'tax_rate_compound' => '0', + 'tax_rate_shipping' => '1', + 'tax_rate_order' => '1', + 'tax_rate_class' => '' + ); + WC_Tax::_insert_tax_rate( $tax_rate ); + + $object = new WC_Order(); + $object->save(); + $object->add_product( WC_Helper_Product::create_simple_product(), array( 'qty' => 4 ) ); + $object->add_shipping( new WC_Shipping_Rate( 'flat_rate_shipping', 'Flat rate shipping', '10', array(), 'flat_rate' ) ); + $object->calculate_totals(); + $this->assertEquals( 55, $object->get_total() ); + + // Cleanup + $wpdb->query( "DELETE FROM {$wpdb->prefix}woocommerce_tax_rates" ); + $wpdb->query( "DELETE FROM {$wpdb->prefix}woocommerce_tax_rate_locations" ); + update_option( 'woocommerce_calc_taxes', 'no' ); + } + + /** + * Test: has_status + */ + function test_has_status() { + $object = new WC_Order(); + $this->assertFalse( $object->has_status( 'completed' ) ); + $this->assertFalse( $object->has_status( array( 'processing', 'completed' ) ) ); + $this->assertTrue( $object->has_status( 'pending' ) ); + $this->assertTrue( $object->has_status( array( 'processing', 'pending' ) ) ); + } + + /** + * Test: has_shipping_method + */ + function test_has_shipping_method() { + $object = new WC_Order(); + $object->save(); + $this->assertFalse( $object->has_shipping_method( 'flat_rate_shipping' ) ); + $object->add_shipping( new WC_Shipping_Rate( 'flat_rate_shipping', 'Flat rate shipping', '10', array(), 'flat_rate' ) ); + $this->assertTrue( $object->has_shipping_method( 'flat_rate_shipping' ) ); + } + + /** + * Test: key_is_valid + */ + function test_key_is_valid() { + $object = new WC_Order(); + $object->save(); + $this->assertFalse( $object->key_is_valid( '1234' ) ); + $object->set_order_key( '1234' ); + $this->assertTrue( $object->key_is_valid( '1234' ) ); + } + + /** + * Test: has_free_item + */ + function test_has_free_item() { + $object = new WC_Order(); + $object->save(); + $object->add_product( WC_Helper_Product::create_simple_product(), array( 'qty' => 4 ) ); + $this->assertFalse( $object->has_free_item() ); + + $free_product = WC_Helper_Product::create_simple_product(); + $free_product->set_price( 0 ); + $object->add_product( $free_product, array( 'qty' => 4 ) ); + $this->assertTrue( $object->has_free_item() ); + } + + /** + * Test: CRUD + */ + function test_CRUD() { + $object = new WC_Order(); + + // Save + create + $save_id = $object->save(); + $post = get_post( $save_id ); + $this->assertEquals( 'shop_order', $post->post_type ); + $this->assertEquals( 'shop_order', $post->post_type ); + + // Update + $update_id = $object->save(); + $this->assertEquals( $update_id, $save_id ); + + // Delete + $object->delete(); + $post = get_post( $save_id ); + $this->assertNull( $post ); + } + + /** + * Test: payment_complete + */ + function test_payment_complete() { + $object = new WC_Order(); + + $this->assertFalse( $object->payment_complete() ); + $object->save(); + $this->assertTrue( $object->payment_complete( '12345' ) ); + $this->assertEquals( 'completed', $object->get_status() ); + $this->assertEquals( '12345', $object->get_transaction_id() ); + } + + /** + * Test: get_formatted_order_total + */ + function test_get_formatted_order_total() { + $object = new WC_Order(); + $object->set_total( 100 ); + $object->set_currency( 'USD' ); + $this->assertEquals( '$100.00', $object->get_formatted_order_total() ); + } + + /** + * Test: set_status + */ + function test_set_status() { + $object = new WC_Order(); + $object->set_status( 'on-hold' ); + $this->assertEquals( 'on-hold', $object->get_status() ); + } + + /** + * Test: update_status + */ + function test_update_status() { + $object = new WC_Order(); + $this->assertFalse( $object->update_status( 'on-hold' ) ); + $object->save(); + $this->assertTrue( $object->update_status( 'on-hold' ) ); + $this->assertEquals( 'on-hold', $object->get_status() ); + } + + /** + * Test: get_billing_first_name + */ + function test_get_billing_first_name() { + $object = new WC_Order(); + $set_to = 'Fred'; + $object->set_billing_first_name( $set_to ); + $this->assertEquals( $set_to, $object->get_billing_first_name() ); + } + + /** + * Test: get_billing_last_name + */ + function test_get_billing_last_name() { + $object = new WC_Order(); + $set_to = 'Flintstone'; + $object->set_billing_last_name( $set_to ); + $this->assertEquals( $set_to, $object->get_billing_last_name() ); + } + + /** + * Test: get_billing_company + */ + function test_get_billing_company() { + $object = new WC_Order(); + $set_to = 'Bedrock Ltd.'; + $object->set_billing_company( $set_to ); + $this->assertEquals( $set_to, $object->get_billing_company() ); + } + + /** + * Test: get_billing_address_1 + */ + function test_get_billing_address_1() { + $object = new WC_Order(); + $set_to = '34 Stonepants avenue'; + $object->set_billing_address_1( $set_to ); + $this->assertEquals( $set_to, $object->get_billing_address_1() ); + } + + /** + * Test: get_billing_address_2 + */ + function test_get_billing_address_2() { + $object = new WC_Order(); + $set_to = 'Rockville'; + $object->set_billing_address_2( $set_to ); + $this->assertEquals( $set_to, $object->get_billing_address_2() ); + } + + /** + * Test: get_billing_city + */ + function test_get_billing_city() { + $object = new WC_Order(); + $set_to = 'Bedrock'; + $object->set_billing_city( $set_to ); + $this->assertEquals( $set_to, $object->get_billing_city() ); + } + + /** + * Test: get_billing_state + */ + function test_get_billing_state() { + $object = new WC_Order(); + $set_to = 'Boulder'; + $object->set_billing_state( $set_to ); + $this->assertEquals( $set_to, $object->get_billing_state() ); + } + + /** + * Test: get_billing_postcode + */ + function test_get_billing_postcode() { + $object = new WC_Order(); + $set_to = '00001'; + $object->set_billing_postcode( $set_to ); + $this->assertEquals( $set_to, $object->get_billing_postcode() ); + } + + /** + * Test: get_billing_country + */ + function test_get_billing_country() { + $object = new WC_Order(); + $set_to = 'US'; + $object->set_billing_country( $set_to ); + $this->assertEquals( $set_to, $object->get_billing_country() ); + } + + /** + * Test: get_billing_email + */ + function test_get_billing_email() { + $object = new WC_Order(); + $set_to = 'test@test.com'; + $object->set_billing_email( $set_to ); + $this->assertEquals( $set_to, $object->get_billing_email() ); + + $set_to = 'not an email'; + $object->set_billing_email( $set_to ); + $this->assertEquals( '', $object->get_billing_email() ); + } + + /** + * Test: get_billing_phone + */ + function test_get_billing_phone() { + $object = new WC_Order(); + $set_to = '123456678'; + $object->set_billing_phone( $set_to ); + $this->assertEquals( $set_to, $object->get_billing_phone() ); + } + + /** + * Test: get_shipping_first_name + */ + function test_get_shipping_first_name() { + $object = new WC_Order(); + $set_to = 'Fred'; + $object->set_shipping_first_name( $set_to ); + $this->assertEquals( $set_to, $object->get_shipping_first_name() ); + } + + /** + * Test: get_shipping_last_name + */ + function test_get_shipping_last_name() { + $object = new WC_Order(); + $set_to = 'Flintstone'; + $object->set_shipping_last_name( $set_to ); + $this->assertEquals( $set_to, $object->get_shipping_last_name() ); + } + + /** + * Test: get_shipping_company + */ + function test_get_shipping_company() { + $object = new WC_Order(); + $set_to = 'Bedrock Ltd.'; + $object->set_shipping_company( $set_to ); + $this->assertEquals( $set_to, $object->get_shipping_company() ); + } + + /** + * Test: get_shipping_address_1 + */ + function test_get_shipping_address_1() { + $object = new WC_Order(); + $set_to = '34 Stonepants avenue'; + $object->set_shipping_address_1( $set_to ); + $this->assertEquals( $set_to, $object->get_shipping_address_1() ); + } + + /** + * Test: get_shipping_address_2 + */ + function test_get_shipping_address_2() { + $object = new WC_Order(); + $set_to = 'Rockville'; + $object->set_shipping_address_2( $set_to ); + $this->assertEquals( $set_to, $object->get_shipping_address_2() ); + } + + /** + * Test: get_shipping_city + */ + function test_get_shipping_city() { + $object = new WC_Order(); + $set_to = 'Bedrock'; + $object->set_shipping_city( $set_to ); + $this->assertEquals( $set_to, $object->get_shipping_city() ); + } + + /** + * Test: get_shipping_state + */ + function test_get_shipping_state() { + $object = new WC_Order(); + $set_to = 'Boulder'; + $object->set_shipping_state( $set_to ); + $this->assertEquals( $set_to, $object->get_shipping_state() ); + } + + /** + * Test: get_shipping_postcode + */ + function test_get_shipping_postcode() { + $object = new WC_Order(); + $set_to = '00001'; + $object->set_shipping_postcode( $set_to ); + $this->assertEquals( $set_to, $object->get_shipping_postcode() ); + } + + /** + * Test: get_shipping_country + */ + function test_get_shipping_country() { + $object = new WC_Order(); + $set_to = 'US'; + $object->set_shipping_country( $set_to ); + $this->assertEquals( $set_to, $object->get_shipping_country() ); + } + + /** + * Test: get_payment_method + */ + function test_get_payment_method() { + $object = new WC_Order(); + $set_to = 'paypal'; + $object->set_payment_method( $set_to ); + $this->assertEquals( $set_to, $object->get_payment_method() ); + } + + /** + * Test: get_payment_method_title + */ + function test_get_payment_method_title() { + $object = new WC_Order(); + $set_to = 'PayPal'; + $object->set_payment_method_title( $set_to ); + $this->assertEquals( $set_to, $object->get_payment_method_title() ); + } + + /** + * Test: get_transaction_id + */ + function test_get_transaction_id() { + $object = new WC_Order(); + $set_to = '12345'; + $object->set_transaction_id( $set_to ); + $this->assertEquals( $set_to, $object->get_transaction_id() ); + } + + /** + * Test: get_customer_ip_address + */ + function test_get_customer_ip_address() { + $object = new WC_Order(); + $set_to = '192.168.1.1'; + $object->set_customer_ip_address( $set_to ); + $this->assertEquals( $set_to, $object->get_customer_ip_address() ); + } + + /** + * Test: get_customer_user_agent + */ + function test_get_customer_user_agent() { + $object = new WC_Order(); + $set_to = 'UAstring'; + $object->set_customer_user_agent( $set_to ); + $this->assertEquals( $set_to, $object->get_customer_user_agent() ); + } + + /** + * Test: get_created_via + */ + function test_get_created_via() { + $object = new WC_Order(); + $set_to = 'WooCommerce'; + $object->set_created_via( $set_to ); + $this->assertEquals( $set_to, $object->get_created_via() ); + } + + /** + * Test: get_customer_note + */ + function test_get_customer_note() { + $object = new WC_Order(); + $set_to = 'Leave on porch.'; + $object->set_customer_note( $set_to ); + $this->assertEquals( $set_to, $object->get_customer_note() ); + } + + /** + * Test: get_date_completed + */ + function test_get_date_completed() { + $object = new WC_Order(); + $object->set_date_completed( '2016-12-12' ); + $this->assertEquals( '1481500800', $object->get_date_completed() ); + + $object->set_date_completed( '1481500800' ); + $this->assertEquals( 1481500800, $object->get_date_completed() ); + } + + /** + * Test: get_date_paid + */ + function test_get_date_paid() { + $object = new WC_Order(); + $set_to = 'PayPal'; + $object->set_date_paid( '2016-12-12' ); + $this->assertEquals( 1481500800, $object->get_date_paid() ); + + $object->set_date_paid( '1481500800' ); + $this->assertEquals( 1481500800, $object->get_date_paid() ); + } + + /** + * Test: get_cart_hash + */ + function test_get_cart_hash() { + $object = new WC_Order(); + $set_to = '12345'; + $object->set_cart_hash( $set_to ); + $this->assertEquals( $set_to, $object->get_cart_hash() ); + } + + /** + * Test: get_address + */ + function test_get_address() { + $object = new WC_Order(); + + $billing = array( + 'first_name' => 'Fred', + 'last_name' => 'Flintstone', + 'company' => 'Bedrock Ltd.', + 'address_1' => '34 Stonepants avenue', + 'address_2' => 'Rockville', + 'city' => 'Bedrock', + 'state' => 'Boulder', + 'postcode' => '00001', + 'country' => 'US', + 'email' => '', + 'phone' => '', + ); + + $shipping = array( + 'first_name' => 'Barney', + 'last_name' => 'Rubble', + 'company' => 'Bedrock Ltd.', + 'address_1' => '34 Stonepants avenue', + 'address_2' => 'Rockville', + 'city' => 'Bedrock', + 'state' => 'Boulder', + 'postcode' => '00001', + 'country' => 'US', + ); + + $object->set_billing_first_name( 'Fred' ); + $object->set_billing_last_name( 'Flintstone' ); + $object->set_billing_company( 'Bedrock Ltd.' ); + $object->set_billing_address_1( '34 Stonepants avenue' ); + $object->set_billing_address_2( 'Rockville' ); + $object->set_billing_city( 'Bedrock' ); + $object->set_billing_state( 'Boulder' ); + $object->set_billing_postcode( '00001' ); + $object->set_billing_country( 'US' ); + + $object->set_shipping_first_name( 'Barney' ); + $object->set_shipping_last_name( 'Rubble' ); + $object->set_shipping_company( 'Bedrock Ltd.' ); + $object->set_shipping_address_1( '34 Stonepants avenue' ); + $object->set_shipping_address_2( 'Rockville' ); + $object->set_shipping_city( 'Bedrock' ); + $object->set_shipping_state( 'Boulder' ); + $object->set_shipping_postcode( '00001' ); + $object->set_shipping_country( 'US' ); + + $this->assertEquals( $billing, $object->get_address() ); + $this->assertEquals( $shipping, $object->get_address( 'shipping' ) ); + } + + /** + * Test: get_shipping_address_map_url + */ + function test_get_shipping_address_map_url() { + $object = new WC_Order(); + $object->set_shipping_first_name( 'Barney' ); + $object->set_shipping_last_name( 'Rubble' ); + $object->set_shipping_company( 'Bedrock Ltd.' ); + $object->set_shipping_address_1( '34 Stonepants avenue' ); + $object->set_shipping_address_2( 'Rockville' ); + $object->set_shipping_city( 'Bedrock' ); + $object->set_shipping_state( 'Boulder' ); + $object->set_shipping_postcode( '00001' ); + $object->set_shipping_country( 'US' ); + $this->assertEquals( 'http://maps.google.com/maps?&q=Barney%2C+Rubble%2C+Bedrock+Ltd.%2C+34+Stonepants+avenue%2C+Rockville%2C+Bedrock%2C+Boulder%2C+00001%2C+US&z=16', $object->get_shipping_address_map_url() ); + } + + /** + * Test: get_formatted_billing_full_name + */ + function test_get_formatted_billing_full_name() { + $object = new WC_Order(); + $object->set_billing_first_name( 'Fred' ); + $object->set_billing_last_name( 'Flintstone' ); + $this->assertEquals( 'Fred Flintstone', $object->get_formatted_billing_full_name() ); + } + + /** + * Test: get_formatted_shipping_full_name + */ + function test_get_formatted_shipping_full_name() { + $object = new WC_Order(); + $object->set_shipping_first_name( 'Barney' ); + $object->set_shipping_last_name( 'Rubble' ); + $this->assertEquals( 'Barney Rubble', $object->get_formatted_shipping_full_name() ); + } + + /** + * Test: get_formatted_billing_address + */ + function test_get_formatted_billing_address() { + $object = new WC_Order(); + $object->set_billing_first_name( 'Fred' ); + $object->set_billing_last_name( 'Flintstone' ); + $object->set_billing_company( 'Bedrock Ltd.' ); + $object->set_billing_address_1( '34 Stonepants avenue' ); + $object->set_billing_address_2( 'Rockville' ); + $object->set_billing_city( 'Bedrock' ); + $object->set_billing_state( 'Boulder' ); + $object->set_billing_postcode( '00001' ); + $object->set_billing_country( 'US' ); + $this->assertEquals( 'Fred Flintstone
    Bedrock Ltd.
    34 Stonepants avenue
    Rockville
    Bedrock, BOULDER 00001
    United States (US)', $object->get_formatted_billing_address() ); + } + + /** + * Test: get_formatted_shipping_address + */ + function test_get_formatted_shipping_address() { + $object = new WC_Order(); + $object->set_shipping_first_name( 'Barney' ); + $object->set_shipping_last_name( 'Rubble' ); + $object->set_shipping_company( 'Bedrock Ltd.' ); + $object->set_shipping_address_1( '34 Stonepants avenue' ); + $object->set_shipping_address_2( 'Rockville' ); + $object->set_shipping_city( 'Bedrock' ); + $object->set_shipping_state( 'Boulder' ); + $object->set_shipping_postcode( '00001' ); + $object->set_shipping_country( 'US' ); + $this->assertEquals( 'Barney Rubble
    Bedrock Ltd.
    34 Stonepants avenue
    Rockville
    Bedrock, BOULDER 00001
    United States (US)', $object->get_formatted_shipping_address() ); + } + + /** + * Test: has_cart_hash + */ + function test_has_cart_hash() { + $object = new WC_Order(); + $this->assertFalse( $object->has_cart_hash( '12345' ) ); + $set_to = '12345'; + $object->set_cart_hash( $set_to ); + $this->assertTrue( $object->has_cart_hash( '12345' ) ); + } + + /** + * Test: is_editable + */ + function test_is_editable() { + $object = new WC_Order(); + $object->set_status( 'pending' ); + $this->assertTrue( $object->is_editable() ); + $object->set_status( 'processing' ); + $this->assertFalse( $object->is_editable() ); + } + + /** + * Test: is_paid + */ + function test_is_paid() { + $object = new WC_Order(); + $object->set_status( 'pending' ); + $this->assertFalse( $object->is_paid() ); + $object->set_status( 'processing' ); + $this->assertTrue( $object->is_paid() ); + } + + /** + * Test: is_download_permitted + */ + function test_is_download_permitted() { + $object = new WC_Order(); + $object->set_status( 'pending' ); + $this->assertFalse( $object->is_download_permitted() ); + $object->set_status( 'completed' ); + $this->assertTrue( $object->is_download_permitted() ); + } + + /** + * Test: needs_shipping_address + */ + function test_needs_shipping_address() { + $object = new WC_Order(); + $this->assertFalse( $object->needs_shipping_address() ); + + $object = WC_Helper_Order::create_order(); + $this->assertTrue( $object->needs_shipping_address() ); + } + + /** + * Test: has_downloadable_item + */ + function test_has_downloadable_item() { + $object = new WC_Order(); + $this->assertFalse( $object->has_downloadable_item() ); + + $object = WC_Helper_Order::create_order(); + $this->assertFalse( $object->has_downloadable_item() ); + } + + /** + * Test: needs_payment + */ + function test_needs_payment() { + $object = new WC_Order(); + + $object->set_status( 'pending' ); + $this->assertFalse( $object->needs_payment() ); + + $object->set_total( 100 ); + $this->assertTrue( $object->needs_payment() ); + + $object->set_status( 'processing' ); + $this->assertFalse( $object->needs_payment() ); + } + + /** + * Test: get_checkout_payment_url + */ + function test_get_checkout_payment_url() { + $object = new WC_Order(); + $id = $object->save(); + $this->assertEquals( 'http://example.org?order-pay=' . $id . '&pay_for_order=true&key=' . $object->get_order_key(), $object->get_checkout_payment_url() ); + } + + /** + * Test: get_checkout_order_received_url + */ + function test_get_checkout_order_received_url() { + $object = new WC_Order(); + $object->set_order_key( 'xxx' ); + $id = $object->save(); + $this->assertEquals( 'http://example.org?order-received=' . $id . '&key=' . $object->get_order_key(), $object->get_checkout_order_received_url() ); + } + + /** + * Test: get_cancel_order_url + */ + function test_get_cancel_order_url() { + $object = new WC_Order(); + $this->assertInternalType( 'string', $object->get_cancel_order_url() ); + } + + /** + * Test: get_cancel_order_url_raw + */ + function test_get_cancel_order_url_raw() { + $object = new WC_Order(); + $this->assertInternalType( 'string', $object->get_cancel_order_url_raw() ); + } + + /** + * Test: get_cancel_endpoint + */ + function test_get_cancel_endpoint() { + $object = new WC_Order(); + $this->assertEquals( 'http://example.org/', $object->get_cancel_endpoint() ); + } + + /** + * Test: get_view_order_url + */ + function test_get_view_order_url() { + $object = new WC_Order(); + $id = $object->save(); + $this->assertEquals( 'http://example.org?view-order=' . $id, $object->get_view_order_url() ); + } + + /** + * Test: add_order_note + */ + function test_add_order_note() { + $object = new WC_Order(); + $id = $object->save(); + $comment_id = $object->add_order_note( "Hello, I am a fish" ); + $this->assertTrue( $comment_id > 0 ); + + $comment = get_comment( $comment_id ); + $this->assertEquals( "Hello, I am a fish", $comment->comment_content ); + } + + /** + * Test: get_customer_order_notes + */ + function test_get_customer_order_notes() { + $object = new WC_Order(); + $id = $object->save(); + + $this->assertCount( 0, $object->get_customer_order_notes() ); + + $object->add_order_note( "Hello, I am a fish", true ); + $object->add_order_note( "Hello, I am a fish", false ); + $object->add_order_note( "Hello, I am a fish", true ); + + $this->assertCount( 2, $object->get_customer_order_notes() ); + } + + /** + * Test: get_refunds + */ + function test_get_refunds() { + $object = new WC_Order(); + $id = $object->save(); + + $this->assertCount( 0, $object->get_refunds() ); + + wc_create_refund( array( + 'order_id' => $id, + 'amount' => '100', + 'line_items' => array(), + ) ); + + $this->assertCount( 1, $object->get_refunds() ); + } + + /** + * Test: get_total_refunded + */ + function test_get_total_refunded() { + $object = new WC_Order(); + $object->set_total( 400 ); + $id = $object->save(); + wc_create_refund( array( + 'order_id' => $id, + 'amount' => '100', + 'line_items' => array(), + ) ); + wc_create_refund( array( + 'order_id' => $id, + 'amount' => '100', + 'line_items' => array(), + ) ); + $this->assertEquals( 200, $object->get_total_refunded() ); + } + + /** + * Test: get_total_tax_refunded + */ + function test_get_total_tax_refunded() { + $object = new WC_Order(); + $this->assertEquals( 0, $object->get_total_tax_refunded() ); + } + + /** + * Test: get_total_shipping_refunded + */ + function test_get_total_shipping_refunded() { + $object = new WC_Order(); + $this->assertEquals( 0, $object->get_total_shipping_refunded() ); + } + + /** + * Test: get_total_shipping_refunded + */ + function test_get_total_qty_refunded() { + $object = new WC_Order(); + $this->assertEquals( 0, $object->get_total_shipping_refunded() ); + } + + /** + * Test: get_qty_refunded_for_item + */ + function test_get_qty_refunded_for_item() { + $object = new WC_Order(); + $this->assertEquals( 0, $object->get_qty_refunded_for_item( 2 ) ); + } + + /** + * Test: test_get_total_refunded_for_item + */ + function test_get_total_refunded_for_item() { + $object = new WC_Order(); + $this->assertEquals( 0, $object->get_total_refunded_for_item( 2 ) ); + } + + /** + * Test: get_tax_refunded_for_item + */ + function test_get_tax_refunded_for_item() { + $object = new WC_Order(); + $this->assertEquals( 0, $object->get_tax_refunded_for_item( 1, 1 ) ); + } + + /** + * Test: get_total_tax_refunded_by_rate_id + */ + function test_get_total_tax_refunded_by_rate_id() { + $object = new WC_Order(); + $this->assertEquals( 0, $object->get_total_tax_refunded_by_rate_id( 2 ) ); + } + + /** + * Test: get_remaining_refund_amount + */ + function test_get_remaining_refund_amount() { + $object = new WC_Order(); + $object->set_total( 400 ); + $id = $object->save(); + wc_create_refund( array( + 'order_id' => $id, + 'amount' => '100', + 'line_items' => array(), + ) ); + $this->assertEquals( 300, $object->get_remaining_refund_amount() ); + } + + /** + * Test: get_total_tax_refunded_by_rate_id + */ + function test_get_remaining_refund_items() { + $object = WC_Helper_Order::create_order(); + $this->assertEquals( 4, $object->get_remaining_refund_items() ); + } +} diff --git a/tests/unit-tests/crud/refunds.php b/tests/unit-tests/crud/refunds.php new file mode 100644 index 00000000000..38f077ef62d --- /dev/null +++ b/tests/unit-tests/crud/refunds.php @@ -0,0 +1,43 @@ +assertEquals( 'shop_order_refund', $object->get_type() ); + } + + /** + * Test: get_refund_amount + */ + function test_get_refund_amount() { + $object = new WC_Order_Refund(); + $object->set_refund_amount( 20 ); + $this->assertEquals( '20.00', $object->get_refund_amount() ); + } + + /** + * Test: get_refund_reason + */ + function test_get_refund_reason() { + $object = new WC_Order_Refund(); + $object->set_refund_reason( 'Customer is an idiot' ); + $this->assertEquals( 'Customer is an idiot', $object->get_refund_reason() ); + } + + /** + * Test: get_refunded_by + */ + function test_get_refunded_by() { + $object = new WC_Order_Refund(); + $object->set_refunded_by( 1 ); + $this->assertEquals( 1, $object->get_refunded_by() ); + } +} diff --git a/tests/unit-tests/order/functions.php b/tests/unit-tests/order/functions.php index b17717aa31c..ad516a63739 100644 --- a/tests/unit-tests/order/functions.php +++ b/tests/unit-tests/order/functions.php @@ -109,7 +109,7 @@ class WC_Tests_Order_Functions extends WC_Unit_Test_Case { $this->assertInstanceOf( 'WC_Order', wc_get_order( $order ) ); // Assert that wc_get_order() accepts a order post id. - $this->assertInstanceOf( 'WC_Order', wc_get_order( $order->id ) ); + $this->assertInstanceOf( 'WC_Order', wc_get_order( $order->get_id() ) ); // Assert that a non-shop_order post returns false $post = $this->factory->post->create_and_get( array( 'post_type' => 'post' ) ); @@ -132,7 +132,7 @@ class WC_Tests_Order_Functions extends WC_Unit_Test_Case { $this->assertEmpty( $order->get_payment_tokens() ); $token = WC_Helper_Payment_Token::create_cc_token(); - update_post_meta( $order->id, '_payment_tokens', array( $token->get_id() ) ); + update_post_meta( $order->get_id(), '_payment_tokens', array( $token->get_id() ) ); $this->assertCount( 1, $order->get_payment_tokens() ); } diff --git a/tests/unit-tests/payment-tokens/payment-tokens.php b/tests/unit-tests/payment-tokens/payment-tokens.php index 27843506792..558bb37ae5d 100644 --- a/tests/unit-tests/payment-tokens/payment-tokens.php +++ b/tests/unit-tests/payment-tokens/payment-tokens.php @@ -18,12 +18,12 @@ class WC_Tests_Payment_Tokens extends WC_Unit_Test_Case { */ function test_wc_payment_tokens_get_order_tokens() { $order = WC_Helper_Order::create_order(); - $this->assertEmpty( WC_Payment_Tokens::get_order_tokens( $order->id ) ); + $this->assertEmpty( WC_Payment_Tokens::get_order_tokens( $order->get_id() ) ); $token = WC_Helper_Payment_Token::create_cc_token(); - update_post_meta( $order->id, '_payment_tokens', array( $token->get_id() ) ); + update_post_meta( $order->get_id(), '_payment_tokens', array( $token->get_id() ) ); - $this->assertCount( 1, WC_Payment_Tokens::get_order_tokens( $order->id ) ); + $this->assertCount( 1, WC_Payment_Tokens::get_order_tokens( $order->get_id() ) ); } diff --git a/tests/unit-tests/util/conditional-functions.php b/tests/unit-tests/util/conditional-functions.php index 5da4d4142fd..2c347d25f8d 100644 --- a/tests/unit-tests/util/conditional-functions.php +++ b/tests/unit-tests/util/conditional-functions.php @@ -97,6 +97,26 @@ class WC_Tests_Conditional_Functions extends WC_Unit_Test_Case { ); } + /** + * Test wc_site_is_https(). + */ + public function test_wc_site_is_https() { + $this->assertFalse( wc_site_is_https() ); + + add_filter( 'pre_option_home', array( $this, '_https_url' ) ); + + $this->assertTrue( wc_site_is_https() ); + } + + /** + * Callback for chaning home url to https. + * + * @return string + */ + public function _https_url() { + return 'https://example.org'; + } + /** * Test wc_is_valid_url(). * diff --git a/woocommerce.php b/woocommerce.php index 4ff796e066a..373524cbb60 100644 --- a/woocommerce.php +++ b/woocommerce.php @@ -483,11 +483,14 @@ final class WooCommerce { public function wpdb_table_fix() { global $wpdb; $wpdb->payment_tokenmeta = $wpdb->prefix . 'woocommerce_payment_tokenmeta'; - $wpdb->woocommerce_termmeta = $wpdb->prefix . 'woocommerce_termmeta'; $wpdb->order_itemmeta = $wpdb->prefix . 'woocommerce_order_itemmeta'; $wpdb->tables[] = 'woocommerce_payment_tokenmeta'; - $wpdb->tables[] = 'woocommerce_termmeta'; $wpdb->tables[] = 'woocommerce_order_itemmeta'; + + if ( get_option( 'db_version' ) < 34370 ) { + $wpdb->woocommerce_termmeta = $wpdb->prefix . 'woocommerce_termmeta'; + $wpdb->tables[] = 'woocommerce_termmeta'; + } } /**

    : Name ); ?>
    : ' . sprintf( __( '%s is available', 'woocommerce' ), esc_html( $update_theme_version ) ) . ''; + echo esc_html( $theme['version'] ); + if ( version_compare( $theme['version'], $theme['version_latest'], '<' ) ) { + echo ' – ' . sprintf( __( '%s is available', 'woocommerce' ), esc_html( $theme['version_latest'] ) ) . ''; } ?>
    : {'Author URI'}; ?>
    : ' : ' – ' . sprintf( __( 'If you\'re modifying WooCommerce on a parent theme you didn\'t build personally, then we recommend using a child theme. See: How to create a child theme', 'woocommerce' ), 'https://codex.wordpress.org/Child_Themes' ); + echo $theme['is_child_theme'] ? '' : ' – ' . sprintf( __( 'If you\'re modifying WooCommerce on a parent theme you didn\'t build personally, then we recommend using a child theme. See: How to create a child theme', 'woocommerce' ), 'https://codex.wordpress.org/Child_Themes' ); ?>
    : Name ); ?>
    : Version ); - - if ( version_compare( $parent_theme->Version, $update_theme_version, '<' ) ) { - echo ' – ' . sprintf( __( '%s is available', 'woocommerce' ), esc_html( $update_theme_version ) ) . ''; + echo esc_html( $theme['parent_version'] ); + if ( version_compare( $theme['parent_version'], $theme['parent_version_latest'], '<' ) ) { + echo ' – ' . sprintf( __( '%s is available', 'woocommerce' ), esc_html( $theme['parent_version_latest'] ) ) . ''; } ?>
    : {'Author URI'}; ?>
    : template, wc_get_core_supported_themes() ) ) { + if ( ! $theme['has_woocommerce_support'] ) { echo ' ' . __( 'Not Declared', 'woocommerce' ) . ''; } else { echo ''; @@ -729,62 +549,36 @@ global $wpdb;
    ::  
    ():  ', $found_plugin_files ); ?> + %s version %s is out of date. The core version is %s', 'woocommerce' ), $override['file'], $override['version'] ? $override['version'] : '-', $override['core_version'] ); + } else { + echo esc_html( $override['file'] ); + } + if ( $i !== ( count( $theme['overrides'] ) - 1 ) ) { + echo ', '; + } + echo '
    '; + } + ?> +
     :  
    get_weight() ) . ' ' . esc_attr( get_option( 'woocommerce_weight_unit' ) ); ?>get_weight() ? wc_format_localized_decimal( $product->get_weight() ) . ' ' . esc_attr( get_option( 'woocommerce_weight_unit' ) ) : __( 'N/A', 'woocommerce' ); ?>
    get_dimensions(); ?>get_dimensions() ? $product->get_dimensions() : __( 'N/A', 'woocommerce' ); ?>