Merge branch 'master' into improvement/versions

# Conflicts:
#	assets/css/admin-rtl.css
#	assets/css/admin.css
#	assets/css/helper-rtl.css
#	assets/css/helper.css
#	assets/css/twenty-seventeen-rtl.css
#	assets/css/twenty-seventeen.css
#	assets/css/wc-setup-rtl.css
#	assets/css/wc-setup.css
#	assets/css/woocommerce-rtl.css
#	assets/css/woocommerce.css
This commit is contained in:
Mike Jolley 2017-07-17 18:04:28 +01:00
commit 8c17027eb6
84 changed files with 1118 additions and 418 deletions

View File

@ -1 +1 @@
div.woocommerce-message{overflow:hidden;position:relative;border-right-color:#cc99c2!important}div.woocommerce-message p{max-width:700px}.woocommerce-message a.button-primary,p.woocommerce-actions a.button-primary{background:#bb77ae;border-color:#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-message a.button-primary:active,.woocommerce-message a.button-primary:focus,.woocommerce-message a.button-primary:hover,p.woocommerce-actions a.button-primary:active,p.woocommerce-actions a.button-primary:focus,p.woocommerce-actions a.button-primary:hover{background:#a36597;border-color:#a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597}.woocommerce-message a.woocommerce-message-close,p.woocommerce-actions a.woocommerce-message-close{position:absolute;top:0;left:0;padding:10px 21px 10px 15px;font-size:13px;line-height:1.23076923;text-decoration:none}.woocommerce-message a.woocommerce-message-close::before,p.woocommerce-actions a.woocommerce-message-close::before{position:absolute;top:8px;right:0;-webkit-transition:all .1s ease-in-out;transition:all .1s ease-in-out}.woocommerce-message a.button-primary,.woocommerce-message a.button-secondary,p.woocommerce-actions a.button-primary,p.woocommerce-actions a.button-secondary{text-decoration:none!important}.woocommerce-message .twitter-share-button,p.woocommerce-actions .twitter-share-button{margin-top:-3px;margin-right:3px;vertical-align:middle}.woocommerce-about-text,p.woocommerce-actions{margin-bottom:1em!important}div.woocommerce-legacy-shipping-notice,div.woocommerce-no-shipping-methods-notice{overflow:hidden;padding:1px 12px}div.woocommerce-legacy-shipping-notice p,div.woocommerce-no-shipping-methods-notice p{position:relative;z-index:1;max-width:700px;line-height:1.5em;margin:12px 0}div.woocommerce-legacy-shipping-notice p.main,div.woocommerce-no-shipping-methods-notice p.main{font-size:1.1em}div.woocommerce-legacy-shipping-notice::before,div.woocommerce-no-shipping-methods-notice::before{content:'\e01b';font-family:WooCommerce;text-align:center;line-height:1;color:#f7f1f6;display:block;width:1em;font-size:20em;top:36px;left:12px;position:absolute}
div.woocommerce-message{overflow:hidden;position:relative;border-right-color:#cc99c2!important}div.woocommerce-message p{max-width:700px}.woocommerce-message a.button-primary,p.woocommerce-actions a.button-primary{background:#bb77ae;border-color:#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-message a.button-primary:active,.woocommerce-message a.button-primary:focus,.woocommerce-message a.button-primary:hover,p.woocommerce-actions a.button-primary:active,p.woocommerce-actions a.button-primary:focus,p.woocommerce-actions a.button-primary:hover{background:#a36597;border-color:#a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597}.woocommerce-message a.woocommerce-message-close,p.woocommerce-actions a.woocommerce-message-close{position:absolute;top:0;left:0;padding:10px 21px 10px 15px;font-size:13px;line-height:1.23076923;text-decoration:none}.woocommerce-message a.woocommerce-message-close::before,p.woocommerce-actions a.woocommerce-message-close::before{position:absolute;top:8px;right:0;transition:all .1s ease-in-out}.woocommerce-message a.button-primary,.woocommerce-message a.button-secondary,p.woocommerce-actions a.button-primary,p.woocommerce-actions a.button-secondary{text-decoration:none!important}.woocommerce-message .twitter-share-button,p.woocommerce-actions .twitter-share-button{margin-top:-3px;margin-right:3px;vertical-align:middle}.woocommerce-about-text,p.woocommerce-actions{margin-bottom:1em!important}div.woocommerce-legacy-shipping-notice,div.woocommerce-no-shipping-methods-notice{overflow:hidden;padding:1px 12px}div.woocommerce-legacy-shipping-notice p,div.woocommerce-no-shipping-methods-notice p{position:relative;z-index:1;max-width:700px;line-height:1.5em;margin:12px 0}div.woocommerce-legacy-shipping-notice p.main,div.woocommerce-no-shipping-methods-notice p.main{font-size:1.1em}div.woocommerce-legacy-shipping-notice::before,div.woocommerce-no-shipping-methods-notice::before{content:'\e01b';font-family:WooCommerce;text-align:center;line-height:1;color:#f7f1f6;display:block;width:1em;font-size:20em;top:36px;left:12px;position:absolute}

View File

@ -1 +1 @@
div.woocommerce-message{overflow:hidden;position:relative;border-left-color:#cc99c2!important}div.woocommerce-message p{max-width:700px}.woocommerce-message a.button-primary,p.woocommerce-actions a.button-primary{background:#bb77ae;border-color:#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-message a.button-primary:active,.woocommerce-message a.button-primary:focus,.woocommerce-message a.button-primary:hover,p.woocommerce-actions a.button-primary:active,p.woocommerce-actions a.button-primary:focus,p.woocommerce-actions a.button-primary:hover{background:#a36597;border-color:#a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597}.woocommerce-message a.woocommerce-message-close,p.woocommerce-actions a.woocommerce-message-close{position:absolute;top:0;right:0;padding:10px 15px 10px 21px;font-size:13px;line-height:1.23076923;text-decoration:none}.woocommerce-message a.woocommerce-message-close::before,p.woocommerce-actions 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 a.button-primary,.woocommerce-message a.button-secondary,p.woocommerce-actions a.button-primary,p.woocommerce-actions a.button-secondary{text-decoration:none!important}.woocommerce-message .twitter-share-button,p.woocommerce-actions .twitter-share-button{margin-top:-3px;margin-left:3px;vertical-align:middle}.woocommerce-about-text,p.woocommerce-actions{margin-bottom:1em!important}div.woocommerce-legacy-shipping-notice,div.woocommerce-no-shipping-methods-notice{overflow:hidden;padding:1px 12px}div.woocommerce-legacy-shipping-notice p,div.woocommerce-no-shipping-methods-notice p{position:relative;z-index:1;max-width:700px;line-height:1.5em;margin:12px 0}div.woocommerce-legacy-shipping-notice p.main,div.woocommerce-no-shipping-methods-notice p.main{font-size:1.1em}div.woocommerce-legacy-shipping-notice::before,div.woocommerce-no-shipping-methods-notice::before{content:'\e01b';font-family:WooCommerce;text-align:center;line-height:1;color:#f7f1f6;display:block;width:1em;font-size:20em;top:36px;right:12px;position:absolute}
div.woocommerce-message{overflow:hidden;position:relative;border-left-color:#cc99c2!important}div.woocommerce-message p{max-width:700px}.woocommerce-message a.button-primary,p.woocommerce-actions a.button-primary{background:#bb77ae;border-color:#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-message a.button-primary:active,.woocommerce-message a.button-primary:focus,.woocommerce-message a.button-primary:hover,p.woocommerce-actions a.button-primary:active,p.woocommerce-actions a.button-primary:focus,p.woocommerce-actions a.button-primary:hover{background:#a36597;border-color:#a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597}.woocommerce-message a.woocommerce-message-close,p.woocommerce-actions a.woocommerce-message-close{position:absolute;top:0;right:0;padding:10px 15px 10px 21px;font-size:13px;line-height:1.23076923;text-decoration:none}.woocommerce-message a.woocommerce-message-close::before,p.woocommerce-actions a.woocommerce-message-close::before{position:absolute;top:8px;left:0;transition:all .1s ease-in-out}.woocommerce-message a.button-primary,.woocommerce-message a.button-secondary,p.woocommerce-actions a.button-primary,p.woocommerce-actions a.button-secondary{text-decoration:none!important}.woocommerce-message .twitter-share-button,p.woocommerce-actions .twitter-share-button{margin-top:-3px;margin-left:3px;vertical-align:middle}.woocommerce-about-text,p.woocommerce-actions{margin-bottom:1em!important}div.woocommerce-legacy-shipping-notice,div.woocommerce-no-shipping-methods-notice{overflow:hidden;padding:1px 12px}div.woocommerce-legacy-shipping-notice p,div.woocommerce-no-shipping-methods-notice p{position:relative;z-index:1;max-width:700px;line-height:1.5em;margin:12px 0}div.woocommerce-legacy-shipping-notice p.main,div.woocommerce-no-shipping-methods-notice p.main{font-size:1.1em}div.woocommerce-legacy-shipping-notice::before,div.woocommerce-no-shipping-methods-notice::before{content:'\e01b';font-family:WooCommerce;text-align:center;line-height:1;color:#f7f1f6;display:block;width:1em;font-size:20em;top:36px;right:12px;position:absolute}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -989,6 +989,7 @@ ul.wc_coupon_list_block {
textarea,
select,
.wc-enhanced-select,
.wc-category-search,
.wc-customer-search {
width: 100%;
}
@ -5517,6 +5518,7 @@ table.bar_chart {
.woocommerce table.form-table .select2-container {
min-width: 400px !important;
}
.post-type-product .tablenav,
.post-type-shop_order .tablenav {
.actions {
overflow: visible;
@ -5877,3 +5879,12 @@ table.bar_chart {
}
}
}
.wc-pointer {
.wc-pointer-buttons {
.close {
float: left;
margin: 6px 0 0 15px;
}
}
}

View File

@ -1 +1 @@
@charset "UTF-8";@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}ul.woocommerce_stats{overflow:hidden;zoom:1}ul.woocommerce_stats li{width:25%;padding:0 1em;text-align:center;float:right;font-size:.8em;border-right:1px solid #fff;border-left:1px solid #ececec;box-sizing:border-box}ul.woocommerce_stats li:first-child{border-right:0}ul.woocommerce_stats li:last-child{border-left:0}ul.woocommerce_stats strong{font-family:Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size:4em;line-height:1.2em;font-weight:400;text-align:center;display:block}#woocommerce_dashboard_status .inside{padding:0;margin:0}#woocommerce_dashboard_status .wc_status_list{overflow:hidden;margin:0}#woocommerce_dashboard_status .wc_status_list li{width:50%;float:right;padding:0;box-sizing:border-box;margin:0;border-top:1px solid #ececec;color:#aaa}#woocommerce_dashboard_status .wc_status_list li a{display:block;color:#aaa;padding:9px 12px;-webkit-transition:all ease .5s;transition:all ease .5s;position:relative;font-size:12px}#woocommerce_dashboard_status .wc_status_list li a .wc_sparkline{width:4em;height:2em;display:block;float:left;position:absolute;left:0;top:50%;margin-left:12px;margin-top:-1.25em}#woocommerce_dashboard_status .wc_status_list li a strong{font-size:18px;line-height:1.2em;font-weight:400;display:block;color:#21759b}#woocommerce_dashboard_status .wc_status_list li a:hover{color:#2ea2cc}#woocommerce_dashboard_status .wc_status_list li a:hover strong,#woocommerce_dashboard_status .wc_status_list li a:hover::before{color:#2ea2cc!important}#woocommerce_dashboard_status .wc_status_list li a::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;right:0;width:100%;height:100%;text-align:center;content:"";font-size:2em;position:relative;width:auto;line-height:1.2em;color:#464646;float:right;margin-left:12px;margin-bottom:12px}#woocommerce_dashboard_status .wc_status_list li:first-child{border-top:0}#woocommerce_dashboard_status .wc_status_list li.sales-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.sales-this-month a::before{font-family:Dashicons;content:'\f185'}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month a::before{content:'\e006'}#woocommerce_dashboard_status .wc_status_list li.processing-orders{border-left:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.processing-orders a::before{content:'\e011';color:#7ad03a}#woocommerce_dashboard_status .wc_status_list li.on-hold-orders a::before{content:'\e033';color:#999}#woocommerce_dashboard_status .wc_status_list li.low-in-stock{border-left:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.low-in-stock a::before{content:'\e016';color:#ffba00}#woocommerce_dashboard_status .wc_status_list li.out-of-stock a::before{content:'\e013';color:#a00}#woocommerce_dashboard_recent_reviews li{line-height:1.5em;margin-bottom:12px}#woocommerce_dashboard_recent_reviews h4.meta{line-height:1.4;margin:-.2em 0 0 0;font-weight:400;color:#999}#woocommerce_dashboard_recent_reviews blockquote{padding:0;margin:0}#woocommerce_dashboard_recent_reviews .avatar{float:right;margin:0 0 5px 10px}#woocommerce_dashboard_recent_reviews .star-rating{float:left;overflow:hidden;position:relative;height:1.5em;line-height:1.5;margin-right:.5em;width:5.4em;font-family:WooCommerce!important}#woocommerce_dashboard_recent_reviews .star-rating::before{content:'\e021\e021\e021\e021\e021';color:#b3b2b2;float:right;top:0;right:0;position:absolute;letter-spacing:.1em}#woocommerce_dashboard_recent_reviews .star-rating span{overflow:hidden;float:right;top:0;right:0;position:absolute;padding-top:1.5em}#woocommerce_dashboard_recent_reviews .star-rating span::before{content:'\e020\e020\e020\e020\e020';top:0;position:absolute;right:0;letter-spacing:.1em;color:#9c5d90}#dash-right-now li.product-count a::before{font-family:WooCommerce;content:'\e01d'}
@charset "UTF-8";@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}ul.woocommerce_stats{overflow:hidden;zoom:1}ul.woocommerce_stats li{width:25%;padding:0 1em;text-align:center;float:right;font-size:.8em;border-right:1px solid #fff;border-left:1px solid #ececec;box-sizing:border-box}ul.woocommerce_stats li:first-child{border-right:0}ul.woocommerce_stats li:last-child{border-left:0}ul.woocommerce_stats strong{font-family:Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size:4em;line-height:1.2em;font-weight:400;text-align:center;display:block}#woocommerce_dashboard_status .inside{padding:0;margin:0}#woocommerce_dashboard_status .wc_status_list{overflow:hidden;margin:0}#woocommerce_dashboard_status .wc_status_list li{width:50%;float:right;padding:0;box-sizing:border-box;margin:0;border-top:1px solid #ececec;color:#aaa}#woocommerce_dashboard_status .wc_status_list li a{display:block;color:#aaa;padding:9px 12px;transition:all ease .5s;position:relative;font-size:12px}#woocommerce_dashboard_status .wc_status_list li a .wc_sparkline{width:4em;height:2em;display:block;float:left;position:absolute;left:0;top:50%;margin-left:12px;margin-top:-1.25em}#woocommerce_dashboard_status .wc_status_list li a strong{font-size:18px;line-height:1.2em;font-weight:400;display:block;color:#21759b}#woocommerce_dashboard_status .wc_status_list li a:hover{color:#2ea2cc}#woocommerce_dashboard_status .wc_status_list li a:hover strong,#woocommerce_dashboard_status .wc_status_list li a:hover::before{color:#2ea2cc!important}#woocommerce_dashboard_status .wc_status_list li a::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;right:0;width:100%;height:100%;text-align:center;content:"";font-size:2em;position:relative;width:auto;line-height:1.2em;color:#464646;float:right;margin-left:12px;margin-bottom:12px}#woocommerce_dashboard_status .wc_status_list li:first-child{border-top:0}#woocommerce_dashboard_status .wc_status_list li.sales-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.sales-this-month a::before{font-family:Dashicons;content:'\f185'}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month a::before{content:'\e006'}#woocommerce_dashboard_status .wc_status_list li.processing-orders{border-left:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.processing-orders a::before{content:'\e011';color:#7ad03a}#woocommerce_dashboard_status .wc_status_list li.on-hold-orders a::before{content:'\e033';color:#999}#woocommerce_dashboard_status .wc_status_list li.low-in-stock{border-left:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.low-in-stock a::before{content:'\e016';color:#ffba00}#woocommerce_dashboard_status .wc_status_list li.out-of-stock a::before{content:'\e013';color:#a00}#woocommerce_dashboard_recent_reviews li{line-height:1.5em;margin-bottom:12px}#woocommerce_dashboard_recent_reviews h4.meta{line-height:1.4;margin:-.2em 0 0 0;font-weight:400;color:#999}#woocommerce_dashboard_recent_reviews blockquote{padding:0;margin:0}#woocommerce_dashboard_recent_reviews .avatar{float:right;margin:0 0 5px 10px}#woocommerce_dashboard_recent_reviews .star-rating{float:left;overflow:hidden;position:relative;height:1.5em;line-height:1.5;margin-right:.5em;width:5.4em;font-family:WooCommerce!important}#woocommerce_dashboard_recent_reviews .star-rating::before{content:'\e021\e021\e021\e021\e021';color:#b3b2b2;float:right;top:0;right:0;position:absolute;letter-spacing:.1em}#woocommerce_dashboard_recent_reviews .star-rating span{overflow:hidden;float:right;top:0;right:0;position:absolute;padding-top:1.5em}#woocommerce_dashboard_recent_reviews .star-rating span::before{content:'\e020\e020\e020\e020\e020';top:0;position:absolute;right:0;letter-spacing:.1em;color:#9c5d90}#dash-right-now li.product-count a::before{font-family:WooCommerce;content:'\e01d'}

View File

@ -1 +1 @@
@charset "UTF-8";@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}ul.woocommerce_stats{overflow:hidden;zoom:1}ul.woocommerce_stats li{width:25%;padding:0 1em;text-align:center;float:left;font-size:.8em;border-left:1px solid #fff;border-right:1px solid #ececec;box-sizing:border-box}ul.woocommerce_stats li:first-child{border-left:0}ul.woocommerce_stats li:last-child{border-right:0}ul.woocommerce_stats strong{font-family:Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size:4em;line-height:1.2em;font-weight:400;text-align:center;display:block}#woocommerce_dashboard_status .inside{padding:0;margin:0}#woocommerce_dashboard_status .wc_status_list{overflow:hidden;margin:0}#woocommerce_dashboard_status .wc_status_list li{width:50%;float:left;padding:0;box-sizing:border-box;margin:0;border-top:1px solid #ececec;color:#aaa}#woocommerce_dashboard_status .wc_status_list li a{display:block;color:#aaa;padding:9px 12px;-webkit-transition:all ease .5s;transition:all ease .5s;position:relative;font-size:12px}#woocommerce_dashboard_status .wc_status_list li a .wc_sparkline{width:4em;height:2em;display:block;float:right;position:absolute;right:0;top:50%;margin-right:12px;margin-top:-1.25em}#woocommerce_dashboard_status .wc_status_list li a strong{font-size:18px;line-height:1.2em;font-weight:400;display:block;color:#21759b}#woocommerce_dashboard_status .wc_status_list li a:hover{color:#2ea2cc}#woocommerce_dashboard_status .wc_status_list li a:hover strong,#woocommerce_dashboard_status .wc_status_list li a:hover::before{color:#2ea2cc!important}#woocommerce_dashboard_status .wc_status_list li a::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;content:"";font-size:2em;position:relative;width:auto;line-height:1.2em;color:#464646;float:left;margin-right:12px;margin-bottom:12px}#woocommerce_dashboard_status .wc_status_list li:first-child{border-top:0}#woocommerce_dashboard_status .wc_status_list li.sales-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.sales-this-month a::before{font-family:Dashicons;content:'\f185'}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month a::before{content:'\e006'}#woocommerce_dashboard_status .wc_status_list li.processing-orders{border-right:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.processing-orders a::before{content:'\e011';color:#7ad03a}#woocommerce_dashboard_status .wc_status_list li.on-hold-orders a::before{content:'\e033';color:#999}#woocommerce_dashboard_status .wc_status_list li.low-in-stock{border-right:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.low-in-stock a::before{content:'\e016';color:#ffba00}#woocommerce_dashboard_status .wc_status_list li.out-of-stock a::before{content:'\e013';color:#a00}#woocommerce_dashboard_recent_reviews li{line-height:1.5em;margin-bottom:12px}#woocommerce_dashboard_recent_reviews h4.meta{line-height:1.4;margin:-.2em 0 0 0;font-weight:400;color:#999}#woocommerce_dashboard_recent_reviews blockquote{padding:0;margin:0}#woocommerce_dashboard_recent_reviews .avatar{float:left;margin:0 10px 5px 0}#woocommerce_dashboard_recent_reviews .star-rating{float:right;overflow:hidden;position:relative;height:1.5em;line-height:1.5;margin-left:.5em;width:5.4em;font-family:WooCommerce!important}#woocommerce_dashboard_recent_reviews .star-rating::before{content:'\e021\e021\e021\e021\e021';color:#b3b2b2;float:left;top:0;left:0;position:absolute;letter-spacing:.1em}#woocommerce_dashboard_recent_reviews .star-rating span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}#woocommerce_dashboard_recent_reviews .star-rating span::before{content:'\e020\e020\e020\e020\e020';top:0;position:absolute;left:0;letter-spacing:.1em;color:#9c5d90}#dash-right-now li.product-count a::before{font-family:WooCommerce;content:'\e01d'}
@charset "UTF-8";@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}ul.woocommerce_stats{overflow:hidden;zoom:1}ul.woocommerce_stats li{width:25%;padding:0 1em;text-align:center;float:left;font-size:.8em;border-left:1px solid #fff;border-right:1px solid #ececec;box-sizing:border-box}ul.woocommerce_stats li:first-child{border-left:0}ul.woocommerce_stats li:last-child{border-right:0}ul.woocommerce_stats strong{font-family:Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size:4em;line-height:1.2em;font-weight:400;text-align:center;display:block}#woocommerce_dashboard_status .inside{padding:0;margin:0}#woocommerce_dashboard_status .wc_status_list{overflow:hidden;margin:0}#woocommerce_dashboard_status .wc_status_list li{width:50%;float:left;padding:0;box-sizing:border-box;margin:0;border-top:1px solid #ececec;color:#aaa}#woocommerce_dashboard_status .wc_status_list li a{display:block;color:#aaa;padding:9px 12px;transition:all ease .5s;position:relative;font-size:12px}#woocommerce_dashboard_status .wc_status_list li a .wc_sparkline{width:4em;height:2em;display:block;float:right;position:absolute;right:0;top:50%;margin-right:12px;margin-top:-1.25em}#woocommerce_dashboard_status .wc_status_list li a strong{font-size:18px;line-height:1.2em;font-weight:400;display:block;color:#21759b}#woocommerce_dashboard_status .wc_status_list li a:hover{color:#2ea2cc}#woocommerce_dashboard_status .wc_status_list li a:hover strong,#woocommerce_dashboard_status .wc_status_list li a:hover::before{color:#2ea2cc!important}#woocommerce_dashboard_status .wc_status_list li a::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;content:"";font-size:2em;position:relative;width:auto;line-height:1.2em;color:#464646;float:left;margin-right:12px;margin-bottom:12px}#woocommerce_dashboard_status .wc_status_list li:first-child{border-top:0}#woocommerce_dashboard_status .wc_status_list li.sales-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.sales-this-month a::before{font-family:Dashicons;content:'\f185'}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month a::before{content:'\e006'}#woocommerce_dashboard_status .wc_status_list li.processing-orders{border-right:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.processing-orders a::before{content:'\e011';color:#7ad03a}#woocommerce_dashboard_status .wc_status_list li.on-hold-orders a::before{content:'\e033';color:#999}#woocommerce_dashboard_status .wc_status_list li.low-in-stock{border-right:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.low-in-stock a::before{content:'\e016';color:#ffba00}#woocommerce_dashboard_status .wc_status_list li.out-of-stock a::before{content:'\e013';color:#a00}#woocommerce_dashboard_recent_reviews li{line-height:1.5em;margin-bottom:12px}#woocommerce_dashboard_recent_reviews h4.meta{line-height:1.4;margin:-.2em 0 0 0;font-weight:400;color:#999}#woocommerce_dashboard_recent_reviews blockquote{padding:0;margin:0}#woocommerce_dashboard_recent_reviews .avatar{float:left;margin:0 10px 5px 0}#woocommerce_dashboard_recent_reviews .star-rating{float:right;overflow:hidden;position:relative;height:1.5em;line-height:1.5;margin-left:.5em;width:5.4em;font-family:WooCommerce!important}#woocommerce_dashboard_recent_reviews .star-rating::before{content:'\e021\e021\e021\e021\e021';color:#b3b2b2;float:left;top:0;left:0;position:absolute;letter-spacing:.1em}#woocommerce_dashboard_recent_reviews .star-rating span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}#woocommerce_dashboard_recent_reviews .star-rating span::before{content:'\e020\e020\e020\e020\e020';top:0;position:absolute;left:0;letter-spacing:.1em;color:#9c5d90}#dash-right-now li.product-count a::before{font-family:WooCommerce;content:'\e01d'}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
*{background:0 0!important;color:#000!important;text-shadow:none!important;-webkit-filter:none!important;filter:none!important;-ms-filter:none!important;font-size:9pt!important;opacity:1;-webkit-transition:none!important;transition:none!important}@page{margin:.5cm}#adminmenuback,#adminmenuwrap,#screen-meta-links,#wpadminbar,#wpfooter,.update-nag,.updated,.woo-nav-tab-wrapper,.woocommerce-reports-wide .button,.woocommerce-reports-wide .postbox h3.stats_range .export_csv,.woocommerce-reports-wrap .postbox h3.stats_range .export_csv{display:none}h2 .nav-tab{line-height:14px}.woocommerce-reports-wide .postbox h3.stats_range ul li a,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom,.woocommerce-reports-wrap .postbox h3.stats_range ul li a,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom{padding:5px;line-height:14px}#wpcontent{margin-right:0}.woocommerce-reports-wide .postbox .chart-with-sidebar .chart-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar .chart-sidebar{margin-right:-130px;width:130px;display:block}.woocommerce-reports-wide .postbox .chart-with-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar{padding-right:130px}.chart-legend{overflow:hidden;zoom:1}.chart-legend li{padding:.25em .5em!important;box-shadow:none!important;border-bottom:1px solid gray!important}
*{background:0 0!important;color:#000!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important;font-size:9pt!important;opacity:1;transition:none!important}@page{margin:.5cm}#adminmenuback,#adminmenuwrap,#screen-meta-links,#wpadminbar,#wpfooter,.update-nag,.updated,.woo-nav-tab-wrapper,.woocommerce-reports-wide .button,.woocommerce-reports-wide .postbox h3.stats_range .export_csv,.woocommerce-reports-wrap .postbox h3.stats_range .export_csv{display:none}h2 .nav-tab{line-height:14px}.woocommerce-reports-wide .postbox h3.stats_range ul li a,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom,.woocommerce-reports-wrap .postbox h3.stats_range ul li a,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom{padding:5px;line-height:14px}#wpcontent{margin-right:0}.woocommerce-reports-wide .postbox .chart-with-sidebar .chart-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar .chart-sidebar{margin-right:-130px;width:130px;display:block}.woocommerce-reports-wide .postbox .chart-with-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar{padding-right:130px}.chart-legend{overflow:hidden;zoom:1}.chart-legend li{padding:.25em .5em!important;box-shadow:none!important;border-bottom:1px solid gray!important}

View File

@ -1 +1 @@
*{background:0 0!important;color:#000!important;text-shadow:none!important;-webkit-filter:none!important;filter:none!important;-ms-filter:none!important;font-size:9pt!important;opacity:1;-webkit-transition:none!important;transition:none!important}@page{margin:.5cm}#adminmenuback,#adminmenuwrap,#screen-meta-links,#wpadminbar,#wpfooter,.update-nag,.updated,.woo-nav-tab-wrapper,.woocommerce-reports-wide .button,.woocommerce-reports-wide .postbox h3.stats_range .export_csv,.woocommerce-reports-wrap .postbox h3.stats_range .export_csv{display:none}h2 .nav-tab{line-height:14px}.woocommerce-reports-wide .postbox h3.stats_range ul li a,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom,.woocommerce-reports-wrap .postbox h3.stats_range ul li a,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom{padding:5px;line-height:14px}#wpcontent{margin-left:0}.woocommerce-reports-wide .postbox .chart-with-sidebar .chart-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar .chart-sidebar{margin-left:-130px;width:130px;display:block}.woocommerce-reports-wide .postbox .chart-with-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar{padding-left:130px}.chart-legend{overflow:hidden;zoom:1}.chart-legend li{padding:.25em .5em!important;box-shadow:none!important;border-bottom:1px solid gray!important}
*{background:0 0!important;color:#000!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important;font-size:9pt!important;opacity:1;transition:none!important}@page{margin:.5cm}#adminmenuback,#adminmenuwrap,#screen-meta-links,#wpadminbar,#wpfooter,.update-nag,.updated,.woo-nav-tab-wrapper,.woocommerce-reports-wide .button,.woocommerce-reports-wide .postbox h3.stats_range .export_csv,.woocommerce-reports-wrap .postbox h3.stats_range .export_csv{display:none}h2 .nav-tab{line-height:14px}.woocommerce-reports-wide .postbox h3.stats_range ul li a,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom,.woocommerce-reports-wrap .postbox h3.stats_range ul li a,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom{padding:5px;line-height:14px}#wpcontent{margin-left:0}.woocommerce-reports-wide .postbox .chart-with-sidebar .chart-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar .chart-sidebar{margin-left:-130px;width:130px;display:block}.woocommerce-reports-wide .postbox .chart-with-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar{padding-left:130px}.chart-legend{overflow:hidden;zoom:1}.chart-legend li{padding:.25em .5em!important;box-shadow:none!important;border-bottom:1px solid gray!important}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -902,10 +902,21 @@ button.pswp__button--zoom:hover {
.select2-choice:hover {
box-shadow: none !important;
}
.select2-choice {
padding: .7em 0 .7em .7em;
}
.select2-container .select2-selection--single {
height: 48px;
}
.select2-container .select2-selection--single .select2-selection__rendered {
line-height: 48px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 46px;
}
.select2-container--focus .select2-selection {
border-color: black;
}
}
.woocommerce-checkout-review-order-table {
@ -1028,6 +1039,10 @@ button.pswp__button--zoom:hover {
}
}
}
.select2-container--focus .select2-selection {
border-color: white;
}
}
/**

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1410,6 +1410,46 @@ p.demo_store,
font-weight: bold;
}
.woocommerce-order-downloads,
.woocommerce-customer-details,
.woocommerce-order-details {
margin-bottom: 2em;
*:last-child {
margin-bottom: 0;
}
}
.woocommerce-customer-details {
address {
font-style: normal;
margin-bottom: 0;
border: 1px solid rgba(0, 0, 0, 0.1);
border-bottom-width: 2px;
border-right-width: 2px;
text-align: left;
width: 100%;
border-radius: 5px;
padding: 6px 12px;
}
.woocommerce-customer-details--phone,
.woocommerce-customer-details--email {
margin-bottom: 0;
padding-left: 1.5em;
}
.woocommerce-customer-details--phone::before {
@include iconbefore( '\e037' );
margin-left: -1.5em;
line-height: 1.75;
position: absolute;
}
.woocommerce-customer-details--email::before {
@include iconbefore( '\e02d' );
margin-left: -1.5em;
line-height: 1.75;
position: absolute;
}
}
/**
* Layered nav widget
*/

View File

@ -239,16 +239,19 @@ jQuery( function( $ ) {
// DATE PICKER FIELDS.
$( '.sale_price_dates_fields' ).each( function() {
var dates = $( this ).find( 'input' ).datepicker({
$( this ).find( 'input' ).datepicker({
defaultDate: '',
dateFormat: 'yy-mm-dd',
numberOfMonths: 1,
showButtonPanel: true,
onSelect: function( selectedDate ) {
var option = $( this ).is( '#_sale_price_dates_from, .sale_price_dates_from' ) ? 'minDate' : 'maxDate';
var instance = $( this ).data( 'datepicker' );
var date = $.datepicker.parseDate( instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings );
var option = $( this ).next().is('.hasDatepicker') ? 'minDate' : 'maxDate',
instance = $( this ).data( 'datepicker' ),
dates = $( this ).closest( '.sale_price_dates_fields' ).find( 'input' ),
date = $.datepicker.parseDate( instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings );
dates.not( this ).datepicker( 'option', option, date );
$( this ).change();
}
});
});

File diff suppressed because one or more lines are too long

View File

@ -196,6 +196,47 @@ jQuery( function( $ ) {
});
}
});
// Ajax category search boxes
$( ':input.wc-category-search' ).filter( ':not(.enhanced)' ).each( function() {
var select2_args = $.extend( {
allowClear : $( this ).data( 'allow_clear' ) ? true : false,
placeholder : $( this ).data( 'placeholder' ),
minimumInputLength: $( this ).data( 'minimum_input_length' ) ? $( this ).data( 'minimum_input_length' ) : 3,
escapeMarkup : function( m ) {
return m;
},
ajax: {
url: wc_enhanced_select_params.ajax_url,
dataType: 'json',
delay: 250,
data: function( params ) {
return {
term: params.term,
action: 'woocommerce_json_search_categories',
security: wc_enhanced_select_params.search_categories_nonce
};
},
processResults: function( data ) {
var terms = [];
if ( data ) {
$.each( data, function( id, term ) {
terms.push({
id: term.slug,
text: term.formatted_name
});
});
}
return {
results: terms
};
},
cache: true
}
}, getEnhancedSelectFormatString() );
$( this ).selectWoo( select2_args ).addClass( 'enhanced' );
});
})
// WooCommerce Backbone Modal

File diff suppressed because one or more lines are too long

View File

@ -11,9 +11,10 @@ jQuery( function( $ ) {
var AddToCartHandler = function() {
$( document )
.on( 'click', '.add_to_cart_button', this.onAddToCart )
.on( 'click', '.remove_from_cart_button', this.onRemoveFromCart )
.on( 'added_to_cart', this.updateButton )
.on( 'added_to_cart', this.updateCartPage )
.on( 'added_to_cart', this.updateFragments );
.on( 'added_to_cart removed_from_cart', this.updateFragments );
};
/**
@ -64,6 +65,34 @@ jQuery( function( $ ) {
}
};
/**
* Update fragments after remove from cart event in mini-cart.
*/
AddToCartHandler.prototype.onRemoveFromCart = function( e ) {
var $thisbutton = $( this ),
$row = $thisbutton.closest( '.woocommerce-mini-cart-item' );
e.preventDefault();
$row.block({
message: null,
overlayCSS: {
opacity: 0.6
}
});
$.post( wc_add_to_cart_params.wc_ajax_url.toString().replace( '%%endpoint%%', 'remove_from_cart' ), { cart_item_key : $thisbutton.data( 'cart_item_key' ) }, function( response ) {
if ( ! response || ! response.fragments ) {
window.location = $thisbutton.attr( 'href' );
return;
}
$( document.body ).trigger( 'removed_from_cart', [ response.fragments, response.cart_hash ] );
}).fail( function() {
window.location = $thisbutton.attr( 'href' );
return;
});
};
/**
* Update cart page elements after add to cart events.
*/

View File

@ -1 +1 @@
jQuery(function(t){if("undefined"==typeof wc_add_to_cart_params)return!1;var a=function(){t(document).on("click",".add_to_cart_button",this.onAddToCart).on("added_to_cart",this.updateButton).on("added_to_cart",this.updateCartPage).on("added_to_cart",this.updateFragments)};a.prototype.onAddToCart=function(a){var d=t(this);if(d.is(".ajax_add_to_cart")){if(!d.attr("data-product_id"))return!0;a.preventDefault(),d.removeClass("added"),d.addClass("loading");var o={};t.each(d.data(),function(t,a){o[t]=a}),t(document.body).trigger("adding_to_cart",[d,o]),t.post(wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart"),o,function(a){a&&(a.error&&a.product_url?window.location=a.product_url:"yes"!==wc_add_to_cart_params.cart_redirect_after_add?t(document.body).trigger("added_to_cart",[a.fragments,a.cart_hash,d]):window.location=wc_add_to_cart_params.cart_url)})}},a.prototype.updateButton=function(a,d,o,r){(r=void 0!==r&&r)&&(r.removeClass("loading"),r.addClass("added"),wc_add_to_cart_params.is_cart||0!==r.parent().find(".added_to_cart").length||r.after(' <a href="'+wc_add_to_cart_params.cart_url+'" class="added_to_cart wc-forward" title="'+wc_add_to_cart_params.i18n_view_cart+'">'+wc_add_to_cart_params.i18n_view_cart+"</a>"),t(document.body).trigger("wc_cart_button_updated",[r]))},a.prototype.updateCartPage=function(){var a=window.location.toString().replace("add-to-cart","added-to-cart");t(".shop_table.cart").load(a+" .shop_table.cart:eq(0) > *",function(){t(".shop_table.cart").stop(!0).css("opacity","1").unblock(),t(document.body).trigger("cart_page_refreshed")}),t(".cart_totals").load(a+" .cart_totals:eq(0) > *",function(){t(".cart_totals").stop(!0).css("opacity","1").unblock(),t(document.body).trigger("cart_totals_refreshed")})},a.prototype.updateFragments=function(a,d){d&&(t.each(d,function(a){t(a).addClass("updating").fadeTo("400","0.6").block({message:null,overlayCSS:{opacity:.6}})}),t.each(d,function(a,d){t(a).replaceWith(d),t(a).stop(!0).css("opacity","1").unblock()}),t(document.body).trigger("wc_fragments_loaded"))},new a});
jQuery(function(t){if("undefined"==typeof wc_add_to_cart_params)return!1;var a=function(){t(document).on("click",".add_to_cart_button",this.onAddToCart).on("click",".remove_from_cart_button",this.onRemoveFromCart).on("added_to_cart",this.updateButton).on("added_to_cart",this.updateCartPage).on("added_to_cart removed_from_cart",this.updateFragments)};a.prototype.onAddToCart=function(a){var o=t(this);if(o.is(".ajax_add_to_cart")){if(!o.attr("data-product_id"))return!0;a.preventDefault(),o.removeClass("added"),o.addClass("loading");var r={};t.each(o.data(),function(t,a){r[t]=a}),t(document.body).trigger("adding_to_cart",[o,r]),t.post(wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart"),r,function(a){a&&(a.error&&a.product_url?window.location=a.product_url:"yes"!==wc_add_to_cart_params.cart_redirect_after_add?t(document.body).trigger("added_to_cart",[a.fragments,a.cart_hash,o]):window.location=wc_add_to_cart_params.cart_url)})}},a.prototype.onRemoveFromCart=function(a){var o=t(this),r=o.closest(".woocommerce-mini-cart-item");a.preventDefault(),r.block({message:null,overlayCSS:{opacity:.6}}),t.post(wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","remove_from_cart"),{cart_item_key:o.data("cart_item_key")},function(a){a&&a.fragments?t(document.body).trigger("removed_from_cart",[a.fragments,a.cart_hash]):window.location=o.attr("href")}).fail(function(){window.location=o.attr("href")})},a.prototype.updateButton=function(a,o,r,e){(e=void 0!==e&&e)&&(e.removeClass("loading"),e.addClass("added"),wc_add_to_cart_params.is_cart||0!==e.parent().find(".added_to_cart").length||e.after(' <a href="'+wc_add_to_cart_params.cart_url+'" class="added_to_cart wc-forward" title="'+wc_add_to_cart_params.i18n_view_cart+'">'+wc_add_to_cart_params.i18n_view_cart+"</a>"),t(document.body).trigger("wc_cart_button_updated",[e]))},a.prototype.updateCartPage=function(){var a=window.location.toString().replace("add-to-cart","added-to-cart");t(".shop_table.cart").load(a+" .shop_table.cart:eq(0) > *",function(){t(".shop_table.cart").stop(!0).css("opacity","1").unblock(),t(document.body).trigger("cart_page_refreshed")}),t(".cart_totals").load(a+" .cart_totals:eq(0) > *",function(){t(".cart_totals").stop(!0).css("opacity","1").unblock(),t(document.body).trigger("cart_totals_refreshed")})},a.prototype.updateFragments=function(a,o){o&&(t.each(o,function(a){t(a).addClass("updating").fadeTo("400","0.6").block({message:null,overlayCSS:{opacity:.6}})}),t.each(o,function(a,o){t(a).replaceWith(o),t(a).stop(!0).css("opacity","1").unblock()}),t(document.body).trigger("wc_fragments_loaded"))},new a});

35
i18n/states/AO.php Normal file
View File

@ -0,0 +1,35 @@
<?php
/**
* Angola states
*
* @author Marcio Zebedeu
* @category i18n
* @package WooCommerce/i18n
* @version 1.0.0
*/
global $states;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$states['AO'] = array(
'BGO' => __( 'Bengo', 'woocommerce' ),
'BLU' => __( 'Benguela', 'woocommerce' ),
'BIE' => __( 'Bié', 'woocommerce' ),
'CAB' => __( 'Cabinda', 'woocommerce' ),
'CNN' => __( 'Cunene', 'woocommerce' ),
'HUA' => __( 'Huambo', 'woocommerce' ),
'HUI' => __( 'Huíla', 'woocommerce' ),
'CCU' => __( 'Kuando Kubango', 'woocommerce' ),
'CNO' => __( 'Kwanza-Norte', 'woocommerce' ),
'CUS' => __( 'Kwanza-Sul', 'woocommerce' ),
'LUA' => __( 'Luanda', 'woocommerce' ),
'LNO' => __( 'Lunda-Norte', 'woocommerce' ),
'LSU' => __( 'Lunda-Sul', 'woocommerce' ),
'MAL' => __( 'Malanje', 'woocommerce' ),
'MOX' => __( 'Moxico', 'woocommerce' ),
'NAM' => __( 'Namibe', 'woocommerce' ),
'UIG' => __( 'Uíge', 'woocommerce' ),
'ZAI' => __( 'Zaire', 'woocommerce' ),
);

View File

@ -128,6 +128,7 @@ class WC_Admin_Assets {
'ajax_url' => admin_url( 'admin-ajax.php' ),
'search_products_nonce' => wp_create_nonce( 'search-products' ),
'search_customers_nonce' => wp_create_nonce( 'search-customers' ),
'search_categories_nonce' => wp_create_nonce( 'search-categories' ),
) );
// Accounting

View File

@ -230,8 +230,16 @@ class WC_Admin_Importers {
if ( 100 === $percent_complete ) {
// Clear temp meta.
$wpdb->delete( $wpdb->postmeta, array( 'meta_key' => '_original_id' ) );
$wpdb->delete( $wpdb->posts, array( 'post_status' => 'importing', 'post_type' => 'product' ) );
$wpdb->delete( $wpdb->posts, array( 'post_status' => 'importing', 'post_type' => 'product_variation' ) );
$wpdb->query( "
DELETE {$wpdb->posts}, {$wpdb->postmeta}, {$wpdb->term_relationships}
FROM {$wpdb->posts}
LEFT JOIN {$wpdb->term_relationships} ON ( {$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id )
LEFT JOIN {$wpdb->postmeta} ON ( {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id )
LEFT JOIN {$wpdb->term_taxonomy} ON ( {$wpdb->term_taxonomy}.term_taxonomy_id = {$wpdb->term_relationships}.term_taxonomy_id )
LEFT JOIN {$wpdb->terms} ON ( {$wpdb->terms}.term_id = {$wpdb->term_taxonomy}.term_id )
WHERE {$wpdb->posts}.post_type IN ( 'product', 'product_variation' )
AND {$wpdb->posts}.post_status = 'importing'
" );
// Send success.
wp_send_json_success( array(

View File

@ -239,11 +239,34 @@ class WC_Admin_Pointers {
function show_wc_pointer( id ) {
var pointer = wc_pointers.pointers[ id ];
var options = $.extend( pointer.options, {
pointerClass: 'wp-pointer wc-pointer',
close: function() {
if ( pointer.next ) {
show_wc_pointer( pointer.next );
}
}
},
buttons: function( event, t ) {
var close = '" . esc_js( __( 'Dismiss', 'woocommerce' ) ) . "',
next = '" . esc_js( __( 'Next', 'woocommerce' ) ) . "',
button = $( '<a class=\"close\" href=\"#\">' + close + '</a>' ),
button2 = $( '<a class=\"button button-primary\" href=\"#\">' + next + '</a>' ),
wrapper = $( '<div class=\"wc-pointer-buttons\" />' );
button.bind( 'click.pointer', function(e) {
e.preventDefault();
t.element.pointer('destroy');
});
button2.bind( 'click.pointer', function(e) {
e.preventDefault();
t.element.pointer('close');
});
wrapper.append( button );
wrapper.append( button2 );
return wrapper;
},
} );
var this_pointer = $( pointer.target ).pointer( options );
this_pointer.pointer( 'open' );

View File

@ -586,26 +586,19 @@ class WC_Admin_Post_Types {
if ( $post->comment_count ) {
// check the status of the post
$status = ( 'trash' !== $post->post_status ) ? '' : 'post-trashed';
remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );
$latest_notes = get_comments( array(
'post_id' => $post->ID,
'number' => 1,
'status' => $status,
$latest_notes = wc_get_order_notes( array(
'order_id' => $post->ID,
'limit' => 1,
'orderby' => 'date_created_gmt',
) );
add_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );
$latest_note = current( $latest_notes );
if ( isset( $latest_note->comment_content ) && 1 == $post->comment_count ) {
echo '<span class="note-on tips" data-tip="' . wc_sanitize_tooltip( $latest_note->comment_content ) . '">' . __( 'Yes', 'woocommerce' ) . '</span>';
} elseif ( isset( $latest_note->comment_content ) ) {
if ( isset( $latest_note->content ) && 1 == $post->comment_count ) {
echo '<span class="note-on tips" data-tip="' . wc_sanitize_tooltip( $latest_note->content ) . '">' . __( 'Yes', 'woocommerce' ) . '</span>';
} elseif ( isset( $latest_note->content ) ) {
/* translators: %d: notes count */
echo '<span class="note-on tips" data-tip="' . wc_sanitize_tooltip( $latest_note->comment_content . '<br/><small style="display:block">' . sprintf( _n( 'plus %d other note', 'plus %d other notes', ( $post->comment_count - 1 ), 'woocommerce' ), $post->comment_count - 1 ) . '</small>' ) . '">' . __( 'Yes', 'woocommerce' ) . '</span>';
echo '<span class="note-on tips" data-tip="' . wc_sanitize_tooltip( $latest_note->content . '<br/><small style="display:block">' . sprintf( _n( 'Plus %d other note', 'Plus %d other notes', ( $post->comment_count - 1 ), 'woocommerce' ), $post->comment_count - 1 ) . '</small>' ) . '">' . __( 'Yes', 'woocommerce' ) . '</span>';
} else {
/* translators: %d: notes count */
echo '<span class="note-on tips" data-tip="' . wc_sanitize_tooltip( sprintf( _n( '%d note', '%d notes', $post->comment_count, 'woocommerce' ), $post->comment_count ) ) . '">' . __( 'Yes', 'woocommerce' ) . '</span>';
@ -1469,7 +1462,15 @@ class WC_Admin_Post_Types {
global $wp_query;
// Category Filtering
wc_product_dropdown_categories( array( 'option_select_text' => __( 'Filter by category', 'woocommerce' ) ) );
$current_category_slug = isset( $_GET['product_cat'] ) ? wc_clean( $_GET['product_cat'] ) : false;
$current_category = $current_category_slug ? get_term_by( 'slug', $current_category_slug, 'product_cat' ) : false;
?>
<select class="wc-category-search" name="product_cat" data-placeholder="<?php esc_attr_e( 'Filter by category', 'woocommerce' ); ?>" data-allow_clear="true">
<?php if ( $current_category_slug && $current_category ) : ?>
<option value="<?php echo esc_attr( $current_category_slug ); ?>" selected="selected"><?php echo esc_html( $current_category->name ); ?><option>
<?php endif; ?>
</select>
<?php
// Type filtering
$terms = get_terms( 'product_type' );
@ -1675,16 +1676,6 @@ class WC_Admin_Post_Types {
}
}
// Categories
if ( isset( $_GET['product_cat'] ) && '0' === $_GET['product_cat'] ) {
$query->query_vars['tax_query'][] = array(
'taxonomy' => 'product_cat',
'field' => 'id',
'terms' => get_terms( 'product_cat', array( 'fields' => 'ids' ) ),
'operator' => 'NOT IN',
);
}
// Shipping classes
if ( isset( $_GET['product_shipping_class'] ) && '0' === $_GET['product_shipping_class'] ) {
$query->query_vars['tax_query'][] = array(

View File

@ -68,6 +68,7 @@ class WC_Product_CSV_Importer_Controller {
*/
public static function get_importer( $file, $args = array() ) {
$importer_class = apply_filters( 'woocommerce_product_csv_importer_class', 'WC_Product_CSV_Importer' );
$args = apply_filters( 'woocommerce_product_csv_importer_args', $args, $importer_class );
return new $importer_class( $file, $args );
}

View File

@ -226,7 +226,7 @@ class WC_Meta_Box_Coupon_Data {
'label' => __( 'Email restrictions', 'woocommerce' ),
'placeholder' => __( 'No restrictions', 'woocommerce' ),
'description' => __( 'List of allowed emails to check against the customer billing email when an order is placed. Separate email addresses with commas.', 'woocommerce' ),
'value' => implode( ', ', (array) get_post_meta( $post->ID, 'customer_email', true ) ),
'value' => implode( ', ', (array) $coupon->get_email_restrictions() ),
'desc_tip' => true,
'type' => 'email',
'class' => '',

View File

@ -26,18 +26,10 @@ class WC_Meta_Box_Order_Notes {
global $post;
$args = array(
'post_id' => $post->ID,
'orderby' => 'comment_ID',
'order' => 'DESC',
'approve' => 'approve',
'type' => 'order_note',
'order_id' => $post->ID,
);
remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );
$notes = get_comments( $args );
add_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );
$notes = wc_get_order_notes( $args );
echo '<ul class="order_notes">';
@ -46,20 +38,20 @@ class WC_Meta_Box_Order_Notes {
foreach ( $notes as $note ) {
$note_classes = array( 'note' );
$note_classes[] = get_comment_meta( $note->comment_ID, 'is_customer_note', true ) ? 'customer-note' : '';
$note_classes[] = ( __( 'WooCommerce', 'woocommerce' ) === $note->comment_author ) ? 'system-note' : '';
$note_classes[] = $note->customer_note ? 'customer-note' : '';
$note_classes[] = 'system' === $note->added_by ? 'system-note' : '';
$note_classes = apply_filters( 'woocommerce_order_note_class', array_filter( $note_classes ), $note );
?>
<li rel="<?php echo absint( $note->comment_ID ); ?>" class="<?php echo esc_attr( implode( ' ', $note_classes ) ); ?>">
<li rel="<?php echo absint( $note->id ); ?>" class="<?php echo esc_attr( implode( ' ', $note_classes ) ); ?>">
<div class="note_content">
<?php echo wpautop( wptexturize( wp_kses_post( $note->comment_content ) ) ); ?>
<?php echo wpautop( wptexturize( wp_kses_post( $note->content ) ) ); ?>
</div>
<p class="meta">
<abbr class="exact-date" title="<?php echo $note->comment_date; ?>"><?php printf( __( 'added on %1$s at %2$s', 'woocommerce' ), date_i18n( wc_date_format(), strtotime( $note->comment_date ) ), date_i18n( wc_time_format(), strtotime( $note->comment_date ) ) ); ?></abbr>
<abbr class="exact-date" title="<?php echo $note->date_created->date( 'y-m-d h:i:s' ); ?>"><?php printf( __( 'added on %1$s at %2$s', 'woocommerce' ), $note->date_created->date_i18n( wc_date_format() ), $note->date_created->date_i18n( wc_time_format() ) ); ?></abbr>
<?php
if ( __( 'WooCommerce', 'woocommerce' ) !== $note->comment_author ) :
if ( 'system' !== $note->added_by ) :
/* translators: %s: note author */
printf( ' ' . __( 'by %s', 'woocommerce' ), $note->comment_author );
printf( ' ' . __( 'by %s', 'woocommerce' ), $note->added_by );
endif;
?>
<a href="#" class="delete_note" role="button"><?php _e( 'Delete note', 'woocommerce' ); ?></a>

View File

@ -104,7 +104,8 @@ class WC_Admin_Report {
$query = array();
$select = array();
foreach ( $data as $key => $value ) {
foreach ( $data as $raw_key => $value ) {
$key = sanitize_key( $raw_key );
$distinct = '';
if ( isset( $value['distinct'] ) ) {
@ -146,16 +147,17 @@ class WC_Admin_Report {
// Joins
$joins = array();
foreach ( ( $data + $where ) as $key => $value ) {
foreach ( ( $data + $where ) as $raw_key => $value ) {
$join_type = isset( $value['join_type'] ) ? $value['join_type'] : 'INNER';
$type = isset( $value['type'] ) ? $value['type'] : false;
$key = sanitize_key( $raw_key );
switch ( $type ) {
case 'meta' :
$joins[ "meta_{$key}" ] = "{$join_type} JOIN {$wpdb->postmeta} AS meta_{$key} ON ( posts.ID = meta_{$key}.post_id AND meta_{$key}.meta_key = '{$key}' )";
$joins[ "meta_{$key}" ] = "{$join_type} JOIN {$wpdb->postmeta} AS meta_{$key} ON ( posts.ID = meta_{$key}.post_id AND meta_{$key}.meta_key = '{$raw_key}' )";
break;
case 'parent_meta' :
$joins[ "parent_meta_{$key}" ] = "{$join_type} JOIN {$wpdb->postmeta} AS parent_meta_{$key} ON (posts.post_parent = parent_meta_{$key}.post_id) AND (parent_meta_{$key}.meta_key = '{$key}')";
$joins[ "parent_meta_{$key}" ] = "{$join_type} JOIN {$wpdb->postmeta} AS parent_meta_{$key} ON (posts.post_parent = parent_meta_{$key}.post_id) AND (parent_meta_{$key}.meta_key = '{$raw_key}')";
break;
case 'order_item_meta' :
$joins["order_items"] = "{$join_type} JOIN {$wpdb->prefix}woocommerce_order_items AS order_items ON (posts.ID = order_items.order_id)";
@ -166,7 +168,7 @@ class WC_Admin_Report {
$joins[ "order_item_meta_{$key}" ] = "{$join_type} JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS order_item_meta_{$key} ON " .
"(order_items.order_item_id = order_item_meta_{$key}.order_item_id) " .
" AND (order_item_meta_{$key}.meta_key = '{$key}')";
" AND (order_item_meta_{$key}.meta_key = '{$raw_key}')";
break;
case 'order_item' :
$joins["order_items"] = "{$join_type} JOIN {$wpdb->prefix}woocommerce_order_items AS order_items ON posts.ID = order_items.order_id";
@ -181,7 +183,7 @@ class WC_Admin_Report {
}
$join_type = isset( $value['join_type'] ) ? $value['join_type'] : 'INNER';
$type = isset( $value['type'] ) ? $value['type'] : false;
$key = is_array( $value['meta_key'] ) ? $value['meta_key'][0] . '_array' : $value['meta_key'];
$key = sanitize_key( is_array( $value['meta_key'] ) ? $value['meta_key'][0] . '_array' : $value['meta_key'] );
if ( 'order_item_meta' === $type ) {
@ -238,7 +240,7 @@ class WC_Admin_Report {
continue;
}
$key = is_array( $value['meta_key'] ) ? $value['meta_key'][0] . '_array' : $value['meta_key'];
$key = sanitize_key( is_array( $value['meta_key'] ) ? $value['meta_key'][0] . '_array' : $value['meta_key'] );
if ( strtolower( $value['operator'] ) == 'in' || strtolower( $value['operator'] ) == 'not in' ) {

View File

@ -373,14 +373,14 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
$refunded_orders = array_merge( $this->report_data->partial_refunds, $this->report_data->full_refunds );
foreach ( $refunded_orders as $key => $value ) {
$this->report_data->total_tax_refunded += ( $value->total_tax < 0 ? $value->total_tax * -1 : $value->total_tax );
$this->report_data->total_refunds += $value->total_refund;
$this->report_data->total_shipping_tax_refunded += ( $value->total_shipping_tax < 0 ? $value->total_shipping_tax * -1 : $value->total_shipping_tax );
$this->report_data->total_shipping_refunded += ( $value->total_shipping < 0 ? $value->total_shipping * -1 : $value->total_shipping );
$this->report_data->total_tax_refunded += floatval( $value->total_tax < 0 ? $value->total_tax * -1 : $value->total_tax );
$this->report_data->total_refunds += floatval( $value->total_refund );
$this->report_data->total_shipping_tax_refunded += floatval( $value->total_shipping_tax < 0 ? $value->total_shipping_tax * -1 : $value->total_shipping_tax );
$this->report_data->total_shipping_refunded += floatval( $value->total_shipping < 0 ? $value->total_shipping * -1 : $value->total_shipping );
// Only applies to parial.
if ( isset( $value->order_item_count ) ) {
$this->report_data->refunded_order_items += ( $value->order_item_count < 0 ? $value->order_item_count * -1 : $value->order_item_count );
$this->report_data->refunded_order_items += floatval( $value->order_item_count < 0 ? $value->order_item_count * -1 : $value->order_item_count );
}
}

View File

@ -888,6 +888,10 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'option' => 'woocommerce_myaccount_page_id',
'shortcode' => '[' . apply_filters( 'woocommerce_my_account_shortcode_tag', 'woocommerce_my_account' ) . ']',
),
_x( 'Terms and conditions', 'Page setting', 'woocommerce' ) => array(
'option' => 'woocommerce_terms_page_id',
'shortcode' => '',
),
);
$pages_output = array();

View File

@ -1444,7 +1444,7 @@ class WC_API_Orders extends WC_API_Resource {
}
// Force delete since trashed order notes could not be managed through comments list table
$result = wp_delete_comment( $note->comment_ID, true );
$result = wc_delete_order_note( $note->comment_ID );
if ( ! $result ) {
throw new WC_API_Exception( 'woocommerce_api_cannot_delete_order_note', __( 'This order note cannot be deleted', 'woocommerce' ), 500 );

View File

@ -1491,7 +1491,7 @@ class WC_API_Orders extends WC_API_Resource {
}
// Force delete since trashed order notes could not be managed through comments list table
$result = wp_delete_comment( $note->comment_ID, true );
$result = wc_delete_order_note( $note->comment_ID );
if ( ! $result ) {
throw new WC_API_Exception( 'woocommerce_api_cannot_delete_order_note', __( 'This order note cannot be deleted', 'woocommerce' ), 500 );

View File

@ -310,7 +310,7 @@ class WC_REST_Order_Notes_V1_Controller extends WC_REST_Controller {
$request->set_param( 'context', 'edit' );
$response = $this->prepare_item_for_response( $note, $request );
$result = wp_delete_comment( $note->comment_ID, true );
$result = wc_delete_order_note( $note->comment_ID );
if ( ! $result ) {
return new WP_Error( 'woocommerce_rest_cannot_delete', sprintf( __( 'The %s cannot be deleted.', 'woocommerce' ), 'order_note' ), array( 'status' => 500 ) );

View File

@ -93,6 +93,7 @@ class WC_AJAX {
'get_cart_totals' => true,
'update_order_review' => true,
'add_to_cart' => true,
'remove_from_cart' => true,
'checkout' => true,
'get_variation' => true,
'get_customer_location' => true,
@ -127,6 +128,7 @@ class WC_AJAX {
'json_search_products_and_variations' => false,
'json_search_downloadable_products_and_variations' => false,
'json_search_customers' => false,
'json_search_categories' => false,
'term_ordering' => false,
'product_ordering' => false,
'refund_line_items' => false,
@ -382,6 +384,21 @@ class WC_AJAX {
}
}
/**
* AJAX add to cart.
*/
public static function remove_from_cart() {
ob_start();
$cart_item_key = wc_clean( $_POST['cart_item_key'] );
if ( $cart_item_key && false !== WC()->cart->remove_cart_item( $cart_item_key ) ) {
self::get_refreshed_fragments();
} else {
wp_send_json_error();
}
}
/**
* Process ajax checkout form.
*/
@ -613,7 +630,7 @@ class WC_AJAX {
}
$added = 0;
$possible_attributes = wc_array_cartesian( $attributes );
$possible_attributes = array_reverse( wc_array_cartesian( $attributes ) );
foreach ( $possible_attributes as $possible_attribute ) {
if ( in_array( $possible_attribute, $existing_attributes ) ) {
@ -1120,7 +1137,7 @@ class WC_AJAX {
$note_id = (int) $_POST['note_id'];
if ( $note_id > 0 ) {
wp_delete_comment( $note_id );
wc_delete_order_note( $note_id );
}
wp_die();
}
@ -1269,6 +1286,53 @@ class WC_AJAX {
wp_send_json( apply_filters( 'woocommerce_json_search_found_customers', $found_customers ) );
}
/**
* Search for categories and return json.
*/
public static function json_search_categories() {
ob_start();
check_ajax_referer( 'search-categories', 'security' );
if ( ! current_user_can( 'edit_products' ) ) {
wp_die( -1 );
}
if ( ! $search_text = wc_clean( stripslashes( $_GET['term'] ) ) ) {
wp_die();
}
$found_categories = array();
$args = array(
'taxonomy' => array( 'product_cat' ),
'orderby' => 'id',
'order' => 'ASC',
'hide_empty' => true,
'fields' => 'all',
'name__like' => $search_text,
);
if ( $terms = get_terms( $args ) ) {
foreach ( $terms as $term ) {
$term->formatted_name = '';
if ( $term->parent ) {
$ancestors = array_reverse( get_ancestors( $term->term_id, 'product_cat' ) );
foreach ( $ancestors as $ancestor ) {
if ( $ancestor_term = get_term( $ancestor, 'product_cat' ) ) {
$term->formatted_name .= $ancestor_term->name . ' > ';
}
}
}
$term->formatted_name .= $term->name . ' (' . $term->count . ')';
$found_categories[ $term->term_id ] = $term;
}
}
wp_send_json( apply_filters( 'woocommerce_json_search_found_categories', $found_categories ) );
}
/**
* Ajax request handling for categories ordering.
*/

View File

@ -619,7 +619,7 @@ class WC_Cart {
}
}
$cross_sells = array_diff( $cross_sells, $in_cart );
return wp_parse_id_list( $cross_sells );
return apply_filters( 'woocommerce_cart_crosssell_ids', wp_parse_id_list( $cross_sells ), $this );
}
/**

View File

@ -165,6 +165,7 @@ class WC_Emails {
// Email Header, Footer and content hooks
add_action( 'woocommerce_email_header', array( $this, 'email_header' ) );
add_action( 'woocommerce_email_footer', array( $this, 'email_footer' ) );
add_action( 'woocommerce_email_order_details', array( $this, 'order_downloads' ), 10, 4 );
add_action( 'woocommerce_email_order_details', array( $this, 'order_details' ), 10, 4 );
add_action( 'woocommerce_email_order_meta', array( $this, 'order_meta' ), 10, 3 );
add_action( 'woocommerce_email_customer_details', array( $this, 'customer_details' ), 10, 3 );
@ -340,6 +341,36 @@ class WC_Emails {
}
}
/**
* Show order downloads in a table.
*
* @since 3.2.0
* @param WC_Order $order
* @param bool $sent_to_admin
* @param bool $plain_text
* @param string $email
*/
public function order_downloads( $order, $sent_to_admin = false, $plain_text = false, $email = '' ) {
$show_downloads = $order->has_downloadable_item() && $order->is_download_permitted();
if ( ! $show_downloads ) {
return;
}
$downloads = $order->get_downloadable_items();
$columns = apply_filters( 'woocommerce_email_downloads_columns', array(
'download-product' => __( 'Product', 'woocommerce' ),
'download-expires' => __( 'Expires', 'woocommerce' ),
'download-file' => __( 'Download', 'woocommerce' ),
) );
if ( $plain_text ) {
wc_get_template( 'emails/plain/email-downloads.php', array( 'order' => $order, 'sent_to_admin' => $sent_to_admin, 'plain_text' => $plain_text, 'email' => $email, 'downloads' => $downloads, 'columns' => $columns ) );
} else {
wc_get_template( 'emails/email-downloads.php', array( 'order' => $order, 'sent_to_admin' => $sent_to_admin, 'plain_text' => $plain_text, 'email' => $email, 'downloads' => $downloads, 'columns' => $columns ) );
}
}
/**
* Add order meta to email templates.
*
@ -401,7 +432,9 @@ class WC_Emails {
}
/**
* Add customer details to email templates.
* Allows developers to add additional customer details to templates.
*
* In versions prior to 3.2 this was used for notes, phone and email but this data has moved.
*
* @param WC_Order $order
* @param bool $sent_to_admin (default: false)
@ -412,35 +445,15 @@ class WC_Emails {
if ( ! is_a( $order, 'WC_Order' ) ) {
return;
}
$fields = array();
if ( $order->get_customer_note() ) {
$fields['customer_note'] = array(
'label' => __( 'Note', 'woocommerce' ),
'value' => wptexturize( $order->get_customer_note() ),
);
}
$fields = array_filter( apply_filters( 'woocommerce_email_customer_details_fields', array(), $sent_to_admin, $order ), array( $this, 'customer_detail_field_is_valid' ) );
if ( $order->get_billing_email() ) {
$fields['billing_email'] = array(
'label' => __( 'Email address', 'woocommerce' ),
'value' => wptexturize( $order->get_billing_email() ),
);
}
if ( $order->get_billing_phone() ) {
$fields['billing_phone'] = array(
'label' => __( 'Phone', 'woocommerce' ),
'value' => wptexturize( $order->get_billing_phone() ),
);
}
$fields = array_filter( apply_filters( 'woocommerce_email_customer_details_fields', $fields, $sent_to_admin, $order ), array( $this, 'customer_detail_field_is_valid' ) );
if ( $plain_text ) {
wc_get_template( 'emails/plain/email-customer-details.php', array( 'fields' => $fields ) );
} else {
wc_get_template( 'emails/email-customer-details.php', array( 'fields' => $fields ) );
if ( ! empty( $fields ) ) {
if ( $plain_text ) {
wc_get_template( 'emails/plain/email-customer-details.php', array( 'fields' => $fields ) );
} else {
wc_get_template( 'emails/email-customer-details.php', array( 'fields' => $fields ) );
}
}
}

View File

@ -366,9 +366,11 @@ class WC_Order_Item_Product extends WC_Order_Item {
$download_id = $customer_download->get_download_id();
if ( $product->has_file( $download_id ) ) {
$file = $product->get_file( $download_id );
$files[ $download_id ] = $file->get_data();
$files[ $download_id ]['download_url'] = add_query_arg( array(
$file = $product->get_file( $download_id );
$files[ $download_id ] = $file->get_data();
$files[ $download_id ]['downloads_remaining'] = $customer_download->get_downloads_remaining();
$files[ $download_id ]['access_expires'] = $customer_download->get_access_expires();
$files[ $download_id ]['download_url'] = add_query_arg( array(
'download_file' => $product_id,
'order' => $order->get_order_key(),
'email' => urlencode( $order->get_billing_email() ),

View File

@ -1305,6 +1305,37 @@ class WC_Order extends WC_Abstract_Order {
return false;
}
/**
* Get downloads from all line items for this order.
*
* @since 3.2.0
* @return array
*/
public function get_downloadable_items() {
$downloads = array();
foreach ( $this->get_items() as $item ) {
if ( is_object( $item ) && $item->is_type( 'line_item' ) && ( $item_downloads = $item->get_item_downloads() ) ) {
if ( $product = $item->get_product() ) {
foreach ( $item_downloads as $file ) {
$downloads[] = array(
'download_url' => $file['download_url'],
'download_id' => $file['id'],
'product_id' => $product->get_id(),
'product_name' => $product->get_name(),
'download_name' => $file['name'],
'order_id' => $this->get_id(),
'order_key' => $this->get_order_key(),
'downloads_remaining' => $file['downloads_remaining'],
'access_expires' => $file['access_expires'],
);
}
}
}
}
return $downloads;
}
/**
* Checks if an order needs payment, based on status and order total.
*

View File

@ -329,34 +329,16 @@ class WC_Query {
$this->product_query( $q );
if ( is_search() ) {
add_filter( 'posts_where', array( $this, 'search_post_excerpt' ) );
add_filter( 'wp', array( $this, 'remove_posts_where' ) );
}
// And remove the pre_get_posts hook
$this->remove_product_query();
}
/**
* Search post excerpt.
*
* @access public
* @param string $where (default: '')
* @return string (modified where clause)
* @deprecated 3.2.0 - Not needed anymore since WordPress 4.5.
*/
public function search_post_excerpt( $where = '' ) {
global $wp_the_query;
// If this is not a WC Query, do not modify the query
if ( empty( $wp_the_query->query_vars['wc_query'] ) || empty( $wp_the_query->query_vars['s'] ) ) {
return $where;
}
$where = preg_replace(
"/post_title\s+LIKE\s*(\'\%[^\%]+\%\')/",
"post_title LIKE $1) OR (post_excerpt LIKE $1", $where );
wc_deprecated_function( 'WC_Query::search_post_excerpt', '3.2.0', 'Excerpt added to search query by default since WordPress 4.5.' );
return $where;
}
@ -432,9 +414,10 @@ class WC_Query {
/**
* Remove the posts_where filter.
* @deprecated 3.2.0 - Nothing to remove anymore because search_post_excerpt() is deprecated.
*/
public function remove_posts_where() {
remove_filter( 'posts_where', array( $this, 'search_post_excerpt' ) );
wc_deprecated_function( 'WC_Query::remove_posts_where', '3.2.0', 'Nothing to remove anymore because search_post_excerpt() is deprecated.' );
}
/**

View File

@ -731,6 +731,9 @@ class WC_Shortcodes {
<?php
}
// For "is_single" to always make load comments_template() for reviews.
$single_product->is_single = true;
ob_start();
global $wp_query;

View File

@ -245,7 +245,7 @@ class WC_Product_Variation_Data_Store_CPT extends WC_Product_Data_Store_CPT impl
$title_base = get_post_field( 'post_title', $product->get_parent_id() );
$title_suffix = $should_include_attributes ? wc_get_formatted_variation( $product, true, false ) : '';
return apply_filters( 'woocommerce_product_variation_title', rtrim( $title_base . $separator . $title_suffix, $separator ), $product, $title_base, $title_suffix );
return apply_filters( 'woocommerce_product_variation_title', $title_suffix ? $title_base . $separator . $title_suffix : $title_base, $product, $title_base, $title_suffix );
}
/**

View File

@ -150,48 +150,17 @@ class WC_Gateway_COD extends WC_Payment_Gateway {
return false;
}
// Check methods
// Only apply if all packages are being shipped via chosen method, or order is virtual.
if ( ! empty( $this->enable_for_methods ) && $needs_shipping ) {
// Only apply if all packages are being shipped via chosen methods, or order is virtual
$chosen_shipping_methods_session = WC()->session->get( 'chosen_shipping_methods' );
if ( isset( $chosen_shipping_methods_session ) ) {
$chosen_shipping_methods = array_unique( $chosen_shipping_methods_session );
} else {
$chosen_shipping_methods = array();
}
$check_method = false;
$chosen_shipping_methods = array();
if ( is_object( $order ) ) {
if ( $order->shipping_method ) {
$check_method = $order->shipping_method;
}
} elseif ( empty( $chosen_shipping_methods ) || sizeof( $chosen_shipping_methods ) > 1 ) {
$check_method = false;
} elseif ( sizeof( $chosen_shipping_methods ) == 1 ) {
$check_method = $chosen_shipping_methods[0];
$chosen_shipping_methods = array_unique( array_map( 'wc_get_string_before_colon', $order->get_shipping_methods() ) );
} elseif ( $chosen_shipping_methods_session = WC()->session->get( 'chosen_shipping_methods' ) ) {
$chosen_shipping_methods = array_unique( array_map( 'wc_get_string_before_colon', $chosen_shipping_methods_session ) );
}
if ( ! $check_method ) {
return false;
}
if ( strstr( $check_method, ':' ) ) {
$check_method = current( explode( ':', $check_method ) );
}
$found = false;
foreach ( $this->enable_for_methods as $method_id ) {
if ( $check_method === $method_id ) {
$found = true;
break;
}
}
if ( ! $found ) {
if ( 0 < count( array_diff( $chosen_shipping_methods, $this->enable_for_methods ) ) ) {
return false;
}
}

View File

@ -39,6 +39,7 @@ class WC_Product_CSV_Importer extends WC_Product_Importer {
'update_existing' => false, // Whether to update existing items.
'delimiter' => ',', // CSV delimiter.
'prevent_timeouts' => true, // Check memory and time usage and abort if reaching limit.
'enclosure' => '"', // The character used to wrap text in the CSV.
);
$this->params = wp_parse_args( $params, $default_args );
@ -58,7 +59,7 @@ class WC_Product_CSV_Importer extends WC_Product_Importer {
*/
protected function read_file() {
if ( false !== ( $handle = fopen( $this->file, 'r' ) ) ) {
$this->raw_keys = fgetcsv( $handle, 0, $this->params['delimiter'] );
$this->raw_keys = fgetcsv( $handle, 0, $this->params['delimiter'], $this->params['enclosure'] );
// Remove BOM signature from the first item.
if ( isset( $this->raw_keys[0] ) ) {
@ -69,7 +70,7 @@ class WC_Product_CSV_Importer extends WC_Product_Importer {
fseek( $handle, (int) $this->params['start_pos'] );
}
while ( false !== ( $row = fgetcsv( $handle, 0, $this->params['delimiter'] ) ) ) {
while ( false !== ( $row = fgetcsv( $handle, 0, $this->params['delimiter'], $this->params['enclosure'] ) ) ) {
$this->raw_data[] = $row;
$this->file_positions[ count( $this->raw_data ) ] = ftell( $handle );
@ -184,9 +185,11 @@ class WC_Product_CSV_Importer extends WC_Product_Importer {
* If we're not doing an update, create a placeholder product so mapping works
* for rows following this one.
*
* @param stirng $field
* @param array $raw_data
* @return int
*/
public function parse_id_field( $field ) {
public function parse_id_field( $field, $raw_data = array() ) {
global $wpdb;
$id = absint( $field );
@ -204,10 +207,20 @@ class WC_Product_CSV_Importer extends WC_Product_Importer {
// Not updating? Make sure we have a new placeholder for this ID.
if ( ! $this->params['update_existing'] ) {
// If row has a SKU, make sure placeholder was not made already.
if ( isset( $raw_data['sku'] ) && $id = wc_get_product_id_by_sku( $raw_data['sku'] ) ) {
return $id;
}
$product = new WC_Product_Simple();
$product->set_name( 'Import placeholder for ' . $id );
$product->set_status( 'importing' );
$product->add_meta_data( '_original_id', $id, true );
// If row has a SKU, make sure placeholder has it too.
if ( isset( $raw_data['sku'] ) ) {
$product->set_sku( $raw_data['sku'] );
}
$id = $product->save();
}
@ -692,7 +705,7 @@ class WC_Product_CSV_Importer extends WC_Product_Importer {
$value = wp_check_invalid_utf8( $value, true );
}
$data[ $mapped_keys[ $id ] ] = call_user_func( $parse_functions[ $id ], $value );
$data[ $mapped_keys[ $id ] ] = call_user_func( $parse_functions[ $id ], $value, array_combine( $mapped_keys, $row ) );
}
$this->parsed_data[] = apply_filters( 'woocommerce_product_importer_parsed_data', $this->expand_data( $data ), $this );

View File

@ -83,35 +83,47 @@ class WC_Shortcode_Checkout {
$order_id = absint( $order_id );
// Handle payment
// Pay for existing order.
if ( isset( $_GET['pay_for_order'], $_GET['key'] ) && $order_id ) {
try {
$order_key = $_GET['key'];
$order = wc_get_order( $order_id );
// Pay for existing order
$order_key = $_GET['key'];
$order = wc_get_order( $order_id );
// Order or payment link is invalid.
if ( ! $order || $order->get_id() !== $order_id || $order->get_order_key() !== $order_key ) {
throw new Exception( __( 'Sorry, this order is invalid and cannot be paid for.', 'woocommerce' ) );
}
// Order or payment link is invalid.
if ( ! $order || $order->get_id() !== $order_id || $order->get_order_key() !== $order_key ) {
wc_add_notice( __( 'Sorry, this order is invalid and cannot be paid for.', 'woocommerce' ), 'error' );
// Logged out customer does not have permission to pay for this order.
if ( ! current_user_can( 'pay_for_order', $order_id ) && ! is_user_logged_in() ) {
echo '<div class="woocommerce-info">' . __( 'Please log in to your account below to continue to the payment form.', 'woocommerce' ) . '</div>';
woocommerce_login_form( array(
'redirect' => $order->get_checkout_payment_url(),
) );
return;
}
// Logged out customer does not have permission to pay for this order.
} elseif ( ! current_user_can( 'pay_for_order', $order_id ) && ! is_user_logged_in() ) {
echo '<div class="woocommerce-info">' . __( 'Please log in to your account below to continue to the payment form.', 'woocommerce' ) . '</div>';
woocommerce_login_form( array(
'redirect' => $order->get_checkout_payment_url(),
) );
return;
// Logged in customer trying to pay for someone else's order.
if ( ! current_user_can( 'pay_for_order', $order_id ) ) {
throw new Exception( __( 'This order cannot be paid for. Please contact us if you need assistance.', 'woocommerce' ) );
}
// Logged in customer trying to pay for someone else's order.
} elseif ( ! current_user_can( 'pay_for_order', $order_id ) ) {
wc_add_notice( __( 'This order cannot be paid for. Please contact us if you need assistance.', 'woocommerce' ), 'error' );
// Does not need payment.
if ( ! $order->needs_payment() ) {
throw new Exception( sprintf( __( 'This order&rsquo;s status is &ldquo;%s&rdquo;&mdash;it cannot be paid for. Please contact us if you need assistance.', 'woocommerce' ), wc_get_order_status_name( $order->get_status() ) ) );
}
// Order does not need to be paid.
} elseif ( ! $order->needs_payment() ) {
wc_add_notice( sprintf( __( 'This order&rsquo;s status is &ldquo;%s&rdquo;&mdash;it cannot be paid for. Please contact us if you need assistance.', 'woocommerce' ), wc_get_order_status_name( $order->get_status() ) ), 'error' );
// Ensure order items are still stocked.
foreach ( $order->get_items() as $item_key => $item ) {
if ( $item && is_callable( array( $item, 'get_product' ) ) ) {
$product = $item->get_product();
// Show payment form.
} else {
if ( $product && ! $product->is_in_stock() ) {
/* translators: %s: product name */
throw new Exception( sprintf( __( 'Sorry, "%s" is no longer in stock so this order cannot be paid for. We apologize for any inconvenience caused.', 'woocommerce' ), $product->get_name() ) );
}
}
}
WC()->customer->set_props( array(
'billing_country' => $order->get_billing_country() ? $order->get_billing_country() : null,
@ -131,6 +143,9 @@ class WC_Shortcode_Checkout {
'available_gateways' => $available_gateways,
'order_button_text' => apply_filters( 'woocommerce_pay_order_button_text', __( 'Pay for order', 'woocommerce' ) ),
) );
} catch ( Exception $e ) {
wc_add_notice( $e->getMessage(), 'error' );
}
} elseif ( $order_id ) {

View File

@ -23,6 +23,7 @@ class WC_Twenty_Seventeen {
add_action( 'woocommerce_before_main_content', array( __CLASS__, 'output_content_wrapper' ), 10 );
add_action( 'woocommerce_after_main_content', array( __CLASS__, 'output_content_wrapper_end' ), 10 );
add_filter( 'woocommerce_enqueue_styles', array( __CLASS__, 'enqueue_styles' ) );
add_filter( 'twentyseventeen_custom_colors_css', array( __CLASS__, 'custom_colors_css' ), 10, 3 );
}
/**
@ -64,6 +65,38 @@ class WC_Twenty_Seventeen {
</div>
<?php
}
/**
* Custom colors.
*
* @param string $css
* @param string $hue
* @param string $saturation
* @return string
*/
public static function custom_colors_css( $css, $hue, $saturation ) {
$css .= '
.colors-custom .select2-container--default .select2-selection--single {
border-color: hsl( ' . $hue . ', ' . $saturation . ', 73% );
}
.colors-custom .select2-container--default .select2-selection__rendered {
color: hsl( ' . $hue . ', ' . $saturation . ', 40% );
}
.colors-custom .select2-container--default .select2-selection--single .select2-selection__arrow b {
border-color: hsl( ' . $hue . ', ' . $saturation . ', 40% ) transparent transparent transparent;
}
.colors-custom .select2-container--focus .select2-selection {
border-color: #000;
}
.colors-custom .select2-container--focus .select2-selection--single .select2-selection__arrow b {
border-color: #000 transparent transparent transparent;
}
.colors-custom .select2-container--focus .select2-selection .select2-selection__rendered {
color: #000;
}
';
return $css;
}
}
WC_Twenty_Seventeen::init();

View File

@ -202,7 +202,7 @@ function wc_get_account_downloads_columns() {
'download-product' => __( 'Product', 'woocommerce' ),
'download-remaining' => __( 'Downloads remaining', 'woocommerce' ),
'download-expires' => __( 'Expires', 'woocommerce' ),
'download-file' => __( 'File', 'woocommerce' ),
'download-file' => __( 'Download', 'woocommerce' ),
'download-actions' => '&nbsp;',
) );

View File

@ -1139,3 +1139,17 @@ function wc_do_oembeds( $content ) {
return $content;
}
/**
* Get part of a string before :.
*
* Used for example in shipping methods ids where they take the format
* method_id:instance_id
*
* @since 3.2.0
* @param string $string
* @return string
*/
function wc_get_string_before_colon( $string ) {
return trim( current( explode( ':', (string) $string ) ) );
}

View File

@ -864,3 +864,146 @@ function wc_sanitize_order_id( $order_id ) {
return filter_var( $order_id, FILTER_SANITIZE_NUMBER_INT );
}
add_filter( 'woocommerce_shortcode_order_tracking_order_id', 'wc_sanitize_order_id' );
/**
* Get an order note.
*
* @since 3.2.0
* @param int|WP_Comment $data Note ID (or WP_Comment instance for internal use only).
* @return stdClass|null Object with order note details or null when does not exists.
*/
function wc_get_order_note( $data ) {
if ( is_numeric( $data ) ) {
$data = get_comment( $data );
}
if ( ! is_a( $data, 'WP_Comment' ) ) {
return null;
}
return (object) apply_filters( 'woocommerce_get_order_note', array(
'id' => (int) $data->comment_ID,
'date_created' => wc_string_to_datetime( $data->comment_date ),
'content' => $data->comment_content,
'customer_note' => (bool) get_comment_meta( $data->comment_ID, 'is_customer_note', true ),
'added_by' => __( 'WooCommerce', 'woocommerce' ) === $data->comment_author ? 'system' : $data->comment_author,
), $data );
}
/**
* Get order notes.
*
* @since 3.2.0
* @param array $args Query arguments {
* Array of query parameters.
*
* @type string $limit Maximum number of notes to retrieve.
* Default empty (no limit).
* @type int $order_id Limit results to those affiliated with a given order ID.
* Default 0.
* @type array $order__in Array of order IDs to include affiliated notes for.
* Default empty.
* @type array $order__not_in Array of order IDs to exclude affiliated notes for.
* Default empty.
* @type string $orderby Define how should sort notes.
* Accepts 'date_created', 'date_created_gmt' or 'id'.
* Default: 'id'.
* @type string $order How to order retrieved notes.
* Accepts 'ASC' or 'DESC'.
* Default: 'DESC'.
* @type string $type Define what type of note should retrieve.
* Accepts 'customer', 'internal' or empty for both.
* Default empty.
* }
* @return stdClass[] Array of stdClass objects with order notes details.
*/
function wc_get_order_notes( $args ) {
$key_mapping = array(
'limit' => 'number',
'order_id' => 'post_id',
'order__in' => 'post__in',
'order__not_in' => 'post__not_in',
);
foreach ( $key_mapping as $query_key => $db_key ) {
if ( isset( $args[ $query_key ] ) ) {
$args[ $db_key ] = $args[ $query_key ];
unset( $args[ $query_key ] );
}
}
// Define orderby.
$orderby_mapping = array(
'date_created' => 'comment_date',
'date_created_gmt' => 'comment_date_gmt',
'id' => 'comment_ID',
);
$args['orderby'] = ! empty( $args['orderby'] ) && in_array( $args['orderby'], array( 'date_created', 'date_created_gmt', 'id' ), true ) ? $orderby_mapping[ $args['orderby'] ] : 'comment_ID';
// Set WooCommerce order type.
if ( isset( $args['type'] ) && 'customer' === $args['type'] ) {
$args['meta_query'] = array(
array(
'key' => 'is_customer_note',
'value' => 1,
'compare' => '=',
),
);
} elseif ( isset( $args['type'] ) && 'internal' === $args['type'] ) {
$args['meta_query'] = array(
array(
'key' => 'is_customer_note',
'compare' => 'NOT EXISTS',
),
);
}
// Set correct comment type.
$args['type'] = 'order_note';
// Always approved.
$args['status'] = 'approve';
// Does not support 'count' or 'fields';
unset( $args['count'], $args['fields'] );
remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );
$notes = get_comments( $args );
add_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );
return array_filter( array_map( 'wc_get_order_note', $notes ) );
}
/**
* Create an order note.
*
* @since 3.2.0
* @param int $order_id Order ID.
* @param string $note Note to add.
* @param bool $is_customer_note Is this a note for the customer?
* @param bool $added_by_user Was the note added by a user?
* @return int|WP_Error Integer when created or WP_Error when found an error.
*/
function wc_create_order_note( $order_id, $note, $is_customer_note = false, $added_by_user = false ) {
$order = wc_get_order( $order_id );
if ( ! $order ) {
return new WP_Error( 'invalid_order_id', __( 'Invalid order ID.', 'woocommerce' ), array( 'status' => 400 ) );
}
return $order->add_order_note( $note, (int) $is_customer_note, $added_by_user );
}
/**
* Delete an order note.
*
* @since 3.2.0
* @param int $note_id Order note.
* @return bool True on success, false on failure.
*/
function wc_delete_order_note( $note_id ) {
return wp_delete_comment( $note_id, true );
}

View File

@ -376,8 +376,6 @@ function wc_get_formatted_variation( $variation, $flat = false, $include_names =
if ( ! is_wp_error( $term ) && ! empty( $term->name ) ) {
$value = $term->name;
}
} else {
$value = ucwords( str_replace( '-', ' ', $value ) );
}
if ( $include_names ) {
@ -418,18 +416,19 @@ function wc_scheduled_sales() {
$product_ids = $data_store->get_starting_sales();
if ( $product_ids ) {
foreach ( $product_ids as $product_id ) {
$product = wc_get_product( $product_id );
$sale_price = $product->get_sale_price();
if ( $product = wc_get_product( $product_id ) ) {
$sale_price = $product->get_sale_price();
if ( $sale_price ) {
$product->set_price( $sale_price );
$product->set_date_on_sale_from( '' );
} else {
$product->set_date_on_sale_to( '' );
$product->set_date_on_sale_from( '' );
if ( $sale_price ) {
$product->set_price( $sale_price );
$product->set_date_on_sale_from( '' );
} else {
$product->set_date_on_sale_to( '' );
$product->set_date_on_sale_from( '' );
}
$product->save();
}
$product->save();
}
delete_transient( 'wc_products_onsale' );
@ -439,13 +438,14 @@ function wc_scheduled_sales() {
$product_ids = $data_store->get_ending_sales();
if ( $product_ids ) {
foreach ( $product_ids as $product_id ) {
$product = wc_get_product( $product_id );
$regular_price = $product->get_regular_price();
$product->set_price( $regular_price );
$product->set_sale_price( '' );
$product->set_date_on_sale_to( '' );
$product->set_date_on_sale_from( '' );
$product->save();
if ( $product = wc_get_product( $product_id ) ) {
$regular_price = $product->get_regular_price();
$product->set_price( $regular_price );
$product->set_sale_price( '' );
$product->set_date_on_sale_to( '' );
$product->set_date_on_sale_from( '' );
$product->save();
}
}
WC_Cache_Helper::get_transient_version( 'product', true );

View File

@ -1431,7 +1431,7 @@ if ( ! function_exists( 'woocommerce_cross_sell_display' ) ) {
if ( is_checkout() ) {
return;
}
// Get visble cross sells then sort them at random.
// Get visible cross sells then sort them at random.
$cross_sells = array_filter( array_map( 'wc_get_product', WC()->cart->get_cross_sells() ), 'wc_products_array_filter_visible' );
$woocommerce_loop['name'] = 'cross-sells';
$woocommerce_loop['columns'] = apply_filters( 'woocommerce_cross_sells_columns', $columns );
@ -1443,12 +1443,12 @@ if ( ! function_exists( 'woocommerce_cross_sell_display' ) ) {
$cross_sells = $limit > 0 ? array_slice( $cross_sells, 0, $limit ) : $cross_sells;
wc_get_template( 'cart/cross-sells.php', array(
'cross_sells' => $cross_sells,
'cross_sells' => $cross_sells,
// Not used now, but used in previous version of up-sells.php.
'posts_per_page' => $limit,
'orderby' => $orderby,
'columns' => $columns,
'posts_per_page' => $limit,
'orderby' => $orderby,
'columns' => $columns,
) );
}
}
@ -1873,6 +1873,23 @@ if ( ! function_exists( 'woocommerce_order_details_table' ) ) {
}
}
if ( ! function_exists( 'woocommerce_order_downloads_table' ) ) {
/**
* Displays order downloads in a table.
*
* @since 3.2.0
* @param array $downloads
*/
function woocommerce_order_downloads_table( $downloads ) {
if ( ! $downloads ) {
return;
}
wc_get_template( 'order/order-downloads.php', array(
'downloads' => $downloads,
) );
}
}
if ( ! function_exists( 'woocommerce_order_again_button' ) ) {

View File

@ -249,6 +249,13 @@ add_action( 'woocommerce_view_order', 'woocommerce_order_details_table', 10 );
add_action( 'woocommerce_thankyou', 'woocommerce_order_details_table', 10 );
add_action( 'woocommerce_order_details_after_order_table', 'woocommerce_order_again_button' );
/**
* Order downloads.
*
* @see woocommerce_order_downloads_table()
*/
add_action( 'woocommerce_available_downloads', 'woocommerce_order_downloads_table', 10 );
/**
* Auth.
*

View File

@ -411,7 +411,7 @@ function wc_get_customer_available_downloads( $customer_id ) {
// Download name will be 'Product Name' for products with a single downloadable file, and 'Product Name - File X' for products with multiple files.
$download_name = apply_filters(
'woocommerce_downloadable_product_name',
$_product->get_name() . ' &ndash; ' . $download_file['name'],
$download_file['name'],
$_product,
$result->download_id,
$file_number

View File

@ -273,15 +273,15 @@ class WC_Widget_Layered_Nav extends WC_Widget {
echo '</form>';
wc_enqueue_js( "
// Submit form on change if standard dropdown.
jQuery( '.dropdown_layered_nav_" . esc_js( $taxonomy_filter_name ) . ":not([multiple])' ).change( function() {
jQuery( this ).closest( 'form' ).submit();
});
// Update value on change.
jQuery( '.dropdown_layered_nav_" . esc_js( $taxonomy_filter_name ) . "' ).change( function() {
var slug = jQuery( this ).val();
jQuery( ':input[name=\"filter_" . esc_js( $taxonomy_filter_name ) . "\"]' ).val( slug );
// Submit form on change if standard dropdown.
if ( ! jQuery( this ).attr( 'multiple' ) ) {
jQuery( this ).closest( 'form' ).submit();
}
});
// Use Select2 enhancement if possible

View File

@ -15,7 +15,7 @@
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 3.1.0
* @version 3.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
@ -42,10 +42,11 @@ do_action( 'woocommerce_before_mini_cart' ); ?>
<li class="woocommerce-mini-cart-item <?php echo esc_attr( apply_filters( 'woocommerce_mini_cart_item_class', 'mini_cart_item', $cart_item, $cart_item_key ) ); ?>">
<?php
echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf(
'<a href="%s" class="remove" aria-label="%s" data-product_id="%s" data-product_sku="%s">&times;</a>',
'<a href="%s" class="remove remove_from_cart_button" aria-label="%s" data-product_id="%s" data-cart_item_key="%s" data-product_sku="%s">&times;</a>',
esc_url( WC()->cart->get_remove_url( $cart_item_key ) ),
__( 'Remove this item', 'woocommerce' ),
esc_attr( $product_id ),
esc_attr( $cart_item_key ),
esc_attr( $_product->get_sku() )
), $cart_item_key );
?>

View File

@ -13,7 +13,7 @@
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 3.0.0
* @version 3.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -52,18 +52,23 @@ if ( ! defined( 'ABSPATH' ) ) {
<strong><?php echo wc_format_datetime( $order->get_date_created() ); ?></strong>
</li>
<?php if ( is_user_logged_in() && $order->get_user_id() === get_current_user_id() && $order->get_billing_email() ) : ?>
<li class="woocommerce-order-overview__total total">
<?php _e( 'Email:', 'woocommerce' ); ?>
<strong><?php echo $order->get_billing_email(); ?></strong>
</li>
<?php endif; ?>
<li class="woocommerce-order-overview__total total">
<?php _e( 'Total:', 'woocommerce' ); ?>
<strong><?php echo $order->get_formatted_order_total(); ?></strong>
</li>
<?php if ( $order->get_payment_method_title() ) : ?>
<li class="woocommerce-order-overview__payment-method method">
<?php _e( 'Payment method:', 'woocommerce' ); ?>
<strong><?php echo wp_kses_post( $order->get_payment_method_title() ); ?></strong>
</li>
<li class="woocommerce-order-overview__payment-method method">
<?php _e( 'Payment method:', 'woocommerce' ); ?>
<strong><?php echo wp_kses_post( $order->get_payment_method_title() ); ?></strong>
</li>
<?php endif; ?>
</ul>

View File

@ -13,7 +13,7 @@
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates/Emails
* @version 3.0.0
* @version 3.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -22,18 +22,23 @@ if ( ! defined( 'ABSPATH' ) ) {
$text_align = is_rtl() ? 'right' : 'left';
?><table id="addresses" cellspacing="0" cellpadding="0" style="width: 100%; vertical-align: top;" border="0">
?><table id="addresses" cellspacing="0" cellpadding="0" style="width: 100%; vertical-align: top; margin-bottom: 40px; padding:0;" border="0">
<tr>
<td class="td" style="text-align:<?php echo $text_align; ?>; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" valign="top" width="50%">
<h3><?php _e( 'Billing address', 'woocommerce' ); ?></h3>
<td style="text-align:<?php echo $text_align; ?>; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; border:0; padding:0;" valign="top" width="50%">
<h2><?php _e( 'Billing address', 'woocommerce' ); ?></h2>
<p class="text"><?php echo $order->get_formatted_billing_address(); ?></p>
<address class="address">
<?php echo ( $address = $order->get_formatted_billing_address() ) ? $address : __( 'N/A', 'woocommerce' ); ?>
<?php if ( $order->get_billing_phone() ) : ?>
<p><?php echo esc_html( $order->get_billing_phone() ); ?></p>
<?php endif; ?>
</address>
</td>
<?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && ( $shipping = $order->get_formatted_shipping_address() ) ) : ?>
<td class="td" style="text-align:<?php echo $text_align; ?>; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" valign="top" width="50%">
<h3><?php _e( 'Shipping address', 'woocommerce' ); ?></h3>
<td style="text-align:<?php echo $text_align; ?>; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; padding:0;" valign="top" width="50%">
<h2><?php _e( 'Shipping address', 'woocommerce' ); ?></h2>
<p class="text"><?php echo $shipping; ?></p>
<address class="address"><?php echo $shipping; ?></address>
</td>
<?php endif; ?>
</tr>

View File

@ -24,10 +24,12 @@ if ( ! defined( 'ABSPATH' ) ) {
?>
<?php if ( ! empty( $fields ) ) : ?>
<h2><?php _e( 'Customer details', 'woocommerce' ); ?></h2>
<ul>
<?php foreach ( $fields as $field ) : ?>
<li><strong><?php echo wp_kses_post( $field['label'] ); ?>:</strong> <span class="text"><?php echo wp_kses_post( $field['value'] ); ?></span></li>
<?php endforeach; ?>
</ul>
<div style="font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; margin-bottom: 40px;">
<h2><?php _e( 'Customer details', 'woocommerce' ); ?></h2>
<ul>
<?php foreach ( $fields as $field ) : ?>
<li><strong><?php echo wp_kses_post( $field['label'] ); ?>:</strong> <span class="text"><?php echo wp_kses_post( $field['value'] ); ?></span></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>

View File

@ -0,0 +1,63 @@
<?php
/**
* Email Downloads.
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/email-downloads.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 3.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<h2 class="woocommerce-order-downloads__title"><?php _e( 'Downloads', 'woocommerce' ); ?></h2>
<table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; margin-bottom: 40px;" border="1">
<thead>
<tr>
<?php foreach ( $columns as $column_id => $column_name ) : ?>
<th class="td" scope="col" style="text-align:<?php echo $text_align; ?>;"><?php echo esc_html( $column_name ); ?></th>
<?php endforeach; ?>
</tr>
</thead>
<?php foreach ( $downloads as $download ) : ?>
<tr>
<?php foreach ( $columns as $column_id => $column_name ) : ?>
<td class="td" style="text-align:<?php echo $text_align; ?>;"><?php
if ( has_action( 'woocommerce_email_downloads_column_' . $column_id ) ) {
do_action( 'woocommerce_email_downloads_column_' . $column_id, $download );
} else {
switch ( $column_id ) {
case 'download-product' : ?>
<a href="<?php echo esc_url( get_permalink( $download['product_id'] ) ); ?>"><?php echo esc_html( $download['product_name'] ); ?></a>
<?php
break;
case 'download-file' : ?>
<a href="<?php echo esc_url( $download['download_url'] ); ?>" class="woocommerce-MyAccount-downloads-file button alt"><?php echo esc_html( $download['download_name'] ); ?></a>
<?php
break;
case 'download-expires' : ?>
<?php if ( ! empty( $download['access_expires'] ) ) : ?>
<time datetime="<?php echo date( 'Y-m-d', strtotime( $download['access_expires'] ) ); ?>" title="<?php echo esc_attr( strtotime( $download['access_expires'] ) ); ?>"><?php echo date_i18n( get_option( 'date_format' ), strtotime( $download['access_expires'] ) ); ?></time>
<?php else : ?>
<?php _e( 'Never', 'woocommerce' ); ?>
<?php endif;
break;
}
}
?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</table>

View File

@ -13,7 +13,7 @@
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates/Emails
* @version 3.0.0
* @version 3.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -24,13 +24,9 @@ $text_align = is_rtl() ? 'right' : 'left';
do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text, $email ); ?>
<?php if ( ! $sent_to_admin ) : ?>
<h2><?php printf( __( 'Order #%s', 'woocommerce' ), $order->get_order_number() ); ?></h2>
<?php else : ?>
<h2><a class="link" href="<?php echo esc_url( admin_url( 'post.php?post=' . $order->get_id() . '&action=edit' ) ); ?>"><?php printf( __( 'Order #%s', 'woocommerce' ), $order->get_order_number() ); ?></a> (<?php printf( '<time datetime="%s">%s</time>', $order->get_date_created()->format( 'c' ), wc_format_datetime( $order->get_date_created() ) ); ?>)</h2>
<?php endif; ?>
<h2><?php _e( 'Order details', 'woocommerce' ); ?></h2>
<table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" border="1">
<table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; margin-bottom: 40px;" border="1">
<thead>
<tr>
<th class="td" scope="col" style="text-align:<?php echo $text_align; ?>;"><?php _e( 'Product', 'woocommerce' ); ?></th>
@ -59,6 +55,12 @@ do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plai
</tr><?php
}
}
if ( $order->get_customer_note() ) {
?><tr>
<th class="td" scope="row" colspan="2" style="text-align:<?php echo $text_align; ?>;"><?php _e( 'Note:', 'woocommerce' ); ?></th>
<td class="td" style="text-align:<?php echo $text_align; ?>;"><?php echo wptexturize( $order->get_customer_note() ); ?></td>
</tr><?php
}
?>
</tfoot>
</table>

View File

@ -13,7 +13,7 @@
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates/Emails
* @version 3.0.0
* @version 3.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -47,10 +47,6 @@ foreach ( $items as $item_id => $item ) :
wc_display_item_meta( $item );
if ( $show_download_links ) {
wc_display_item_downloads( $item );
}
// allow other plugins to add additional product information here
do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );

View File

@ -130,6 +130,12 @@ $text_lighter_20 = wc_hex_lighter( $text, 20 );
border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>;
}
.address {
padding:12px 12px 0;
color: <?php echo esc_attr( $text_lighter_20 ); ?>;
border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>;
}
.text {
color: <?php echo esc_attr( $text ); ?>;
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
@ -163,7 +169,7 @@ h2 {
font-size: 18px;
font-weight: bold;
line-height: 130%;
margin: 16px 0 8px;
margin: 0 0 18px;
text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>;
}

View File

@ -13,7 +13,7 @@
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates/Emails/Plain
* @version 2.2.0
* @version 3.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -23,6 +23,10 @@ if ( ! defined( 'ABSPATH' ) ) {
echo "\n" . strtoupper( __( 'Billing address', 'woocommerce' ) ) . "\n\n";
echo preg_replace( '#<br\s*/?>#i', "\n", $order->get_formatted_billing_address() ) . "\n";
if ( $order->get_billing_phone() ) {
echo $order->get_billing_phone() . "\n";
}
if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && ( $shipping = $order->get_formatted_shipping_address() ) ) {
echo "\n" . strtoupper( __( 'Shipping address', 'woocommerce' ) ) . "\n\n";
echo preg_replace( '#<br\s*/?>#i', "\n", $shipping ) . "\n";

View File

@ -0,0 +1,53 @@
<?php
/**
* Email Downloads.
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-downloads.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 3.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
echo strtoupper( __( 'Downloads', 'woocommerce' ) ) . "\n\n";
foreach ( $downloads as $download ) {
foreach ( $columns as $column_id => $column_name ) {
echo $column_name . ": ";
if ( has_action( 'woocommerce_email_downloads_column_' . $column_id ) ) {
do_action( 'woocommerce_email_downloads_column_' . $column_id, $download );
} else {
switch ( $column_id ) {
case 'download-product' :
echo esc_html( $download['product_name'] );
break;
case 'download-file' :
echo esc_html( $download['download_name'] ) . ' - ' . esc_url( $download['download_url'] );
break;
case 'download-expires' :
if ( ! empty( $download['access_expires'] ) ) {
echo date_i18n( get_option( 'date_format' ), strtotime( $download['access_expires'] ) );
} else {
_e( 'Never', 'woocommerce' );
}
break;
}
}
echo "\n";
}
echo "\n";
}
echo '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=';
echo "\n\n";

View File

@ -13,7 +13,7 @@
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates/Emails
* @version 2.5.0
* @version 3.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -40,6 +40,10 @@ if ( $totals = $order->get_order_item_totals() ) {
}
}
if ( $order->get_customer_note() ) {
echo __( 'Note:', 'woocommerce' ) . "\t " . wptexturize( $order->get_customer_note() ) . "\n";
}
if ( $sent_to_admin ) {
echo "\n" . sprintf( __( 'View order: %s', 'woocommerce' ), admin_url( 'post.php?post=' . $order->get_id() . '&action=edit' ) ) . "\n";
}

View File

@ -13,7 +13,7 @@
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates/Emails/Plain
* @version 3.0.0
* @version 3.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -29,6 +29,7 @@ foreach ( $items as $item_id => $item ) :
}
echo ' X ' . apply_filters( 'woocommerce_email_order_item_quantity', $item->get_quantity(), $item );
echo ' = ' . $order->get_formatted_line_subtotal( $item ) . "\n";
// allow other plugins to add additional product information here
do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text );
echo strip_tags( wc_display_item_meta( $item, array(
@ -38,15 +39,7 @@ foreach ( $items as $item_id => $item ) :
'echo' => false,
'autop' => false,
) ) );
if ( $show_download_links ) {
echo strip_tags( wc_display_item_downloads( $item, array(
'before' => "\n- ",
'separator' => "\n- ",
'after' => "",
'echo' => false,
'show_url' => true,
) ) );
}
// allow other plugins to add additional product information here
do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );
}

View File

@ -15,7 +15,7 @@
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 3.0.0
* @version 3.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -31,67 +31,10 @@ do_action( 'woocommerce_before_account_downloads', $has_downloads ); ?>
<?php do_action( 'woocommerce_before_available_downloads' ); ?>
<table class="woocommerce-MyAccount-downloads shop_table shop_table_responsive">
<thead>
<tr>
<?php foreach ( wc_get_account_downloads_columns() as $column_id => $column_name ) : ?>
<th class="<?php echo esc_attr( $column_id ); ?>"><span class="nobr"><?php echo esc_html( $column_name ); ?></span></th>
<?php endforeach; ?>
</tr>
</thead>
<?php foreach ( $downloads as $download ) : ?>
<tr>
<?php foreach ( wc_get_account_downloads_columns() as $column_id => $column_name ) : ?>
<td class="<?php echo esc_attr( $column_id ); ?>" data-title="<?php echo esc_attr( $column_name ); ?>">
<?php
if ( has_action( 'woocommerce_account_downloads_column_' . $column_id ) ) {
do_action( 'woocommerce_account_downloads_column_' . $column_id, $download );
} else {
switch ( $column_id ) {
case 'download-product' : ?>
<a href="<?php echo esc_url( get_permalink( $download['product_id'] ) ); ?>">
<?php echo esc_html( $download['product_name'] ); ?>
</a>
<?php break;
case 'download-file' : ?>
<a href="<?php echo esc_url( $download['download_url'] ); ?>" class="woocommerce-MyAccount-downloads-file">
<?php echo esc_html( $download['file']['name'] ); ?>
</a>
<?php break;
case 'download-remaining' :
echo is_numeric( $download['downloads_remaining'] ) ? esc_html( $download['downloads_remaining'] ) : __( '&infin;', 'woocommerce' );
break;
case 'download-expires' : ?>
<?php if ( ! empty( $download['access_expires'] ) ) : ?>
<time datetime="<?php echo date( 'Y-m-d', strtotime( $download['access_expires'] ) ); ?>" title="<?php echo esc_attr( strtotime( $download['access_expires'] ) ); ?>"><?php echo date_i18n( get_option( 'date_format' ), strtotime( $download['access_expires'] ) ); ?></time>
<?php else : ?>
<?php _e( 'Never', 'woocommerce' ); ?>
<?php endif; ?>
<?php break;
case 'download-actions' : ?>
<?php
$actions = array(
'download' => array(
'url' => $download['download_url'],
'name' => __( 'Download', 'woocommerce' ),
),
);
if ( $actions = apply_filters( 'woocommerce_account_download_actions', $actions, $download ) ) {
foreach ( $actions as $key => $action ) {
echo '<a href="' . esc_url( $action['url'] ) . '" class="button woocommerce-Button ' . sanitize_html_class( $key ) . '">' . esc_html( $action['name'] ) . '</a>';
}
}
?>
<?php break;
}
}
?>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</table>
<?php do_action( 'woocommerce_available_downloads', $downloads ); ?>
<?php do_action( 'woocommerce_after_available_downloads' ); ?>
<?php else : ?>
<div class="woocommerce-Message woocommerce-Message--info woocommerce-info">
<a class="woocommerce-Button button" href="<?php echo esc_url( apply_filters( 'woocommerce_return_to_shop_redirect', wc_get_page_permalink( 'shop' ) ) ); ?>">

View File

@ -13,74 +13,50 @@
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 3.0.0
* @version 3.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<section class="woocommerce-customer-details">
<h2><?php _e( 'Customer details', 'woocommerce' ); ?></h2>
<table class="woocommerce-table woocommerce-table--customer-details shop_table customer_details">
<?php if ( $order->get_customer_note() ) : ?>
<tr>
<th><?php _e( 'Note:', 'woocommerce' ); ?></th>
<td><?php echo wptexturize( $order->get_customer_note() ); ?></td>
</tr>
<?php endif; ?>
<?php if ( $order->get_billing_email() ) : ?>
<tr>
<th><?php _e( 'Email:', 'woocommerce' ); ?></th>
<td><?php echo esc_html( $order->get_billing_email() ); ?></td>
</tr>
<?php endif; ?>
<?php if ( $order->get_billing_phone() ) : ?>
<tr>
<th><?php _e( 'Phone:', 'woocommerce' ); ?></th>
<td><?php echo esc_html( $order->get_billing_phone() ); ?></td>
</tr>
<?php endif; ?>
<?php do_action( 'woocommerce_order_details_after_customer_details', $order ); ?>
</table>
<?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() ) : ?>
<section class="woocommerce-columns woocommerce-columns--2 woocommerce-columns--addresses col2-set addresses">
<section class="woocommerce-columns woocommerce-columns--2 woocommerce-columns--addresses col2-set addresses">
<div class="woocommerce-column woocommerce-column--1 woocommerce-column--billing-address col-1">
<div class="woocommerce-column woocommerce-column--1 woocommerce-column--billing-address col-1">
<?php endif; ?>
<?php endif; ?>
<h3 class="woocommerce-column__title"><?php _e( 'Billing address', 'woocommerce' ); ?></h3>
<h2 class="woocommerce-column__title"><?php _e( 'Billing address', 'woocommerce' ); ?></h2>
<address>
<?php echo ( $address = $order->get_formatted_billing_address() ) ? $address : __( 'N/A', 'woocommerce' ); ?>
</address>
<address>
<?php echo ( $address = $order->get_formatted_billing_address() ) ? $address : __( 'N/A', 'woocommerce' ); ?>
<?php if ( $order->get_billing_phone() ) : ?>
<p class="woocommerce-customer-details--phone"><?php echo esc_html( $order->get_billing_phone() ); ?></p>
<?php endif; ?>
<?php if ( $order->get_billing_email() ) : ?>
<p class="woocommerce-customer-details--email"><?php echo esc_html( $order->get_billing_email() ); ?></p>
<?php endif; ?>
</address>
<?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() ) : ?>
<?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() ) : ?>
</div><!-- /.col-1 -->
</div><!-- /.col-1 -->
<div class="woocommerce-column woocommerce-column--2 woocommerce-column--shipping-address col-2">
<div class="woocommerce-column woocommerce-column--2 woocommerce-column--shipping-address col-2">
<h3 class="woocommerce-column__title"><?php _e( 'Shipping address', 'woocommerce' ); ?></h3>
<h2 class="woocommerce-column__title"><?php _e( 'Shipping address', 'woocommerce' ); ?></h2>
<address>
<?php echo ( $address = $order->get_formatted_shipping_address() ) ? $address : __( 'N/A', 'woocommerce' ); ?>
</address>
<address>
<?php echo ( $address = $order->get_formatted_shipping_address() ) ? $address : __( 'N/A', 'woocommerce' ); ?>
</address>
</div><!-- /.col-2 -->
</div><!-- /.col-2 -->
</section><!-- /.col2-set -->
</section><!-- /.col2-set -->
<?php endif; ?>

View File

@ -37,7 +37,6 @@ if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) {
do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order );
wc_display_item_meta( $item );
wc_display_item_downloads( $item );
do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order );
?>

View File

@ -13,23 +13,27 @@
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 3.0.0
* @version 3.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! $order = wc_get_order( $order_id ) ) {
return;
}
$order_items = $order->get_items( apply_filters( 'woocommerce_purchase_order_item_types', 'line_item' ) );
$show_purchase_note = $order->has_status( apply_filters( 'woocommerce_purchase_note_order_statuses', array( 'completed', 'processing' ) ) );
$show_customer_details = is_user_logged_in() && $order->get_user_id() === get_current_user_id();
$downloads = $order->get_downloadable_items();
$show_downloads = $order->has_downloadable_item() && $order->is_download_permitted();
if ( $show_downloads ) {
wc_get_template( 'order/order-downloads.php', array( 'downloads' => $downloads, 'show_title' => true ) );
}
?>
<section class="woocommerce-order-details">
<h2 class="woocommerce-order-details__title"><?php _e( 'Order details', 'woocommerce' ); ?></h2>
<table class="woocommerce-table woocommerce-table--order-details shop_table order_details">
@ -70,14 +74,19 @@ $show_customer_details = is_user_logged_in() && $order->get_user_id() === get_cu
<?php
}
?>
<?php if ( $order->get_customer_note() ) : ?>
<tr>
<th><?php _e( 'Note:', 'woocommerce' ); ?></th>
<td><?php echo wptexturize( $order->get_customer_note() ); ?></td>
</tr>
<?php endif; ?>
</tfoot>
</table>
<?php do_action( 'woocommerce_order_details_after_order_table', $order ); ?>
<?php if ( $show_customer_details ) : ?>
<?php wc_get_template( 'order/order-details-customer.php', array( 'order' => $order ) ); ?>
<?php endif; ?>
</section>
<?php
if ( $show_customer_details ) {
wc_get_template( 'order/order-details-customer.php', array( 'order' => $order ) );
}

View File

@ -0,0 +1,70 @@
<?php
/**
* Order Downloads.
*
* This template can be overridden by copying it to yourtheme/woocommerce/order/order-downloads.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 3.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<section class="woocommerce-order-downloads">
<?php if ( isset( $show_title ) ) : ?>
<h2 class="woocommerce-order-downloads__title"><?php _e( 'Downloads', 'woocommerce' ); ?></h2>
<?php endif; ?>
<table class="woocommerce-table woocommerce-table--order-downloads shop_table order_details">
<thead>
<tr>
<?php foreach ( wc_get_account_downloads_columns() as $column_id => $column_name ) : ?>
<th class="<?php echo esc_attr( $column_id ); ?>"><span class="nobr"><?php echo esc_html( $column_name ); ?></span></th>
<?php endforeach; ?>
</tr>
</thead>
<?php foreach ( $downloads as $download ) : ?>
<tr>
<?php foreach ( wc_get_account_downloads_columns() as $column_id => $column_name ) : ?>
<td class="<?php echo esc_attr( $column_id ); ?>" data-title="<?php echo esc_attr( $column_name ); ?>"><?php
if ( has_action( 'woocommerce_account_downloads_column_' . $column_id ) ) {
do_action( 'woocommerce_account_downloads_column_' . $column_id, $download );
} else {
switch ( $column_id ) {
case 'download-product' : ?>
<a href="<?php echo esc_url( get_permalink( $download['product_id'] ) ); ?>"><?php echo esc_html( $download['product_name'] ); ?></a>
<?php
break;
case 'download-file' : ?>
<a href="<?php echo esc_url( $download['download_url'] ); ?>" class="woocommerce-MyAccount-downloads-file button alt"><?php echo esc_html( $download['download_name'] ); ?></a>
<?php
break;
case 'download-remaining' :
echo is_numeric( $download['downloads_remaining'] ) ? esc_html( $download['downloads_remaining'] ) : __( '&infin;', 'woocommerce' );
break;
case 'download-expires' : ?>
<?php if ( ! empty( $download['access_expires'] ) ) : ?>
<time datetime="<?php echo date( 'Y-m-d', strtotime( $download['access_expires'] ) ); ?>" title="<?php echo esc_attr( strtotime( $download['access_expires'] ) ); ?>"><?php echo date_i18n( get_option( 'date_format' ), strtotime( $download['access_expires'] ) ); ?></time>
<?php else : ?>
<?php _e( 'Never', 'woocommerce' ); ?>
<?php endif;
break;
}
}
?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</table>
</section>

View File

@ -44,7 +44,7 @@ class WC_Tests_Account_Functions extends WC_Unit_Test_Case {
*/
public function test_wc_get_account_downloads_columns() {
$this->assertEquals( array(
'download-file' => 'File',
'download-file' => 'Download',
'download-remaining' => 'Downloads remaining',
'download-expires' => 'Expires',
'download-product' => 'Product',

View File

@ -73,7 +73,7 @@ class WC_Tests_API_Functions extends WC_Unit_Test_Case {
* @since 2.6.0
*/
public function test_wc_rest_check_post_permissions() {
$this->isFalse( wc_rest_check_post_permissions( 'shop_order' ) );
$this->assertFalse( wc_rest_check_post_permissions( 'shop_order' ) );
}
/**
@ -82,7 +82,7 @@ class WC_Tests_API_Functions extends WC_Unit_Test_Case {
* @since 2.6.0
*/
public function test_wc_rest_check_user_permissions() {
$this->isFalse( wc_rest_check_user_permissions() );
$this->assertFalse( wc_rest_check_user_permissions() );
}
/**
@ -91,7 +91,7 @@ class WC_Tests_API_Functions extends WC_Unit_Test_Case {
* @since 2.6.0
*/
public function test_wc_rest_check_product_term_permissions() {
$this->isFalse( wc_rest_check_product_term_permissions( 'product_cat' ) );
$this->assertFalse( wc_rest_check_product_term_permissions( 'product_cat' ) );
}
/**
@ -100,6 +100,6 @@ class WC_Tests_API_Functions extends WC_Unit_Test_Case {
* @since 2.6.0
*/
public function test_wc_rest_check_manager_permissions() {
$this->isFalse( wc_rest_check_manager_permissions( 'reports' ) );
$this->assertFalse( wc_rest_check_manager_permissions( 'reports' ) );
}
}

View File

@ -184,7 +184,7 @@ class WC_Tests_REST_System_Status extends WC_REST_Unit_Test_Case {
$response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/system_status' ) );
$data = $response->get_data();
$pages = $data['pages'];
$this->assertEquals( 4, count( $pages ) );
$this->assertEquals( 5, count( $pages ) );
}
/**

View File

@ -842,4 +842,70 @@ class WC_Tests_Order_Functions extends WC_Unit_Test_Case {
$expected = array( $order2_id );
$this->assertEquals( $expected, $orders );
}
/**
* Test wc_get_order_note().
*
* @since 3.2.0
*/
public function test_wc_get_order_note() {
$note_content = 'Note content';
$order = WC_Helper_Order::create_order();
$note_id = (int) $order->add_order_note( $note_content );
$expected = array(
'id' => $note_id,
'content' => $note_content,
'customer_note' => false,
'added_by' => 'system',
);
$note = (array) wc_get_order_note( $note_id );
unset( $note['date_created'] );
$this->assertEquals( $expected, $note );
}
/**
* Test wc_get_order_notes().
*
* @since 3.2.0
*/
public function test_wc_get_order_notes() {
$order = WC_Helper_Order::create_order();
$order->add_order_note( 'Customer note', 1 );
$order->add_order_note( 'Internal note' );
$order->add_order_note( 'Another internal note' );
$notes = wc_get_order_notes( array( 'order_id' => $order->get_id() ) );
$this->assertEquals( 3, count( $notes ) );
$notes = wc_get_order_notes( array( 'order_id' => $order->get_id(), 'type' => 'customer' ) );
$this->assertEquals( 1, count( $notes ) );
$notes = wc_get_order_notes( array( 'order_id' => $order->get_id(), 'type' => 'internal' ) );
$this->assertEquals( 2, count( $notes ) );
}
/**
* Test wc_create_order_note().
*
* @since 3.2.0
*/
public function test_wc_create_order_note() {
$order = WC_Helper_Order::create_order();
$note_id = wc_create_order_note( $order->get_id(), 'Note content', false, false );
$this->assertTrue( 0 < $note_id );
}
/**
* Test wc_delete_order_note().
*
* @since 3.2.0
*/
public function test_wc_delete_order_note() {
$order = WC_Helper_Order::create_order();
$note_id = $order->add_order_note( 'Note content' );
$this->assertTrue( wc_delete_order_note( $note_id ) );
}
}

View File

@ -449,17 +449,17 @@ class WC_Tests_Product_Data_Store extends WC_Unit_Test_Case {
$one_attribute_variation = new WC_Product_Variation;
$one_attribute_variation->set_parent_id( $product->get_id() );
$one_attribute_variation->set_attributes( array( 'color' => 'green' ) );
$one_attribute_variation->set_attributes( array( 'color' => 'Green' ) );
$one_attribute_variation->save();
$two_attribute_variation = new WC_Product_Variation;
$two_attribute_variation->set_parent_id( $product->get_id() );
$two_attribute_variation->set_attributes( array( 'color' => 'green', 'size' => 'large' ) );
$two_attribute_variation->set_attributes( array( 'color' => 'Green', 'size' => 'Large' ) );
$two_attribute_variation->save();
$multiword_attribute_variation = new WC_Product_Variation;
$multiword_attribute_variation->set_parent_id( $product->get_id() );
$multiword_attribute_variation->set_attributes( array( 'color' => 'green', 'mounting-plate' => 'galaxy-s6', 'support' => 'one-year' ) );
$multiword_attribute_variation->set_attributes( array( 'color' => 'Green', 'mounting-plate' => 'galaxy-s6', 'support' => 'one-year' ) );
$multiword_attribute_variation->save();
// Check the one attribute variation title.