Merge remote-tracking branch 'woocommerce/master'

This commit is contained in:
Alexander Minza 2018-01-10 11:45:34 +02:00
commit dc14abd117
96 changed files with 2140 additions and 1544 deletions

View File

@ -1,4 +1,14 @@
# [WooCommerce](https://woocommerce.com/) [![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/) [![Build Status](https://travis-ci.org/woocommerce/woocommerce.svg?branch=master)](https://travis-ci.org/woocommerce/woocommerce) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/woocommerce/woocommerce/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/woocommerce/woocommerce/?branch=master) [![codecov](https://codecov.io/gh/woocommerce/woocommerce/branch/master/graph/badge.svg)](https://codecov.io/gh/woocommerce/woocommerce)
<p align="center"><a href="https://woocommerce.com/"><img src="https://woocommerce.com/wp-content/themes/woo/images/logo-woocommerce@2x.png" alt="WooCommerce"></a></p>
<p align="center">
<a href="https://packagist.org/packages/woocommerce/woocommerce"><img src="https://poser.pugx.org/woocommerce/woocommerce/license" alt="license"></a>
<a href="https://packagist.org/packages/woocommerce/woocommerce"><img src="https://poser.pugx.org/woocommerce/woocommerce/v/stable" alt="Latest Stable Version"></a>
<img src="https://img.shields.io/wordpress/plugin/dt/woocommerce.svg" alt="WordPress.org downloads">
<img src="https://img.shields.io/wordpress/plugin/r/woocommerce.svg" alt="WordPress.org rating">
<a href="https://travis-ci.org/woocommerce/woocommerce"><img src="https://travis-ci.org/woocommerce/woocommerce.svg?branch=master" alt="Build Status"></a>
<a href="https://scrutinizer-ci.com/g/woocommerce/woocommerce/?branch=master"><img src="https://scrutinizer-ci.com/g/woocommerce/woocommerce/badges/quality-score.png?b=master" alt="Scrutinizer Code Quality"></a>
<a href="https://codecov.io/gh/woocommerce/woocommerce"><img src="https://codecov.io/gh/woocommerce/woocommerce/branch/master/graph/badge.svg" alt="codecov"></a>
</p>
Welcome to the WooCommerce repository on GitHub. Here you can browse the source, look at open issues and keep track of development. We recommend all developers to follow the [WooCommerce development blog](https://woocommerce.wordpress.com/) to stay up to date about everything happening in the project. You can also [follow @DevelopWC](https://twitter.com/DevelopWC) on Twitter for the latest development updates.

View File

@ -179,7 +179,6 @@
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
margin: 0;
text-indent: 0;
position: absolute;

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 .button-primary,p.woocommerce-actions .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 .button-primary:active,.woocommerce-message .button-primary:focus,.woocommerce-message .button-primary:hover,p.woocommerce-actions .button-primary:active,p.woocommerce-actions .button-primary:focus,p.woocommerce-actions .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 .button-primary,.woocommerce-message .button-secondary,p.woocommerce-actions .button-primary,p.woocommerce-actions .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 .button-primary,p.woocommerce-actions .button-primary{background:#bb77ae;border-color:#a36597;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;color:#fff;text-shadow:0 -1px 1px #a36597,-1px 0 1px #a36597,0 1px 1px #a36597,1px 0 1px #a36597}.woocommerce-message .button-primary:active,.woocommerce-message .button-primary:focus,.woocommerce-message .button-primary:hover,p.woocommerce-actions .button-primary:active,p.woocommerce-actions .button-primary:focus,p.woocommerce-actions .button-primary:hover{background:#a36597;border-color:#a36597;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597}.woocommerce-message 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 .button-primary,.woocommerce-message .button-secondary,p.woocommerce-actions .button-primary,p.woocommerce-actions .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 .button-primary,p.woocommerce-actions .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 .button-primary:active,.woocommerce-message .button-primary:focus,.woocommerce-message .button-primary:hover,p.woocommerce-actions .button-primary:active,p.woocommerce-actions .button-primary:focus,p.woocommerce-actions .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 .button-primary,.woocommerce-message .button-secondary,p.woocommerce-actions .button-primary,p.woocommerce-actions .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 .button-primary,p.woocommerce-actions .button-primary{background:#bb77ae;border-color:#a36597;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;color:#fff;text-shadow:0 -1px 1px #a36597,1px 0 1px #a36597,0 1px 1px #a36597,-1px 0 1px #a36597}.woocommerce-message .button-primary:active,.woocommerce-message .button-primary:focus,.woocommerce-message .button-primary:hover,p.woocommerce-actions .button-primary:active,p.woocommerce-actions .button-primary:focus,p.woocommerce-actions .button-primary:hover{background:#a36597;border-color:#a36597;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597}.woocommerce-message 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 .button-primary,.woocommerce-message .button-secondary,p.woocommerce-actions .button-primary,p.woocommerce-actions .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

@ -1165,7 +1165,6 @@ ul.wc_coupon_list_block {
line-height: 14px;
font-size: 14px;
font-weight: 400;
-webkit-font-smoothing: antialiased;
}
}
a.edit_address::after {
@ -1946,9 +1945,22 @@ ul.wc_coupon_list_block {
padding: 0 !important;
height: 2em !important;
width: 2em;
overflow: hidden;
&::after {
@include icon_dashicons;
font-family: 'Dashicons';
speak: none;
font-weight: normal;
font-variant: normal;
text-transform: none;
margin: 0;
text-indent: 0;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
text-align: center;
line-height: 1.85;
}
@ -2218,6 +2230,7 @@ ul.wc_coupon_list_block {
float: left;
padding: 1.5em;
box-sizing: border-box;
word-wrap: break-word;
h2 {
margin-top: 0;
@ -2497,8 +2510,17 @@ table.wp-list-table {
color: #999;
}
.column-sku {
width: 10%;
}
.column-price {
width: 10ch;
}
.column-is_in_stock {
text-align: left !important;
width: 12ch;
}
span.wc-image,
@ -5110,6 +5132,12 @@ img.ui-datepicker-trigger {
margin-left: 4px;
margin-top: 10px;
}
.description {
margin-left: .5em;
font-weight: normal;
opacity: .8;
}
}
}

View File

@ -1 +1 @@
body{background:#f1f1f1;box-shadow:none;margin:100px auto 24px;padding:0}#wc-logo{border:0;margin:0 0 24px;padding:0;text-align:center}#wc-logo img{max-width:50%}.wc-auth-content{background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.13);overflow:hidden;padding:24px 24px 0;zoom:1}.wc-auth-content h1,.wc-auth-content h2,.wc-auth-content h3,.wc-auth-content table{border:0;clear:none;color:#666;margin:0 0 24px;padding:0}.wc-auth-content p,.wc-auth-content ul{color:#666;font-size:1em;line-height:1.75em;margin:0 0 24px}.wc-auth-content p{padding:0}.wc-auth-content a{color:#a16696}.wc-auth-content a:focus,.wc-auth-content a:hover{color:#111}.wc-auth-content .wc-auth-login label{color:#999;display:block;margin-bottom:.5em}.wc-auth-content .wc-auth-login input{box-sizing:border-box;font-size:1.3em;padding:.5em;width:100%}.wc-auth-content .wc-auth-login .wc-auth-actions{padding:0}.wc-auth-content .wc-auth-login .wc-auth-actions .wc-auth-login-button{float:none;width:100%}.wc-auth-permissions{list-style:disc inside;padding:0}.wc-auth-permissions li{font-size:1em}.wc-auth-logged-in-as{background:#f5f5f5;border-bottom:2px solid #eee;line-height:70px;margin:0 0 24px;padding:0 0 0 1em}.wc-auth-logged-in-as p{margin:0;line-height:70px}.wc-auth-logged-in-as img{float:right;height:70px;margin:0 0 0 1em}.wc-auth-logged-in-as .wc-auth-logout{float:left}.wc-auth .wc-auth-actions{overflow:hidden;padding-right:24px}.wc-auth .wc-auth-actions .button{background:#f7f7f7;border-bottom-width:2px;border:1px solid #d7d7d7;box-sizing:border-box;color:#777;float:left;font-size:1.25em;height:auto;line-height:1em;padding:1em 2em;text-align:center;width:50%}.wc-auth .wc-auth-actions .button:focus,.wc-auth .wc-auth-actions .button:hover{background:#fcfcfc}.wc-auth .wc-auth-actions .button-primary{background:#ad6ea1;border-color:#a16696;box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 0 rgba(0,0,0,.15);color:#fff;float:left;opacity:1;text-shadow:0 -1px 1px #8a4f7f,-1px 0 1px #8a4f7f,0 1px 1px #8a4f7f,1px 0 1px #8a4f7f}.wc-auth .wc-auth-actions .button-primary:focus,.wc-auth .wc-auth-actions .button-primary:hover{background:#b472a8;color:#fff}.wc-auth .wc-auth-actions .wc-auth-approve{float:left}.wc-auth .wc-auth-actions .wc-auth-deny{float:right;margin-right:-24px}
body{background:#f1f1f1;-webkit-box-shadow:none;box-shadow:none;margin:100px auto 24px;padding:0}#wc-logo{border:0;margin:0 0 24px;padding:0;text-align:center}#wc-logo img{max-width:50%}.wc-auth-content{background:#fff;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.13);box-shadow:0 1px 3px rgba(0,0,0,.13);overflow:hidden;padding:24px 24px 0;zoom:1}.wc-auth-content h1,.wc-auth-content h2,.wc-auth-content h3,.wc-auth-content table{border:0;clear:none;color:#666;margin:0 0 24px;padding:0}.wc-auth-content p,.wc-auth-content ul{color:#666;font-size:1em;line-height:1.75em;margin:0 0 24px}.wc-auth-content p{padding:0}.wc-auth-content a{color:#a16696}.wc-auth-content a:focus,.wc-auth-content a:hover{color:#111}.wc-auth-content .wc-auth-login label{color:#999;display:block;margin-bottom:.5em}.wc-auth-content .wc-auth-login input{-webkit-box-sizing:border-box;box-sizing:border-box;font-size:1.3em;padding:.5em;width:100%}.wc-auth-content .wc-auth-login .wc-auth-actions{padding:0}.wc-auth-content .wc-auth-login .wc-auth-actions .wc-auth-login-button{float:none;width:100%}.wc-auth-permissions{list-style:disc inside;padding:0}.wc-auth-permissions li{font-size:1em}.wc-auth-logged-in-as{background:#f5f5f5;border-bottom:2px solid #eee;line-height:70px;margin:0 0 24px;padding:0 0 0 1em}.wc-auth-logged-in-as p{margin:0;line-height:70px}.wc-auth-logged-in-as img{float:right;height:70px;margin:0 0 0 1em}.wc-auth-logged-in-as .wc-auth-logout{float:left}.wc-auth .wc-auth-actions{overflow:hidden;padding-right:24px}.wc-auth .wc-auth-actions .button{background:#f7f7f7;border-bottom-width:2px;border:1px solid #d7d7d7;-webkit-box-sizing:border-box;box-sizing:border-box;color:#777;float:left;font-size:1.25em;height:auto;line-height:1em;padding:1em 2em;text-align:center;width:50%}.wc-auth .wc-auth-actions .button:focus,.wc-auth .wc-auth-actions .button:hover{background:#fcfcfc}.wc-auth .wc-auth-actions .button-primary{background:#ad6ea1;border-color:#a16696;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 0 rgba(0,0,0,.15);color:#fff;float:left;opacity:1;text-shadow:0 -1px 1px #8a4f7f,-1px 0 1px #8a4f7f,0 1px 1px #8a4f7f,1px 0 1px #8a4f7f}.wc-auth .wc-auth-actions .button-primary:focus,.wc-auth .wc-auth-actions .button-primary:hover{background:#b472a8;color:#fff}.wc-auth .wc-auth-actions .wc-auth-approve{float:left}.wc-auth .wc-auth-actions .wc-auth-deny{float:right;margin-right:-24px}

View File

@ -1 +1 @@
body{background:#f1f1f1;box-shadow:none;margin:100px auto 24px;padding:0}#wc-logo{border:0;margin:0 0 24px;padding:0;text-align:center}#wc-logo img{max-width:50%}.wc-auth-content{background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.13);overflow:hidden;padding:24px 24px 0;zoom:1}.wc-auth-content h1,.wc-auth-content h2,.wc-auth-content h3,.wc-auth-content table{border:0;clear:none;color:#666;margin:0 0 24px;padding:0}.wc-auth-content p,.wc-auth-content ul{color:#666;font-size:1em;line-height:1.75em;margin:0 0 24px}.wc-auth-content p{padding:0}.wc-auth-content a{color:#a16696}.wc-auth-content a:focus,.wc-auth-content a:hover{color:#111}.wc-auth-content .wc-auth-login label{color:#999;display:block;margin-bottom:.5em}.wc-auth-content .wc-auth-login input{box-sizing:border-box;font-size:1.3em;padding:.5em;width:100%}.wc-auth-content .wc-auth-login .wc-auth-actions{padding:0}.wc-auth-content .wc-auth-login .wc-auth-actions .wc-auth-login-button{float:none;width:100%}.wc-auth-permissions{list-style:disc inside;padding:0}.wc-auth-permissions li{font-size:1em}.wc-auth-logged-in-as{background:#f5f5f5;border-bottom:2px solid #eee;line-height:70px;margin:0 0 24px;padding:0 1em 0 0}.wc-auth-logged-in-as p{margin:0;line-height:70px}.wc-auth-logged-in-as img{float:left;height:70px;margin:0 1em 0 0}.wc-auth-logged-in-as .wc-auth-logout{float:right}.wc-auth .wc-auth-actions{overflow:hidden;padding-left:24px}.wc-auth .wc-auth-actions .button{background:#f7f7f7;border-bottom-width:2px;border:1px solid #d7d7d7;box-sizing:border-box;color:#777;float:right;font-size:1.25em;height:auto;line-height:1em;padding:1em 2em;text-align:center;width:50%}.wc-auth .wc-auth-actions .button:focus,.wc-auth .wc-auth-actions .button:hover{background:#fcfcfc}.wc-auth .wc-auth-actions .button-primary{background:#ad6ea1;border-color:#a16696;box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 0 rgba(0,0,0,.15);color:#fff;float:right;opacity:1;text-shadow:0 -1px 1px #8a4f7f,1px 0 1px #8a4f7f,0 1px 1px #8a4f7f,-1px 0 1px #8a4f7f}.wc-auth .wc-auth-actions .button-primary:focus,.wc-auth .wc-auth-actions .button-primary:hover{background:#b472a8;color:#fff}.wc-auth .wc-auth-actions .wc-auth-approve{float:right}.wc-auth .wc-auth-actions .wc-auth-deny{float:left;margin-left:-24px}
body{background:#f1f1f1;-webkit-box-shadow:none;box-shadow:none;margin:100px auto 24px;padding:0}#wc-logo{border:0;margin:0 0 24px;padding:0;text-align:center}#wc-logo img{max-width:50%}.wc-auth-content{background:#fff;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.13);box-shadow:0 1px 3px rgba(0,0,0,.13);overflow:hidden;padding:24px 24px 0;zoom:1}.wc-auth-content h1,.wc-auth-content h2,.wc-auth-content h3,.wc-auth-content table{border:0;clear:none;color:#666;margin:0 0 24px;padding:0}.wc-auth-content p,.wc-auth-content ul{color:#666;font-size:1em;line-height:1.75em;margin:0 0 24px}.wc-auth-content p{padding:0}.wc-auth-content a{color:#a16696}.wc-auth-content a:focus,.wc-auth-content a:hover{color:#111}.wc-auth-content .wc-auth-login label{color:#999;display:block;margin-bottom:.5em}.wc-auth-content .wc-auth-login input{-webkit-box-sizing:border-box;box-sizing:border-box;font-size:1.3em;padding:.5em;width:100%}.wc-auth-content .wc-auth-login .wc-auth-actions{padding:0}.wc-auth-content .wc-auth-login .wc-auth-actions .wc-auth-login-button{float:none;width:100%}.wc-auth-permissions{list-style:disc inside;padding:0}.wc-auth-permissions li{font-size:1em}.wc-auth-logged-in-as{background:#f5f5f5;border-bottom:2px solid #eee;line-height:70px;margin:0 0 24px;padding:0 1em 0 0}.wc-auth-logged-in-as p{margin:0;line-height:70px}.wc-auth-logged-in-as img{float:left;height:70px;margin:0 1em 0 0}.wc-auth-logged-in-as .wc-auth-logout{float:right}.wc-auth .wc-auth-actions{overflow:hidden;padding-left:24px}.wc-auth .wc-auth-actions .button{background:#f7f7f7;border-bottom-width:2px;border:1px solid #d7d7d7;-webkit-box-sizing:border-box;box-sizing:border-box;color:#777;float:right;font-size:1.25em;height:auto;line-height:1em;padding:1em 2em;text-align:center;width:50%}.wc-auth .wc-auth-actions .button:focus,.wc-auth .wc-auth-actions .button:hover{background:#fcfcfc}.wc-auth .wc-auth-actions .button-primary{background:#ad6ea1;border-color:#a16696;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 0 rgba(0,0,0,.15);color:#fff;float:right;opacity:1;text-shadow:0 -1px 1px #8a4f7f,1px 0 1px #8a4f7f,0 1px 1px #8a4f7f,-1px 0 1px #8a4f7f}.wc-auth .wc-auth-actions .button-primary:focus,.wc-auth .wc-auth-actions .button-primary:hover{background:#b472a8;color:#fff}.wc-auth .wc-auth-actions .wc-auth-approve{float:right}.wc-auth .wc-auth-actions .wc-auth-deny{float:left;margin-left:-24px}

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;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;-webkit-box-sizing:border-box;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;-webkit-box-sizing:border-box;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;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;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;-webkit-box-sizing:border-box;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;-webkit-box-sizing:border-box;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;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

@ -65,8 +65,6 @@ span.mce_woocommerce_shortcodes_button {
font: 400 18px/1 dashicons;
speak: none;
margin: 0 8px 0 -2px;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
vertical-align: top;
}

View File

@ -416,7 +416,6 @@ a.pswp__share--download:hover {
*/
/* root element of UI */
.pswp__ui {
-webkit-font-smoothing: auto;
visibility: visible;
opacity: 1;
z-index: 1550; }

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;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}
*{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;-webkit-box-shadow:none!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;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}
*{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;-webkit-box-shadow:none!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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -282,8 +282,6 @@ body {
padding: 0 10px 0 0;
top: 1px;
position: relative;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-decoration: none !important;
vertical-align: top;
}
@ -491,6 +489,7 @@ body {
padding: 0;
border-bottom: 1px solid #eee;
color: #666;
align-items: center;
&:last-child {
border-bottom: 0;
@ -508,7 +507,7 @@ body {
padding: 2em 0;
align-self: stretch;
display: flex;
align-items: center;
align-items: baseline;
justify-content: center;
img {
@ -516,8 +515,13 @@ body {
}
}
&.stripe-logo .wc-wizard-service-name img {
padding: 8px 0;
}
&.paypal-logo .wc-wizard-service-name img {
max-width: 87px;
padding: 2px 0;
}
&.klarna-logo .wc-wizard-service-name {
@ -525,6 +529,7 @@ body {
img {
max-width: 87px;
padding: 12px 0;
}
}
@ -533,12 +538,13 @@ body {
img {
max-width: 95px;
padding: 12px 0;
}
}
.wc-wizard-service-description {
flex-grow: 1;
padding: 2em 20px;
padding: 20px;
p {
margin-bottom: 0;
@ -562,6 +568,8 @@ body {
cursor: pointer;
padding: 2em 0;
position: relative;
max-height: 1.5em;
align-self: flex-start;
}
.wc-wizard-service-toggle {
@ -1036,10 +1044,10 @@ p.jetpack-terms {
}
}
.wc-wizard-service-setting-stripe_email, .wc-wizard-service-setting-ppec_paypal_api_subject {
.wc-wizard-service-setting-stripe_email, .wc-wizard-service-setting-ppec_paypal_email {
margin-top: 0.75em;
label.stripe_email, label.ppec_paypal_api_subject {
label.stripe_email, label.ppec_paypal_email {
position: absolute;
margin: -1px;
padding: 0;

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -518,7 +518,6 @@ p.demo_store,
background-color: $highlight;
color: $highlightext;
font-size: 0.857em;
-webkit-font-smoothing: antialiased;
z-index: 9;
}
@ -695,7 +694,6 @@ p.demo_store,
font-family: 'WooCommerce';
content: '\e01c';
vertical-align: top;
-webkit-font-smoothing: antialiased;
font-weight: 400;
position: absolute;
top: 0.618em;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 27 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -22,16 +22,24 @@
*/
productExportForm.prototype.onSubmit = function( event ) {
event.preventDefault();
var currentDate = new Date(),
day = currentDate.getDate(),
month = currentDate.getMonth() + 1,
year = currentDate.getFullYear(),
timestamp = currentDate.getTime(),
filename = 'wc-product-export-' + day + '-' + month + '-' + year + '-' + timestamp + '.csv';
event.data.productExportForm.$form.addClass( 'woocommerce-exporter__exporting' );
event.data.productExportForm.$form.find('.woocommerce-exporter-progress').val( 0 );
event.data.productExportForm.$form.find('.woocommerce-exporter-button').prop( 'disabled', true );
event.data.productExportForm.processStep( 1, $( this ).serialize(), '' );
event.data.productExportForm.processStep( 1, $( this ).serialize(), '', filename );
};
/**
* Process the current export step.
*/
productExportForm.prototype.processStep = function( step, data, columns ) {
productExportForm.prototype.processStep = function( step, data, columns, filename ) {
var $this = this,
selected_columns = $( '.woocommerce-exporter-columns' ).val(),
export_meta = $( '#woocommerce-exporter-meta:checked' ).length ? 1: 0,
@ -48,6 +56,7 @@
selected_columns : selected_columns,
export_meta : export_meta,
export_types : export_types,
filename : filename,
security : wc_product_export_params.export_nonce
},
dataType: 'json',
@ -62,7 +71,7 @@
}, 2000 );
} else {
$this.$form.find('.woocommerce-exporter-progress').val( response.data.percentage );
$this.processStep( parseInt( response.data.step, 10 ), data, response.data.columns );
$this.processStep( parseInt( response.data.step, 10 ), data, response.data.columns, filename );
}
}

View File

@ -1 +1 @@
!function(o,e){var r=function(o){this.$form=o,this.xhr=!1,this.$form.find(".woocommerce-exporter-progress").val(0),this.processStep=this.processStep.bind(this),o.on("submit",{productExportForm:this},this.onSubmit)};r.prototype.onSubmit=function(e){e.preventDefault(),e.data.productExportForm.$form.addClass("woocommerce-exporter__exporting"),e.data.productExportForm.$form.find(".woocommerce-exporter-progress").val(0),e.data.productExportForm.$form.find(".woocommerce-exporter-button").prop("disabled",!0),e.data.productExportForm.processStep(1,o(this).serialize(),"")},r.prototype.processStep=function(r,t,c){var p=this,s=o(".woocommerce-exporter-columns").val(),a=o("#woocommerce-exporter-meta:checked").length?1:0,m=o(".woocommerce-exporter-types").val();o.ajax({type:"POST",url:ajaxurl,data:{form:t,action:"woocommerce_do_ajax_product_export",step:r,columns:c,selected_columns:s,export_meta:a,export_types:m,security:wc_product_export_params.export_nonce},dataType:"json",success:function(o){o.success&&("done"===o.data.step?(p.$form.find(".woocommerce-exporter-progress").val(o.data.percentage),e.location=o.data.url,setTimeout(function(){p.$form.removeClass("woocommerce-exporter__exporting"),p.$form.find(".woocommerce-exporter-button").prop("disabled",!1)},2e3)):(p.$form.find(".woocommerce-exporter-progress").val(o.data.percentage),p.processStep(parseInt(o.data.step,10),t,o.data.columns)))}}).fail(function(o){e.console.log(o)})},o.fn.wc_product_export_form=function(){return new r(this),this},o(".woocommerce-exporter").wc_product_export_form()}(jQuery,window);
!function(o,e){var r=function(o){this.$form=o,this.xhr=!1,this.$form.find(".woocommerce-exporter-progress").val(0),this.processStep=this.processStep.bind(this),o.on("submit",{productExportForm:this},this.onSubmit)};r.prototype.onSubmit=function(e){e.preventDefault();var r=new Date,t="wc-product-export-"+r.getDate()+"-"+(r.getMonth()+1)+"-"+r.getFullYear()+"-"+r.getTime()+".csv";e.data.productExportForm.$form.addClass("woocommerce-exporter__exporting"),e.data.productExportForm.$form.find(".woocommerce-exporter-progress").val(0),e.data.productExportForm.$form.find(".woocommerce-exporter-button").prop("disabled",!0),e.data.productExportForm.processStep(1,o(this).serialize(),"",t)},r.prototype.processStep=function(r,t,c,p){var s=this,a=o(".woocommerce-exporter-columns").val(),m=o("#woocommerce-exporter-meta:checked").length?1:0,n=o(".woocommerce-exporter-types").val();o.ajax({type:"POST",url:ajaxurl,data:{form:t,action:"woocommerce_do_ajax_product_export",step:r,columns:c,selected_columns:a,export_meta:m,export_types:n,filename:p,security:wc_product_export_params.export_nonce},dataType:"json",success:function(o){o.success&&("done"===o.data.step?(s.$form.find(".woocommerce-exporter-progress").val(o.data.percentage),e.location=o.data.url,setTimeout(function(){s.$form.removeClass("woocommerce-exporter__exporting"),s.$form.find(".woocommerce-exporter-button").prop("disabled",!1)},2e3)):(s.$form.find(".woocommerce-exporter-progress").val(o.data.percentage),s.processStep(parseInt(o.data.step,10),t,o.data.columns,p)))}}).fail(function(o){e.console.log(o)})},o.fn.wc_product_export_form=function(){return new r(this),this},o(".woocommerce-exporter").wc_product_export_form()}(jQuery,window);

View File

@ -130,14 +130,14 @@ jQuery( function( $ ) {
.find( 'input.payment-email-input' )
.prop( 'required', true );
$( this ).closest( '.wc-wizard-service-settings' )
.find( '.wc-wizard-service-setting-stripe_email, .wc-wizard-service-setting-ppec_paypal_api_subject' )
.find( '.wc-wizard-service-setting-stripe_email, .wc-wizard-service-setting-ppec_paypal_email' )
.show();
} else {
$( this ).closest( '.wc-wizard-service-settings' )
.find( 'input.payment-email-input' )
.prop( 'required', false );
$( this ).closest( '.wc-wizard-service-settings' )
.find( '.wc-wizard-service-setting-stripe_email, .wc-wizard-service-setting-ppec_paypal_api_subject' )
.find( '.wc-wizard-service-setting-stripe_email, .wc-wizard-service-setting-ppec_paypal_email' )
.hide();
}
} ).find( 'input#stripe_create_account, input#ppec_paypal_reroute_requests' ).change();

View File

@ -1 +1 @@
jQuery(function(e){function i(){e(".wc-setup-content").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}function s(){e("form.activate-jetpack").submit()}function t(){wp.ajax.post("setup_wizard_check_jetpack").then(function(e){if(!e||!e.is_active||"yes"===e.is_active)return s();setTimeout(t,3e3)}).fail(function(){s()})}e(".button-next").on("click",function(){var s=e(this).parents("form").get(0);return("function"!=typeof s.checkValidity||s.checkValidity())&&i(),!0}),e(".wc-wizard-services").on("change",".wc-wizard-service-enable input",function(){e(this).is(":checked")?(e(this).closest(".wc-wizard-service-toggle").removeClass("disabled"),e(this).closest(".wc-wizard-service-item").addClass("checked"),e(this).closest(".wc-wizard-service-item").find(".wc-wizard-service-settings").removeClass("hide")):(e(this).closest(".wc-wizard-service-toggle").addClass("disabled"),e(this).closest(".wc-wizard-service-item").removeClass("checked"),e(this).closest(".wc-wizard-service-item").find(".wc-wizard-service-settings").addClass("hide"))}),e(".wc-wizard-services").on("click",".wc-wizard-service-enable",function(i){if(e(i.target).is("input"))i.stopPropagation();else{var s=e(this).find('input[type="checkbox"]');s.prop("checked",!s.prop("checked")).change()}}),e(".wc-wizard-services-list-toggle").on("change",".wc-wizard-service-enable input",function(){e(this).closest(".wc-wizard-services-list-toggle").toggleClass("closed"),e(this).closest(".wc-wizard-services").find(".wc-wizard-service-item").slideToggle().css("display","flex")}),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-select .method",function(i){var s=e(this).closest(".wc-wizard-service-description"),t=i.target.value,c=s.find(".shipping-method-descriptions");c.find(".shipping-method-description").addClass("hide"),c.find("."+t).removeClass("hide");var r=s.find(".shipping-method-settings");r.find(".shipping-method-setting").addClass("hide").find(".shipping-method-required-field").prop("required",!1),r.find("."+t).removeClass("hide").find(".shipping-method-required-field").prop("required",!0)}),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-enable",function(){var i=e(this).is(":checked");e(this).closest(".wc-wizard-service-item").find(".shipping-method-required-field").prop("required",i)}),e(".activate-jetpack").on("click",".button-primary",function(e){if(i(),"no"===wc_setup_params.pending_jetpack_install)return!0;e.preventDefault(),t()}),e(".wc-wizard-services").on("change","input#stripe_create_account, input#ppec_paypal_reroute_requests",function(){e(this).is(":checked")?(e(this).closest(".wc-wizard-service-settings").find("input.payment-email-input").prop("required",!0),e(this).closest(".wc-wizard-service-settings").find(".wc-wizard-service-setting-stripe_email, .wc-wizard-service-setting-ppec_paypal_api_subject").show()):(e(this).closest(".wc-wizard-service-settings").find("input.payment-email-input").prop("required",!1),e(this).closest(".wc-wizard-service-settings").find(".wc-wizard-service-setting-stripe_email, .wc-wizard-service-setting-ppec_paypal_api_subject").hide())}).find("input#stripe_create_account, input#ppec_paypal_reroute_requests").change(),e("select#store_country_state").on("change",function(){var i=this.value.split(":")[0];e("select#currency_code").val(wc_setup_currencies[i]).change()})});
jQuery(function(e){function i(){e(".wc-setup-content").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}function s(){e("form.activate-jetpack").submit()}function t(){wp.ajax.post("setup_wizard_check_jetpack").then(function(e){if(!e||!e.is_active||"yes"===e.is_active)return s();setTimeout(t,3e3)}).fail(function(){s()})}e(".button-next").on("click",function(){var s=e(this).parents("form").get(0);return("function"!=typeof s.checkValidity||s.checkValidity())&&i(),!0}),e(".wc-wizard-services").on("change",".wc-wizard-service-enable input",function(){e(this).is(":checked")?(e(this).closest(".wc-wizard-service-toggle").removeClass("disabled"),e(this).closest(".wc-wizard-service-item").addClass("checked"),e(this).closest(".wc-wizard-service-item").find(".wc-wizard-service-settings").removeClass("hide")):(e(this).closest(".wc-wizard-service-toggle").addClass("disabled"),e(this).closest(".wc-wizard-service-item").removeClass("checked"),e(this).closest(".wc-wizard-service-item").find(".wc-wizard-service-settings").addClass("hide"))}),e(".wc-wizard-services").on("click",".wc-wizard-service-enable",function(i){if(e(i.target).is("input"))i.stopPropagation();else{var s=e(this).find('input[type="checkbox"]');s.prop("checked",!s.prop("checked")).change()}}),e(".wc-wizard-services-list-toggle").on("change",".wc-wizard-service-enable input",function(){e(this).closest(".wc-wizard-services-list-toggle").toggleClass("closed"),e(this).closest(".wc-wizard-services").find(".wc-wizard-service-item").slideToggle().css("display","flex")}),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-select .method",function(i){var s=e(this).closest(".wc-wizard-service-description"),t=i.target.value,c=s.find(".shipping-method-descriptions");c.find(".shipping-method-description").addClass("hide"),c.find("."+t).removeClass("hide");var r=s.find(".shipping-method-settings");r.find(".shipping-method-setting").addClass("hide").find(".shipping-method-required-field").prop("required",!1),r.find("."+t).removeClass("hide").find(".shipping-method-required-field").prop("required",!0)}),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-enable",function(){var i=e(this).is(":checked");e(this).closest(".wc-wizard-service-item").find(".shipping-method-required-field").prop("required",i)}),e(".activate-jetpack").on("click",".button-primary",function(e){if(i(),"no"===wc_setup_params.pending_jetpack_install)return!0;e.preventDefault(),t()}),e(".wc-wizard-services").on("change","input#stripe_create_account, input#ppec_paypal_reroute_requests",function(){e(this).is(":checked")?(e(this).closest(".wc-wizard-service-settings").find("input.payment-email-input").prop("required",!0),e(this).closest(".wc-wizard-service-settings").find(".wc-wizard-service-setting-stripe_email, .wc-wizard-service-setting-ppec_paypal_email").show()):(e(this).closest(".wc-wizard-service-settings").find("input.payment-email-input").prop("required",!1),e(this).closest(".wc-wizard-service-settings").find(".wc-wizard-service-setting-stripe_email, .wc-wizard-service-setting-ppec_paypal_email").hide())}).find("input#stripe_create_account, input#ppec_paypal_reroute_requests").change(),e("select#store_country_state").on("change",function(){var i=this.value.split(":")[0];e("select#currency_code").val(wc_setup_currencies[i]).change()})});

View File

@ -178,6 +178,10 @@ jQuery( function ( $ ) {
ui.item.removeAttr( 'style' );
}
});
// Focus on inputs within the table if clicked instead of trying to sort.
$( '.wc_input_table.sortable tbody input' ).on( 'click', function() {
$( this ).focus();
} );
$( '.wc_input_table .remove_rows' ).click( function() {
var $tbody = $( this ).closest( '.wc_input_table' ).find( 'tbody' );
@ -297,12 +301,4 @@ jQuery( function ( $ ) {
// Attribute term table
$( 'table.attributes-table tbody tr:nth-child(odd)' ).addClass( 'alternate' );
// Load videos when help button is clicked.
$( '#contextual-help-link' ).on( 'click', function() {
$( '.wc-guided-tour-embed' ).each( function() {
var video_id = $( this ).data( 'video_id' );
$( this ).replaceWith( '<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/' + video_id + '" frameborder="0" allowfullscreen></iframe>' );
} );
});
});

File diff suppressed because one or more lines are too long

View File

@ -166,7 +166,7 @@ jQuery( function( $ ) {
}
} ).each( function() {
if ( this.complete ) {
$( this ).load();
$( this ).trigger( 'load' );
}
} );
};
@ -200,9 +200,9 @@ jQuery( function( $ ) {
// But only zoom if the img is larger than its container.
if ( zoomEnabled ) {
var zoom_options = {
var zoom_options = $.extend( {
touch: false
};
}, wc_single_product_params.zoom_options );
if ( 'ontouchstart' in window ) {
zoom_options.on = 'click';

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,6 @@
* https://en.wikipedia.org/wiki/ISO_3166-2:MD
* https://en.wikipedia.org/wiki/Romanian_alphabet#Unicode_and_HTML
*
* @author Alexander Minza
* @package WooCommerce/i18n
* @version 3.3.0
*/
@ -20,24 +19,24 @@ if ( ! defined( 'ABSPATH' ) ) {
}
$states['MD'] = array(
'C' => __( 'Chi&#537;in&abreve;u', 'woocommerce' ),
'BL' => __( 'B&abreve;l&#539;i', 'woocommerce' ),
'C' => __( 'Chi&#537;in&#259;u', 'woocommerce' ),
'BL' => __( 'B&#259;l&#539;i', 'woocommerce' ),
'AN' => __( 'Anenii Noi', 'woocommerce' ),
'BS' => __( 'Basarabeasca', 'woocommerce' ),
'BR' => __( 'Briceni', 'woocommerce' ),
'CH' => __( 'Cahul', 'woocommerce' ),
'CT' => __( 'Cantemir', 'woocommerce' ),
'CL' => __( 'C&abreve;l&abreve;ra&#537;i', 'woocommerce' ),
'CS' => __( 'C&abreve;u&#537;eni', 'woocommerce' ),
'CL' => __( 'C&#259;l&#259;ra&#537;i', 'woocommerce' ),
'CS' => __( 'C&#259;u&#537;eni', 'woocommerce' ),
'CM' => __( 'Cimi&#537;lia', 'woocommerce' ),
'CR' => __( 'Criuleni', 'woocommerce' ),
'DN' => __( 'Dondu&#537;eni', 'woocommerce' ),
'DR' => __( 'Drochia', 'woocommerce' ),
'DB' => __( 'Dub&abreve;sari', 'woocommerce' ),
'DB' => __( 'Dub&#259;sari', 'woocommerce' ),
'ED' => __( 'Edine&#539;', 'woocommerce' ),
'FL' => __( 'F&abreve;le&#537;ti', 'woocommerce' ),
'FL' => __( 'F&#259;le&#537;ti', 'woocommerce' ),
'FR' => __( 'Flore&#537;ti', 'woocommerce' ),
'GE' => __( 'UTA G&abreve;g&abreve;uzia', 'woocommerce' ),
'GE' => __( 'UTA G&#259;g&#259;uzia', 'woocommerce' ),
'GL' => __( 'Glodeni', 'woocommerce' ),
'HN' => __( 'H&icirc;nce&#537;ti', 'woocommerce' ),
'IL' => __( 'Ialoveni', 'woocommerce' ),
@ -49,9 +48,9 @@ $states['MD'] = array(
'RS' => __( 'R&icirc;&#537;cani', 'woocommerce' ),
'SG' => __( 'S&icirc;ngerei', 'woocommerce' ),
'SR' => __( 'Soroca', 'woocommerce' ),
'ST' => __( 'Str&abreve;&#537;eni', 'woocommerce' ),
'SD' => __( '&#536;old&abreve;ne&#537;ti', 'woocommerce' ),
'SV' => __( '&#536;tefan Vod&abreve;', 'woocommerce' ),
'ST' => __( 'Str&#259;&#537;eni', 'woocommerce' ),
'SD' => __( '&#536;old&#259;ne&#537;ti', 'woocommerce' ),
'SV' => __( '&#536;tefan Vod&#259;', 'woocommerce' ),
'TR' => __( 'Taraclia', 'woocommerce' ),
'TL' => __( 'Telene&#537;ti', 'woocommerce' ),
'UN' => __( 'Ungheni', 'woocommerce' ),

View File

@ -5,7 +5,6 @@
* For more details check:
* https://ro.wikipedia.org/wiki/Jude%C8%9Bele_Rom%C3%A2niei
*
* @author Automattic
* @package WooCommerce/i18n
* @version 3.1.0
*/
@ -20,15 +19,15 @@ $states['RO'] = array(
'AB' => __( 'Alba', 'woocommerce' ),
'AR' => __( 'Arad', 'woocommerce' ),
'AG' => __( 'Arge&#537;', 'woocommerce' ),
'BC' => __( 'Bac&abreve;u', 'woocommerce' ),
'BC' => __( 'Bac&#259;u', 'woocommerce' ),
'BH' => __( 'Bihor', 'woocommerce' ),
'BN' => __( 'Bistri&#539;a-N&abreve;s&abreve;ud', 'woocommerce' ),
'BN' => __( 'Bistri&#539;a-N&#259;s&#259;ud', 'woocommerce' ),
'BT' => __( 'Boto&#537;ani', 'woocommerce' ),
'BR' => __( 'Br&abreve;ila', 'woocommerce' ),
'BR' => __( 'Br&#259;ila', 'woocommerce' ),
'BV' => __( 'Bra&#537;ov', 'woocommerce' ),
'B' => __( 'Bucure&#537;ti', 'woocommerce' ),
'BZ' => __( 'Buz&abreve;u', 'woocommerce' ),
'CL' => __( 'C&abreve;l&abreve;ra&#537;i', 'woocommerce' ),
'BZ' => __( 'Buz&#259;u', 'woocommerce' ),
'CL' => __( 'C&#259;l&#259;ra&#537;i', 'woocommerce' ),
'CS' => __( 'Cara&#537;-Severin', 'woocommerce' ),
'CJ' => __( 'Cluj', 'woocommerce' ),
'CT' => __( 'Constan&#539;a', 'woocommerce' ),
@ -49,7 +48,7 @@ $states['RO'] = array(
'NT' => __( 'Neam&#539;', 'woocommerce' ),
'OT' => __( 'Olt', 'woocommerce' ),
'PH' => __( 'Prahova', 'woocommerce' ),
'SJ' => __( 'S&abreve;laj', 'woocommerce' ),
'SJ' => __( 'S&#259;laj', 'woocommerce' ),
'SM' => __( 'Satu Mare', 'woocommerce' ),
'SB' => __( 'Sibiu', 'woocommerce' ),
'SV' => __( 'Suceava', 'woocommerce' ),

View File

@ -1453,11 +1453,11 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
public function get_item_subtotal( $item, $inc_tax = false, $round = true ) {
$subtotal = 0;
if ( is_callable( array( $item, 'get_subtotal' ) ) ) {
if ( is_callable( array( $item, 'get_subtotal' ) ) && $item->get_quantity() ) {
if ( $inc_tax ) {
$subtotal = ( $item->get_subtotal() + $item->get_subtotal_tax() ) / max( 1, $item->get_quantity() );
$subtotal = ( $item->get_subtotal() + $item->get_subtotal_tax() ) / $item->get_quantity();
} else {
$subtotal = ( floatval( $item->get_subtotal() ) / max( 1, $item->get_quantity() ) );
$subtotal = floatval( $item->get_subtotal() ) / $item->get_quantity();
}
$subtotal = $round ? number_format( (float) $subtotal, wc_get_price_decimals(), '.', '' ) : $subtotal;
@ -1501,11 +1501,11 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
public function get_item_total( $item, $inc_tax = false, $round = true ) {
$total = 0;
if ( is_callable( array( $item, 'get_total' ) ) ) {
if ( is_callable( array( $item, 'get_total' ) ) && $item->get_quantity() ) {
if ( $inc_tax ) {
$total = ( $item->get_total() + $item->get_total_tax() ) / max( 1, $item->get_quantity() );
$total = ( $item->get_total() + $item->get_total_tax() ) / $item->get_quantity();
} else {
$total = floatval( $item->get_total() ) / max( 1, $item->get_quantity() );
$total = floatval( $item->get_total() ) / $item->get_quantity();
}
$total = $round ? round( $total, wc_get_price_decimals() ) : $total;
@ -1546,8 +1546,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
public function get_item_tax( $item, $round = true ) {
$tax = 0;
if ( is_callable( array( $item, 'get_total_tax' ) ) ) {
$tax = $item->get_total_tax() / max( 1, $item->get_quantity() );
if ( is_callable( array( $item, 'get_total_tax' ) ) && $item->get_quantity() ) {
$tax = $item->get_total_tax() / $item->get_quantity();
$tax = $round ? wc_round_tax_total( $tax ) : $tax;
}

View File

@ -2,8 +2,6 @@
/**
* Init WooCommerce data exporters.
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin
* @version 3.1.0
*/
@ -95,6 +93,11 @@ class WC_Admin_Exporters {
if ( isset( $_GET['action'], $_GET['nonce'] ) && wp_verify_nonce( wp_unslash( $_GET['nonce'] ), 'product-csv' ) && 'download_product_csv' === wp_unslash( $_GET['action'] ) ) { // WPCS: input var ok, sanitization ok.
include_once( WC_ABSPATH . 'includes/export/class-wc-product-csv-exporter.php' );
$exporter = new WC_Product_CSV_Exporter();
if ( ! empty( $_GET['filename'] ) ) { // WPCS: input var ok.
$exporter->set_filename( wp_unslash( $_GET['filename'] ) ); // WPCS: input var ok, sanitization ok.
}
$exporter->export();
}
}
@ -130,10 +133,14 @@ class WC_Admin_Exporters {
$exporter->set_product_types_to_export( wp_unslash( $_POST['export_types'] ) ); // WPCS: input var ok, sanitization ok.
}
if ( ! empty( $_POST['filename'] ) ) { // WPCS: input var ok.
$exporter->set_filename( wp_unslash( $_POST['filename'] ) ); // WPCS: input var ok, sanitization ok.
}
$exporter->set_page( $step );
$exporter->generate_file();
$query_args = apply_filters( 'woocommerce_export_get_ajax_query_args', array( 'nonce' => wp_create_nonce( 'product-csv' ), 'action' => 'download_product_csv' ) );
$query_args = apply_filters( 'woocommerce_export_get_ajax_query_args', array( 'nonce' => wp_create_nonce( 'product-csv' ), 'action' => 'download_product_csv', 'filename' => $exporter->get_filename() ) );
if ( 100 === $exporter->get_percent_complete() ) {
wp_send_json_success( array(

View File

@ -2,8 +2,6 @@
/**
* Add some content to the help tab
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin
* @version 2.1.0
*/
@ -29,7 +27,7 @@ class WC_Admin_Help {
}
/**
* Add Contextual help tabs.
* Add help tabs.
*/
public function add_tabs() {
$screen = get_current_screen();
@ -38,173 +36,24 @@ class WC_Admin_Help {
return;
}
$video_map = array(
'wc-settings' => array(
'title' => __( 'General Settings', 'woocommerce' ),
'id' => 'ZD5Cc2xqvCM',
),
'wc-settings-general' => array(
'title' => __( 'General Settings', 'woocommerce' ),
'id' => 'ZD5Cc2xqvCM',
),
'wc-settings-products' => array(
'title' => __( 'Product Settings', 'woocommerce' ),
'id' => 'FEmwJsE8xDY',
),
'wc-settings-tax' => array(
'title' => __( 'Tax Settings', 'woocommerce' ),
'id' => '0aPtye5ba4A',
),
'wc-settings-tax-standard' => array(
'title' => __( 'Tax Rate Example', 'woocommerce' ),
'id' => 'HC2IUnJSJro',
),
'wc-settings-tax-reduced-rate' => array(
'title' => __( 'Tax Rate Example', 'woocommerce' ),
'id' => 'HC2IUnJSJro',
),
'wc-settings-tax-zero-rate' => array(
'title' => __( 'Tax Rate Example', 'woocommerce' ),
'id' => 'HC2IUnJSJro',
),
'wc-settings-shipping' => array(
'title' => __( 'Shipping Zones', 'woocommerce' ),
'id' => '1HhBEbIMqAQ',
),
'wc-settings-shipping-options' => array(
'title' => __( 'Shipping Options', 'woocommerce' ),
'id' => '468Z4s01e3M',
),
'wc-settings-shipping-classes' => array(
'title' => __( 'Shipping Classes', 'woocommerce' ),
'id' => 'Vyt5xIewlOs',
),
'wc-settings-checkout' => array(
'title' => __( 'Checkout Settings', 'woocommerce' ),
'id' => 'zoejwJfXops',
),
'wc-settings-checkout-bacs' => array(
'title' => __( 'Bank Transfer (BACS) Payment Method', 'woocommerce' ),
'id' => 'K4Lpaq9aS2Q',
),
'wc-settings-checkout-cheque' => array(
'title' => __( 'Check Payment Method', 'woocommerce' ),
'id' => 'LwxRxCkfofg',
),
'wc-settings-checkout-cod' => array(
'title' => __( 'Cash on Delivery (COD) Payment Method', 'woocommerce' ),
'id' => 'aioOdPELH4M',
),
'wc-settings-checkout-paypal' => array(
'title' => __( 'PayPal Standard Method', 'woocommerce' ),
'id' => 'FwHT5UDdkdY',
),
'wc-settings-checkout-paypalbraintree_cards' => array(
'title' => __( 'PayPal by Braintree Payment Method', 'woocommerce' ),
'id' => 'hubcUWq2NAc',
),
'wc-settings-checkout-stripe' => array(
'title' => __( 'Stripe Payment Method', 'woocommerce' ),
'id' => '5rMDGdkmSGU',
),
'wc-settings-account' => array(
'title' => __( 'Account Settings', 'woocommerce' ),
'id' => 'AGZSeX5I-wo',
),
'wc-settings-email' => array(
'title' => __( 'Email Settings', 'woocommerce' ),
'id' => '2vtzGc92tFU',
),
'wc-settings-api' => array(
'title' => __( 'API Settings', 'woocommerce' ),
'id' => 'SjJUmgfLS4A',
),
'product' => array(
'title' => __( 'Creating Products', 'woocommerce' ),
'id' => 'sFtXa00Jf_o',
),
'edit-product_cat' => array(
'title' => __( 'Product Categories', 'woocommerce' ),
'id' => 'PeFsOTrN1u8',
),
'edit-product_tag' => array(
'title' => __( 'Product Tags', 'woocommerce' ),
'id' => 'PeFsOTrN1u8',
),
'product_attributes' => array(
'title' => __( 'Product Attributes', 'woocommerce' ),
'id' => 'PeFsOTrN1u8',
),
'wc-status' => array(
'title' => __( 'System Status', 'woocommerce' ),
'id' => 'C8F6_sAr4CE',
),
'wc-reports' => array(
'title' => __( 'Reports', 'woocommerce' ),
'id' => '69adRkRqOk0',
),
'edit-shop_coupon' => array(
'title' => __( 'Coupons', 'woocommerce' ),
'id' => 'k-GKjRs59UM',
),
'shop_coupon' => array(
'title' => __( 'Coupons', 'woocommerce' ),
'id' => 'k-GKjRs59UM',
),
'edit-shop_order' => array(
'title' => __( 'Managing Orders', 'woocommerce' ),
'id' => 'rjS3mbiLN_c',
),
'shop_order' => array(
'title' => __( 'Managing Orders', 'woocommerce' ),
'id' => 'rjS3mbiLN_c',
),
);
$page = empty( $_GET['page'] ) ? '' : sanitize_title( $_GET['page'] );
$tab = empty( $_GET['tab'] ) ? '' : sanitize_title( $_GET['tab'] );
$section = empty( $_REQUEST['section'] ) ? '' : sanitize_title( $_REQUEST['section'] );
$video_key = $page ? implode( '-', array_filter( array( $page, $tab, $section ) ) ) : $screen->id;
// Fallback for sections.
if ( ! isset( $video_map[ $video_key ] ) ) {
$video_key = $page ? implode( '-', array_filter( array( $page, $tab ) ) ) : $screen->id;
}
// Fallback for tabs.
if ( ! isset( $video_map[ $video_key ] ) ) {
$video_key = $page ? $page : $screen->id;
}
if ( isset( $video_map[ $video_key ] ) ) {
$embed_code = '
<a href="https://www.youtube.com/watch?v=' . esc_attr( $video_map[ $video_key ]['id'] ) . '" target="_blank" class="wc-guided-tour-embed" data-video_id="' . esc_attr( $video_map[ $video_key ]['id'] ) . '">
<img src="https://img.youtube.com/vi/' . esc_attr( $video_map[ $video_key ]['id'] ) . '/maxresdefault.jpg" width="560" height="315" />
</a>';
$screen->add_help_tab( array(
'id' => 'woocommerce_guided_tour_tab',
'title' => __( 'Guided Tour', 'woocommerce' ),
'content' => '<h2><a href="https://docs.woocommerce.com/document/woocommerce-guided-tour-videos/?utm_source=helptab&utm_medium=product&utm_content=videos&utm_campaign=woocommerceplugin">' . __( 'Guided Tour', 'woocommerce' ) . '</a> &ndash; ' . esc_html( $video_map[ $video_key ]['title'] ) . '</h2>' . $embed_code,
) );
}
$screen->add_help_tab( array(
'id' => 'woocommerce_support_tab',
'title' => __( 'Help &amp; Support', 'woocommerce' ),
'content' =>
'<h2>' . __( 'Help &amp; Support', 'woocommerce' ) . '</h2>' .
'<p>' . sprintf(
/* translators: %s: Documentation URL */
__( 'Should you need help understanding, using, or extending WooCommerce, <a href="%s">please read our documentation</a>. You will find all kinds of resources including snippets, tutorials and much more.', 'woocommerce' ),
'https://docs.woocommerce.com/documentation/plugins/woocommerce/?utm_source=helptab&utm_medium=product&utm_content=docs&utm_campaign=woocommerceplugin'
) . '</p>' .
'<p>' . sprintf(
/* translators: %s: Forum URL */
__( 'For further assistance with WooCommerce core you can use the <a href="%1$s">community forum</a>. If you need help with premium extensions sold by WooCommerce, please <a href="%2$s">use our helpdesk</a>.', 'woocommerce' ),
'https://wordpress.org/support/plugin/woocommerce',
'https://woocommerce.com/my-account/tickets/?utm_source=helptab&utm_medium=product&utm_content=tickets&utm_campaign=woocommerceplugin'
) . '</p>' .
'<p>' . __( 'Before asking for help we recommend checking the system status page to identify any problems with your configuration.', 'woocommerce' ) . '</p>' .
'<p><a href="' . admin_url( 'admin.php?page=wc-status' ) . '" class="button button-primary">' . __( 'System status', 'woocommerce' ) . '</a> <a href="' . 'https://wordpress.org/support/plugin/woocommerce' . '" class="button">' . __( 'Community forum', 'woocommerce' ) . '</a> <a href="' . 'https://woocommerce.com/my-account/tickets/?utm_source=helptab&utm_medium=product&utm_content=tickets&utm_campaign=woocommerceplugin' . '" class="button">' . __( 'WooCommerce helpdesk', 'woocommerce' ) . '</a></p>',
'<p><a href="' . admin_url( 'admin.php?page=wc-status' ) . '" class="button button-primary">' . __( 'System status', 'woocommerce' ) . '</a> <a href="https://wordpress.org/support/plugin/woocommerce" class="button">' . __( 'Community forum', 'woocommerce' ) . '</a> <a href="https://woocommerce.com/my-account/tickets/?utm_source=helptab&utm_medium=product&utm_content=tickets&utm_campaign=woocommerceplugin" class="button">' . __( 'WooCommerce helpdesk', 'woocommerce' ) . '</a></p>',
) );
$screen->add_help_tab( array(
@ -212,8 +61,9 @@ class WC_Admin_Help {
'title' => __( 'Found a bug?', 'woocommerce' ),
'content' =>
'<h2>' . __( 'Found a bug?', 'woocommerce' ) . '</h2>' .
/* translators: 1: GitHub issues URL 2: GitHub contribution guide URL 3: System status report URL */
'<p>' . sprintf( __( 'If you find a bug within WooCommerce core you can create a ticket via <a href="%1$s">Github issues</a>. Ensure you read the <a href="%2$s">contribution guide</a> prior to submitting your report. To help us solve your issue, please be as descriptive as possible and include your <a href="%3$s">system status report</a>.', 'woocommerce' ), 'https://github.com/woocommerce/woocommerce/issues?state=open', 'https://github.com/woocommerce/woocommerce/blob/master/.github/CONTRIBUTING.md', admin_url( 'admin.php?page=wc-status' ) ) . '</p>' .
'<p><a href="' . 'https://github.com/woocommerce/woocommerce/issues?state=open' . '" class="button button-primary">' . __( 'Report a bug', 'woocommerce' ) . '</a> <a href="' . admin_url( 'admin.php?page=wc-status' ) . '" class="button">' . __( 'System status', 'woocommerce' ) . '</a></p>',
'<p><a href="https://github.com/woocommerce/woocommerce/issues?state=open" class="button button-primary">' . __( 'Report a bug', 'woocommerce' ) . '</a> <a href="' . admin_url( 'admin.php?page=wc-status' ) . '" class="button">' . __( 'System status', 'woocommerce' ) . '</a></p>',
) );
@ -223,7 +73,7 @@ class WC_Admin_Help {
'content' =>
'<h2>' . __( 'Education', 'woocommerce' ) . '</h2>' .
'<p>' . __( 'If you would like to learn about using WooCommerce from an expert, consider following a WooCommerce course offered by one of our educational partners.', 'woocommerce' ) . '</p>' .
'<p><a href="' . 'https://woocommerce.com/educational-partners/?utm_source=helptab&utm_medium=product&utm_content=edupartners&utm_campaign=woocommerceplugin' . '" class="button button-primary">' . __( 'View education partners', 'woocommerce' ) . '</a></p>',
'<p><a href="https://woocommerce.com/educational-partners/?utm_source=helptab&utm_medium=product&utm_content=edupartners&utm_campaign=woocommerceplugin" class="button button-primary">' . __( 'View education partners', 'woocommerce' ) . '</a></p>',
) );
$screen->add_help_tab( array(
@ -238,11 +88,11 @@ class WC_Admin_Help {
$screen->set_help_sidebar(
'<p><strong>' . __( 'For more information:', 'woocommerce' ) . '</strong></p>' .
'<p><a href="' . 'https://woocommerce.com/?utm_source=helptab&utm_medium=product&utm_content=about&utm_campaign=woocommerceplugin' . '" target="_blank">' . __( 'About WooCommerce', 'woocommerce' ) . '</a></p>' .
'<p><a href="' . 'https://wordpress.org/plugins/woocommerce/' . '" target="_blank">' . __( 'WordPress.org project', 'woocommerce' ) . '</a></p>' .
'<p><a href="' . 'https://github.com/woocommerce/woocommerce' . '" target="_blank">' . __( 'Github project', 'woocommerce' ) . '</a></p>' .
'<p><a href="' . 'https://woocommerce.com/product-category/themes/woocommerce/?utm_source=helptab&utm_medium=product&utm_content=wcthemes&utm_campaign=woocommerceplugin' . '" target="_blank">' . __( 'Official themes', 'woocommerce' ) . '</a></p>' .
'<p><a href="' . 'https://woocommerce.com/product-category/woocommerce-extensions/?utm_source=helptab&utm_medium=product&utm_content=wcextensions&utm_campaign=woocommerceplugin' . '" target="_blank">' . __( 'Official extensions', 'woocommerce' ) . '</a></p>'
'<p><a href="https://woocommerce.com/?utm_source=helptab&utm_medium=product&utm_content=about&utm_campaign=woocommerceplugin" target="_blank">' . __( 'About WooCommerce', 'woocommerce' ) . '</a></p>' .
'<p><a href="https://wordpress.org/plugins/woocommerce/" target="_blank">' . __( 'WordPress.org project', 'woocommerce' ) . '</a></p>' .
'<p><a href="https://github.com/woocommerce/woocommerce" target="_blank">' . __( 'Github project', 'woocommerce' ) . '</a></p>' .
'<p><a href="https://woocommerce.com/product-category/themes/woocommerce/?utm_source=helptab&utm_medium=product&utm_content=wcthemes&utm_campaign=woocommerceplugin" target="_blank">' . __( 'Official themes', 'woocommerce' ) . '</a></p>' .
'<p><a href="https://woocommerce.com/product-category/woocommerce-extensions/?utm_source=helptab&utm_medium=product&utm_content=wcextensions&utm_campaign=woocommerceplugin" target="_blank">' . __( 'Official extensions', 'woocommerce' ) . '</a></p>'
);
}
}

View File

@ -1111,7 +1111,7 @@ class WC_Admin_Setup_Wizard {
'https://woocommerce.com/products/klarna/'
) . '</p>';
$square_description = '<p>' . sprintf(
__( 'Accept Visa, Mastercard, Discover, and American Express all for one low rate, with no surprise fees. <a href="%s" target="_blank">Learn more about Square</a>.', 'woocommerce' ),
__( 'Securely accept credit and debit cards with one low rate, no surprise fees (custom rates available). Sell online and in store and track sales and inventory in one place. <a href="%s" target="_blank">Learn more about Square</a>.', 'woocommerce' ),
'https://woocommerce.com/products/square/'
) . '</p>';
@ -1120,7 +1120,7 @@ class WC_Admin_Setup_Wizard {
'name' => __( 'Stripe', 'woocommerce' ),
'image' => WC()->plugin_url() . '/assets/images/stripe.png',
'description' => $stripe_description,
'class' => 'checked',
'class' => 'checked stripe-logo',
'repo-slug' => 'woocommerce-gateway-stripe',
'settings' => array(
'create_account' => array(
@ -1155,7 +1155,7 @@ class WC_Admin_Setup_Wizard {
'placeholder' => '',
'required' => false,
),
'api_subject' => array(
'email' => array(
'label' => __( 'Direct payments to email address:', 'woocommerce' ),
'type' => 'email',
'value' => $user_email,

View File

@ -47,6 +47,7 @@ class WC_Admin_List_Table_Coupons extends WC_Admin_List_Table {
echo '<div class="woocommerce-BlankState">';
echo '<h2 class="woocommerce-BlankState-message">' . esc_html__( 'Coupons are a great way to offer discounts and rewards to your customers. They will appear here once created.', 'woocommerce' ) . '</h2>';
echo '<a class="woocommerce-BlankState-cta button-primary button" target="_blank" href="https://docs.woocommerce.com/document/coupon-management/?utm_source=blankslate&utm_medium=product&utm_content=couponsdoc&utm_campaign=woocommerceplugin">' . esc_html__( 'Learn more about coupons', 'woocommerce' ) . '</a>';
echo '<a class="woocommerce-BlankState-cta button-primary button" href="' . esc_url ( admin_url( 'post-new.php?post_type=shop_coupon' ) ) . '">' . esc_html__( 'Create your first coupon', 'woocommerce' ) . '</a>';
echo '</div>';
}

View File

@ -219,13 +219,18 @@ class WC_Meta_Box_Order_Data {
?></p>
<div class="order_data_column_container">
<div class="order_data_column">
<h3><?php _e( 'General Details', 'woocommerce' ); ?></h3>
<h3><?php esc_html_e( 'General', 'woocommerce' ); ?></h3>
<p class="form-field form-field-wide"><label for="order_date"><?php _e( 'Order date:', 'woocommerce' ) ?></label>
<input type="text" class="date-picker" name="order_date" id="order_date" maxlength="10" value="<?php echo date_i18n( 'Y-m-d', strtotime( $post->post_date ) ); ?>" pattern="<?php echo esc_attr( apply_filters( 'woocommerce_date_input_html_pattern', '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])' ) ); ?>" />@&lrm;<input type="number" class="hour" placeholder="<?php esc_attr_e( 'h', 'woocommerce' ) ?>" name="order_date_hour" id="order_date_hour" min="0" max="23" step="1" value="<?php echo date_i18n( 'H', strtotime( $post->post_date ) ); ?>" pattern="([01]?[0-9]{1}|2[0-3]{1})" />:<input type="number" class="minute" placeholder="<?php esc_attr_e( 'm', 'woocommerce' ) ?>" name="order_date_minute" id="order_date_minute" min="0" max="59" step="1" value="<?php echo date_i18n( 'i', strtotime( $post->post_date ) ); ?>" pattern="[0-5]{1}[0-9]{1}" />&lrm;
<p class="form-field form-field-wide"><label for="order_date"><?php _e( 'Date created:', 'woocommerce' ) ?></label>
<input type="text" class="date-picker" name="order_date" maxlength="10" value="<?php echo esc_attr( date_i18n( 'Y-m-d', strtotime( $post->post_date ) ) ); ?>" pattern="<?php echo esc_attr( apply_filters( 'woocommerce_date_input_html_pattern', '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])' ) ); ?>" />@
&lrm;
<input type="number" class="hour" placeholder="<?php esc_attr_e( 'h', 'woocommerce' ) ?>" name="order_date_hour" min="0" max="23" step="1" value="<?php echo esc_attr( date_i18n( 'H', strtotime( $post->post_date ) ) ); ?>" pattern="([01]?[0-9]{1}|2[0-3]{1})" />:
<input type="number" class="minute" placeholder="<?php esc_attr_e( 'm', 'woocommerce' ) ?>" name="order_date_minute" min="0" max="59" step="1" value="<?php echo esc_attr( date_i18n( 'i', strtotime( $post->post_date ) ) ); ?>" pattern="[0-5]{1}[0-9]{1}" />
<input type="hidden" name="order_date_second" value="<?php echo esc_attr( date_i18n( 's', strtotime( $post->post_date ) ) ); ?>" />
&lrm;
</p>
<p class="form-field form-field-wide wc-order-status"><label for="order_status"><?php _e( 'Order status:', 'woocommerce' ) ?> <?php
<p class="form-field form-field-wide wc-order-status"><label for="order_status"><?php _e( 'Status:', 'woocommerce' ) ?> <?php
if ( $order->needs_payment() ) {
printf( '<a href="%s">%s</a>',
esc_url( $order->get_checkout_payment_url() ),
@ -281,10 +286,10 @@ class WC_Meta_Box_Order_Data {
</div>
<div class="order_data_column">
<h3>
<?php _e( 'Billing details', 'woocommerce' ); ?>
<a href="#" class="edit_address"><?php _e( 'Edit', 'woocommerce' ); ?></a>
<?php esc_html_e( 'Billing', 'woocommerce' ); ?>
<a href="#" class="edit_address"><?php esc_html_e( 'Edit', 'woocommerce' ); ?></a>
<span>
<a href="#" class="load_customer_billing" style="display:none;"><?php _e( 'Load billing address', 'woocommerce' ); ?></a>
<a href="#" class="load_customer_billing" style="display:none;"><?php esc_html_e( 'Load billing address', 'woocommerce' ); ?></a>
</span>
</h3>
<?php
@ -292,7 +297,7 @@ class WC_Meta_Box_Order_Data {
echo '<div class="address">';
if ( $order->get_formatted_billing_address() ) {
echo '<p><strong>' . __( 'Address:', 'woocommerce' ) . '</strong>' . wp_kses( $order->get_formatted_billing_address(), array( 'br' => array() ) ) . '</p>';
echo '<p>' . wp_kses( $order->get_formatted_billing_address(), array( 'br' => array() ) ) . '</p>';
} else {
echo '<p class="none_set"><strong>' . __( 'Address:', 'woocommerce' ) . '</strong> ' . __( 'No billing address set.', 'woocommerce' ) . '</p>';
}
@ -342,9 +347,9 @@ class WC_Meta_Box_Order_Data {
}
?>
<p class="form-field form-field-wide">
<label><?php _e( 'Payment method:', 'woocommerce' ); ?></label>
<label><?php esc_html_e( 'Payment method:', 'woocommerce' ); ?></label>
<select name="_payment_method" id="_payment_method" class="first">
<option value=""><?php _e( 'N/A', 'woocommerce' ); ?></option>
<option value=""><?php esc_html_e( 'N/A', 'woocommerce' ); ?></option>
<?php
$found_method = false;
@ -377,11 +382,11 @@ class WC_Meta_Box_Order_Data {
<div class="order_data_column">
<h3>
<?php _e( 'Shipping details', 'woocommerce' ); ?>
<a href="#" class="edit_address"><?php _e( 'Edit', 'woocommerce' ); ?></a>
<?php esc_html_e( 'Shipping', 'woocommerce' ); ?>
<a href="#" class="edit_address"><?php esc_html_e( 'Edit', 'woocommerce' ); ?></a>
<span>
<a href="#" class="load_customer_shipping" style="display:none;"><?php _e( 'Load shipping address', 'woocommerce' ); ?></a>
<a href="#" class="billing-same-as-shipping" style="display:none;"><?php _e( 'Copy billing address', 'woocommerce' ); ?></a>
<a href="#" class="load_customer_shipping" style="display:none;"><?php esc_html_e( 'Load shipping address', 'woocommerce' ); ?></a>
<a href="#" class="billing-same-as-shipping" style="display:none;"><?php esc_html_e( 'Copy billing address', 'woocommerce' ); ?></a>
</span>
</h3>
<?php
@ -389,7 +394,7 @@ class WC_Meta_Box_Order_Data {
echo '<div class="address">';
if ( $order->get_formatted_shipping_address() ) {
echo '<p><strong>' . __( 'Address:', 'woocommerce' ) . '</strong>' . wp_kses( $order->get_formatted_shipping_address(), array( 'br' => array() ) ) . '</p>';
echo '<p>' . wp_kses( $order->get_formatted_shipping_address(), array( 'br' => array() ) ) . '</p>';
} else {
echo '<p class="none_set"><strong>' . __( 'Address:', 'woocommerce' ) . '</strong> ' . __( 'No shipping address set.', 'woocommerce' ) . '</p>';
}
@ -547,7 +552,7 @@ class WC_Meta_Box_Order_Data {
if ( empty( $_POST['order_date'] ) ) {
$date = current_time( 'timestamp', true );
} else {
$date = gmdate( 'Y-m-d H:i:s', strtotime( $_POST['order_date'] . ' ' . (int) $_POST['order_date_hour'] . ':' . (int) $_POST['order_date_minute'] . ':00' ) );
$date = gmdate( 'Y-m-d H:i:s', strtotime( $_POST['order_date'] . ' ' . (int) $_POST['order_date_hour'] . ':' . (int) $_POST['order_date_minute'] . ':' . (int) $_POST['order_date_second'] ) );
}
$props['date_created'] = $date;

View File

@ -30,6 +30,8 @@ class WC_Meta_Box_Product_Data {
$thepostid = $post->ID;
$product_object = $thepostid ? wc_get_product( $thepostid ) : new WC_Product;
wp_nonce_field( 'woocommerce_save_data', 'woocommerce_meta_nonce' );
include( 'views/html-product-data-panel.php' );
}

View File

@ -25,6 +25,7 @@ class WC_Meta_Box_Product_Images {
* @param WP_Post $post
*/
public static function output( $post ) {
wp_nonce_field( 'woocommerce_save_data', 'woocommerce_meta_nonce' );
?>
<div id="product_images_container">
<ul class="product_images">

View File

@ -44,7 +44,6 @@ if ( ! defined( 'ABSPATH' ) ) {
self::output_variations();
do_action( 'woocommerce_product_data_panels' );
wc_do_deprecated_action( 'woocommerce_product_write_panels', array(), '2.6', 'Use woocommerce_product_data_panels action instead.' );
wp_nonce_field( 'woocommerce_save_data', 'woocommerce_meta_nonce' );
?>
<div class="clear"></div>
</div>

View File

@ -196,7 +196,7 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
}
}
echo '<p><strong>' . esc_html( implode( ', ', $this->product_ids_titles ) ) . '</strong></p>';
echo '<p><strong>' . wp_kses_post( implode( ', ', $this->product_ids_titles ) ) . '</strong></p>';
echo '<p><a class="button" href="' . esc_url( remove_query_arg( 'product_ids' ) ) . '">' . esc_html__( 'Reset', 'woocommerce' ) . '</a></p>';
}

View File

@ -12,9 +12,6 @@ if ( ! defined( 'ABSPATH' ) ) {
wp_enqueue_script( 'wc-product-export' );
$exporter = new WC_Product_CSV_Exporter();
$product_count = wp_count_posts( 'product' );
$variation_count = wp_count_posts( 'product' );
$total_rows = $product_count->publish + $product_count->private + $variation_count->publish + $variation_count->private;
?>
<div class="wrap woocommerce">
<h1><?php esc_html_e( 'Export Products', 'woocommerce' ); ?></h1>

View File

@ -153,7 +153,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
// Add SKU and PRICE to products.
if ( is_callable( array( $item, 'get_product' ) ) ) {
$data['sku'] = $item->get_product() ? $item->get_product()->get_sku(): null;
$data['price'] = $item->get_total() / max( 1, $item->get_quantity() );
$data['price'] = $item->get_quantity() ? $item->get_total() / $item->get_quantity() : 0;
}
// Format taxes.

View File

@ -1172,7 +1172,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
}
$download = new WC_Product_Download();
$download->set_id( $key );
$download->set_id( $file['id'] ? $file['id'] : wp_generate_uuid4() );
$download->set_name( $file['name'] ? $file['name'] : wc_get_filename_from_url( $file['file'] ) );
$download->set_file( apply_filters( 'woocommerce_file_download_path', $file['file'], $product, $key ) );
$files[] = $download;

View File

@ -1527,7 +1527,7 @@ class WC_API_Products extends WC_API_Resource {
}
$download = new WC_Product_Download();
$download->set_id( $key );
$download->set_id( $file['id'] ? $file['id'] : wp_generate_uuid4() );
$download->set_name( $file['name'] ? $file['name'] : wc_get_filename_from_url( $file['file'] ) );
$download->set_file( apply_filters( 'woocommerce_file_download_path', $file['file'], $product, $key ) );
$files[] = $download;

View File

@ -2031,7 +2031,7 @@ class WC_API_Products extends WC_API_Resource {
}
$download = new WC_Product_Download();
$download->set_id( $key );
$download->set_id( $file['id'] ? $file['id'] : wp_generate_uuid4() );
$download->set_name( $file['name'] ? $file['name'] : wc_get_filename_from_url( $file['file'] ) );
$download->set_file( apply_filters( 'woocommerce_file_download_path', $file['file'], $product, $key ) );
$files[] = $download;

View File

@ -960,7 +960,7 @@ class WC_REST_Products_V1_Controller extends WC_REST_Posts_Controller {
}
$download = new WC_Product_Download();
$download->set_id( $key );
$download->set_id( $file['id'] ? $file['id'] : wp_generate_uuid4() );
$download->set_name( $file['name'] ? $file['name'] : wc_get_filename_from_url( $file['file'] ) );
$download->set_file( apply_filters( 'woocommerce_file_download_path', $file['file'], $product, $key ) );
$files[] = $download;

View File

@ -360,11 +360,20 @@ class WC_AJAX {
ob_start();
$product_id = apply_filters( 'woocommerce_add_to_cart_product_id', absint( $_POST['product_id'] ) );
$product = wc_get_product( $product_id );
$quantity = empty( $_POST['quantity'] ) ? 1 : wc_stock_amount( $_POST['quantity'] );
$passed_validation = apply_filters( 'woocommerce_add_to_cart_validation', true, $product_id, $quantity );
$product_status = get_post_status( $product_id );
$variation_id = 0;
$variation = array();
if ( $passed_validation && false !== WC()->cart->add_to_cart( $product_id, $quantity ) && 'publish' === $product_status ) {
if ( $product && 'variation' === $product->get_type() ) {
$variation_id = $product_id;
$product_id = $product->get_parent_id();
$variation = $product->get_variation_attributes();
}
if ( $passed_validation && false !== WC()->cart->add_to_cart( $product_id, $quantity, $variation_id, $variation ) && 'publish' === $product_status ) {
do_action( 'woocommerce_ajax_added_to_cart', $product_id );

View File

@ -149,9 +149,12 @@ class WC_Breadcrumb {
$this->term_ancestors( $main_term->term_id, 'product_cat' );
$this->add_crumb( $main_term->name, get_term_link( $main_term ) );
}
} elseif ( 'post' != get_post_type( $post ) ) {
} elseif ( 'post' !== get_post_type( $post ) ) {
$post_type = get_post_type_object( get_post_type( $post ) );
if ( ! empty( $post_type->has_archive ) ) {
$this->add_crumb( $post_type->labels->singular_name, get_post_type_archive_link( get_post_type( $post ) ) );
}
} else {
$cat = current( get_the_category( $post ) );
if ( $cat ) {

View File

@ -425,7 +425,7 @@ final class WC_Cart_Totals {
$taxes = WC_Tax::calc_tax( $item->price, $base_tax_rates, true );
// Now we have a new item price (excluding TAX).
$item->price = absint( $item->price - array_sum( $taxes ) );
$item->price = round( $item->price - array_sum( $taxes ) );
$item->price_includes_tax = false;
}
return $item;

View File

@ -4,7 +4,6 @@
*
* @version 3.3.0
* @package WooCommerce\l10n
* @author WooThemes
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -817,7 +817,7 @@ class WC_Discounts {
$categories = array();
foreach ( $this->items as $item ) {
if ( $coupon->get_exclude_sale_items() && $item->product && $item->product->is_on_sale() ) {
if ( ! $item->product ) {
continue;
}

View File

@ -37,7 +37,7 @@ class WC_Download_Handler {
$product = wc_get_product( $product_id );
$data_store = WC_Data_Store::load( 'customer-download' );
if ( ! $product || ! isset( $_GET['key'], $_GET['order'] ) ) {
if ( ! $product || empty( $_GET['key'] ) || empty( $_GET['order'] ) ) {
self::download_error( __( 'Invalid download link.', 'woocommerce' ) );
}

View File

@ -470,6 +470,7 @@ class WC_Frontend_Scripts {
'allowOneSlide' => false,
) ),
'zoom_enabled' => apply_filters( 'woocommerce_single_product_zoom_enabled', get_theme_support( 'wc-product-gallery-zoom' ) ),
'zoom_options' => apply_filters( 'woocommerce_single_product_zoom_options', array() ),
'photoswipe_enabled' => apply_filters( 'woocommerce_single_product_photoswipe_enabled', get_theme_support( 'wc-product-gallery-lightbox' ) ),
'photoswipe_options' => apply_filters( 'woocommerce_single_product_photoswipe_options', array(
'shareEl' => false,

View File

@ -92,7 +92,7 @@ class WC_Geolocation {
} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { // WPCS: input var ok, CSRF ok.
// Proxy servers can send through this header like this: X-Forwarded-For: client1, proxy1, proxy2
// Make sure we always only send through the first IP in the list which should always be the client IP.
return (string) rest_is_ip_address( trim( current( explode( ',', sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) ) ) ) ); // WPCS: input var ok, CSRF ok.
return (string) rest_is_ip_address( trim( current( preg_split( '/[,:]/', sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) ) ) ) ); // WPCS: input var ok, CSRF ok.
} elseif ( isset( $_SERVER['REMOTE_ADDR'] ) ) { // @codingStandardsIgnoreLine
return sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ); // @codingStandardsIgnoreLine
}

View File

@ -112,8 +112,13 @@ class WC_Product_Grouped extends WC_Product {
}
if ( '' !== $min_price ) {
$price = $min_price !== $max_price ? sprintf( _x( '%1$s&ndash;%2$s', 'Price range: from-to', 'woocommerce' ), wc_price( $min_price ), wc_price( $max_price ) ) : wc_price( $min_price );
$is_free = ( 0 == $min_price && 0 == $max_price );
if ( $min_price !== $max_price ) {
$price = wc_format_price_range( $min_price, $max_price );
} else {
$price = wc_price( $min_price );
}
$is_free = 0 === $min_price && 0 === $max_price;
if ( $is_free ) {
$price = apply_filters( 'woocommerce_grouped_free_price_html', __( 'Free!', 'woocommerce' ), $this );

View File

@ -731,7 +731,9 @@ class WC_Query {
}
/**
* Layered Nav Init.
* Get an array of attributes and terms selected with the layered nav widget.
*
* @return array
*/
public static function get_layered_nav_chosen_attributes() {
if ( ! is_array( self::$_chosen_attributes ) ) {

View File

@ -2,9 +2,7 @@
/**
* All functionality to regenerate images in the background when settings change.
*
* @category Images
* @package WooCommerce/Classes
* @author Automattic
* @version 3.3.0
* @since 3.3.0
*/
@ -13,6 +11,14 @@ if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( ! class_exists( 'WP_Async_Request', false ) ) {
include_once dirname( __FILE__ ) . '/libraries/wp-async-request.php';
}
if ( ! class_exists( 'WP_Background_Process', false ) ) {
include_once dirname( __FILE__ ) . '/libraries/wp-background-process.php';
}
/**
* Class that extends WP_Background_Process to process image regeneration in the background
*/
@ -56,7 +62,7 @@ class WC_Regenerate_Images_Request extends WP_Background_Process {
}
if ( ! function_exists( 'wp_crop_image' ) ) {
include( ABSPATH . 'wp-admin/includes/image.php' );
include ABSPATH . 'wp-admin/includes/image.php';
}
$attachment_id = absint( $item['attachment_id'] );
@ -109,6 +115,4 @@ class WC_Regenerate_Images_Request extends WP_Background_Process {
)
);
}
}

View File

@ -169,16 +169,10 @@ class WC_Regenerate_Images {
}
/**
* Check if we should generate images when new themes declares custom sizes
*
* @return void
* Check if we should generate images when new themes declares custom sizes.
*/
public static function maybe_regenerate_image_theme_switch() {
$theme_support = get_theme_support( 'woocommerce' );
$theme_support = is_array( $theme_support ) ? $theme_support[0] : false;
// Only queue image generation if the theme declares custom sizes via theme_support.
if ( is_array( $theme_support ) && ( isset( $theme_support['single_image_width'] ) || isset( $theme_support['thumbnail_image_width'] ) ) ) {
if ( wc_get_theme_support( 'single_image_width' ) || wc_get_theme_support( 'thumbnail_image_width' ) ) {
self::queue_image_regeneration();
}
}

View File

@ -378,10 +378,6 @@ final class WooCommerce {
$this->frontend_includes();
}
if ( $this->is_request( 'frontend' ) || $this->is_request( 'cron' ) ) {
include_once( WC_ABSPATH . 'includes/class-wc-session-handler.php' );
}
if ( $this->is_request( 'cron' ) && 'yes' === get_option( 'woocommerce_allow_tracking', 'no' ) ) {
include_once( WC_ABSPATH . 'includes/class-wc-tracker.php' );
}
@ -444,6 +440,7 @@ final class WooCommerce {
include_once( WC_ABSPATH . 'includes/class-wc-shortcodes.php' ); // Shortcodes class.
include_once( WC_ABSPATH . 'includes/class-wc-embed.php' ); // Embeds.
include_once( WC_ABSPATH . 'includes/class-wc-structured-data.php' ); // Structured Data class.
include_once( WC_ABSPATH . 'includes/class-wc-session-handler.php' ); // Session handler class.
}
/**

View File

@ -77,6 +77,10 @@ class WC_Shop_Customizer {
* Scripts to improve our form.
*/
public function add_scripts() {
$min_rows = wc_get_theme_support( 'product_grid::min_rows', 1 );
$max_rows = wc_get_theme_support( 'product_grid::max_rows', '' );
$min_columns = wc_get_theme_support( 'product_grid::min_columns', 1 );
$max_columns = wc_get_theme_support( 'product_grid::max_columns', '' );
?>
<script type="text/javascript">
jQuery( document ).ready( function( $ ) {
@ -96,6 +100,68 @@ class WC_Shop_Customizer {
wp.customize.bind( 'ready', function() { // Ready?
$( '.woocommerce-cropping-control' ).find( 'input:checked' ).change();
} );
wp.customize( 'woocommerce_catalog_columns', function( setting ) {
setting.bind( function( value ) {
var min = '<?php echo esc_js( $min_columns ); ?>';
var max = '<?php echo esc_js( $max_columns ); ?>';
if ( max && value > max ) {
setting.notifications.add( 'max_columns_error', new wp.customize.Notification(
'max_columns_error',
{
type : 'error',
message: '<?php echo esc_js( sprintf( __( 'The maximum allowed setting for columns is %d', 'woocommerce' ), $max_columns ) ); ?>'
}
) );
} else {
setting.notifications.remove( 'max_columns_error' );
}
if ( min && value < min ) {
setting.notifications.add( 'min_columns_error', new wp.customize.Notification(
'min_columns_error',
{
type : 'error',
message: '<?php echo esc_js( sprintf( __( 'The minimum allowed setting for columns is %d', 'woocommerce' ), $min_columns ) ); ?>'
}
) );
} else {
setting.notifications.remove( 'min_columns_error' );
}
} );
} );
wp.customize( 'woocommerce_catalog_rows', function( setting ) {
setting.bind( function( value ) {
var min = '<?php echo esc_js( $min_rows ); ?>';
var max = '<?php echo esc_js( $max_rows ); ?>';
if ( max && value > max ) {
setting.notifications.add( 'max_rows_error', new wp.customize.Notification(
'max_rows_error',
{
type : 'error',
message: '<?php echo esc_js( sprintf( __( 'The maximum allowed setting for rows is %d', 'woocommerce' ), $max_rows ) ); ?>'
}
) );
} else {
setting.notifications.remove( 'max_rows_error' );
}
if ( min && value < min ) {
setting.notifications.add( 'min_rows_error', new wp.customize.Notification(
'min_rows_error',
{
type : 'error',
message: '<?php echo esc_js( sprintf( __( 'The minimum allowed setting for rows is %d', 'woocommerce' ), $min_rows ) ); ?>'
}
) );
} else {
setting.notifications.remove( 'min_rows_error' );
}
} );
} );
} );
</script>
<?php
@ -214,9 +280,6 @@ class WC_Shop_Customizer {
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
public function add_product_catalog_section( $wp_customize ) {
$theme_support = get_theme_support( 'woocommerce' );
$theme_support = is_array( $theme_support ) ? $theme_support[0] : false;
$wp_customize->add_section(
'woocommerce_product_catalog',
array(
@ -282,7 +345,7 @@ class WC_Shop_Customizer {
$wp_customize->add_setting(
'woocommerce_default_catalog_orderby',
array(
'default' => '',
'default' => 'menu_order',
'type' => 'option',
'capability' => 'manage_woocommerce',
'sanitize_callback' => array( $this, 'sanitize_default_catalog_orderby' ),
@ -333,8 +396,8 @@ class WC_Shop_Customizer {
'settings' => 'woocommerce_catalog_columns',
'type' => 'number',
'input_attrs' => array(
'min' => isset( $theme_support['product_grid']['min_columns'] ) ? absint( $theme_support['product_grid']['min_columns'] ) : 1,
'max' => isset( $theme_support['product_grid']['max_columns'] ) ? absint( $theme_support['product_grid']['max_columns'] ) : '',
'min' => wc_get_theme_support( 'product_grid::min_columns', 1 ),
'max' => wc_get_theme_support( 'product_grid::max_columns', '' ),
'step' => 1,
),
)
@ -360,8 +423,8 @@ class WC_Shop_Customizer {
'settings' => 'woocommerce_catalog_rows',
'type' => 'number',
'input_attrs' => array(
'min' => isset( $theme_support['product_grid']['min_rows'] ) ? absint( $theme_support['product_grid']['min_rows'] ) : 1,
'max' => isset( $theme_support['product_grid']['max_rows'] ) ? absint( $theme_support['product_grid']['max_rows'] ) : '',
'min' => wc_get_theme_support( 'product_grid::min_rows', 1 ),
'max' => wc_get_theme_support( 'product_grid::max_rows', '' ),
'step' => 1,
),
)
@ -374,9 +437,6 @@ class WC_Shop_Customizer {
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
private function add_product_images_section( $wp_customize ) {
$theme_support = get_theme_support( 'woocommerce' );
$theme_support = is_array( $theme_support ) ? $theme_support[0] : false;
$wp_customize->add_section(
'woocommerce_product_images',
array(
@ -387,7 +447,7 @@ class WC_Shop_Customizer {
)
);
if ( ! isset( $theme_support['single_image_width'] ) ) {
if ( ! wc_get_theme_support( 'single_image_width' ) ) {
$wp_customize->add_setting(
'woocommerce_single_image_width',
array(
@ -415,7 +475,7 @@ class WC_Shop_Customizer {
);
}
if ( ! isset( $theme_support['thumbnail_image_width'] ) ) {
if ( ! wc_get_theme_support( 'thumbnail_image_width' ) ) {
$wp_customize->add_setting(
'woocommerce_thumbnail_image_width',
array(

View File

@ -1,4 +1,10 @@
<?php
/**
* WC_Product_Data_Store_CPT class file.
*
* @package WooCommerce/Classes
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@ -7,8 +13,6 @@ if ( ! defined( 'ABSPATH' ) ) {
* WC Product Data Store: Stored in CPT.
*
* @version 3.0.0
* @category Class
* @author WooThemes
*/
class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Data_Store_Interface, WC_Product_Data_Store_Interface {
@ -64,11 +68,14 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
/**
* If we have already saved our extra data, don't do automatic / default handling.
*
* @var bool
*/
protected $extra_data_saved = false;
/**
* Stores updated props.
*
* @var array
*/
protected $updated_props = array();
@ -82,14 +89,16 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
/**
* Method to create a new product in the database.
*
* @param WC_Product $product
* @param WC_Product $product Product object.
*/
public function create( &$product ) {
if ( ! $product->get_date_created( 'edit' ) ) {
$product->set_date_created( current_time( 'timestamp', true ) );
}
$id = wp_insert_post( apply_filters( 'woocommerce_new_product_data', array(
$id = wp_insert_post(
apply_filters(
'woocommerce_new_product_data', array(
'post_type' => 'product',
'post_status' => $product->get_status() ? $product->get_status() : 'publish',
'post_author' => get_current_user_id(),
@ -103,7 +112,9 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
'post_date' => gmdate( 'Y-m-d H:i:s', $product->get_date_created( 'edit' )->getOffsetTimestamp() ),
'post_date_gmt' => gmdate( 'Y-m-d H:i:s', $product->get_date_created( 'edit' )->getTimestamp() ),
'post_name' => $product->get_slug( 'edit' ),
) ), true );
)
), true
);
if ( $id && ! is_wp_error( $id ) ) {
$product->set_id( $id );
@ -126,19 +137,20 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
/**
* Method to read a product from the database.
* @param WC_Product $product
* @throws Exception
*
* @param WC_Product $product Product object.
* @throws Exception If invalid product.
*/
public function read( &$product ) {
$product->set_defaults();
$post_object = get_post( $product->get_id() );
if ( ! $product->get_id() || ! ( $post_object = get_post( $product->get_id() ) ) || 'product' !== $post_object->post_type ) {
if ( ! $product->get_id() || ! $post_object || 'product' !== $post_object->post_type ) {
throw new Exception( __( 'Invalid product.', 'woocommerce' ) );
}
$id = $product->get_id();
$product->set_props( array(
$product->set_props(
array(
'name' => $post_object->post_title,
'slug' => $post_object->post_name,
'date_created' => 0 < $post_object->post_date_gmt ? wc_string_to_timestamp( $post_object->post_date_gmt ) : null,
@ -149,7 +161,8 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
'parent_id' => $post_object->post_parent,
'menu_order' => $post_object->menu_order,
'reviews_allowed' => 'open' === $post_object->comment_status,
) );
)
);
$this->read_attributes( $product );
$this->read_downloads( $product );
@ -162,7 +175,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
/**
* Method to update a product in the database.
*
* @param WC_Product $product
* @param WC_Product $product Product object.
*/
public function update( &$product ) {
$product->save_meta_data();
@ -226,16 +239,19 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
/**
* Method to delete a product from the database.
* @param WC_Product $product
*
* @param WC_Product $product Product object.
* @param array $args Array of args to pass to the delete method.
*/
public function delete( &$product, $args = array() ) {
$id = $product->get_id();
$post_type = $product->is_type( 'variation' ) ? 'product_variation' : 'product';
$args = wp_parse_args( $args, array(
$args = wp_parse_args(
$args, array(
'force_delete' => false,
) );
)
);
if ( ! $id ) {
return;
@ -261,31 +277,35 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
/**
* Read product data. Can be overridden by child classes to load other props.
*
* @param WC_Product
* @param WC_Product $product Product object.
* @since 3.0.0
*/
protected function read_product_data( &$product ) {
$id = $product->get_id();
$review_count = get_post_meta( $id, '_wc_review_count', true );
$rating_counts = get_post_meta( $id, '_wc_rating_count', true );
$average_rating = get_post_meta( $id, '_wc_average_rating', true );
if ( '' === ( $review_count = get_post_meta( $id, '_wc_review_count', true ) ) ) {
if ( '' === $review_count ) {
WC_Comments::get_review_count_for_product( $product );
} else {
$product->set_review_count( $review_count );
}
if ( '' === ( $rating_counts = get_post_meta( $id, '_wc_rating_count', true ) ) ) {
if ( '' === $rating_counts ) {
WC_Comments::get_rating_counts_for_product( $product );
} else {
$product->set_rating_counts( $rating_counts );
}
if ( '' === ( $average_rating = get_post_meta( $id, '_wc_average_rating', true ) ) ) {
if ( '' === $average_rating ) {
WC_Comments::get_average_rating_for_product( $product );
} else {
$product->set_average_rating( $average_rating );
}
$product->set_props( array(
$product->set_props(
array(
'sku' => get_post_meta( $id, '_sku', true ),
'regular_price' => get_post_meta( $id, '_regular_price', true ),
'sale_price' => get_post_meta( $id, '_sale_price', true ),
@ -317,7 +337,8 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
'download_limit' => get_post_meta( $id, '_download_limit', true ),
'download_expiry' => get_post_meta( $id, '_download_expiry', true ),
'image_id' => get_post_thumbnail_id( $id ),
) );
)
);
// Handle sale dates on the fly in case of missed cron schedule.
if ( $product->is_type( 'simple' ) && $product->is_on_sale( 'edit' ) && $product->get_sale_price( 'edit' ) !== $product->get_price( 'edit' ) ) {
@ -329,7 +350,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
/**
* Read extra data associated with the product, like button text or product URL for external products.
*
* @param WC_Product
* @param WC_Product $product Product object.
* @since 3.0.0
*/
protected function read_extra_data( &$product ) {
@ -345,15 +366,15 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
* Convert visibility terms to props.
* Catalog visibility valid values are 'visible', 'catalog', 'search', and 'hidden'.
*
* @param WC_Product
* @param WC_Product $product Product object.
* @since 3.0.0
*/
protected function read_visibility( &$product ) {
$terms = get_the_terms( $product->get_id(), 'product_visibility' );
$term_names = is_array( $terms ) ? wp_list_pluck( $terms, 'name' ) : array();
$featured = in_array( 'featured', $term_names );
$exclude_search = in_array( 'exclude-from-search', $term_names );
$exclude_catalog = in_array( 'exclude-from-catalog', $term_names );
$featured = in_array( 'featured', $term_names, true );
$exclude_search = in_array( 'exclude-from-search', $term_names, true );
$exclude_catalog = in_array( 'exclude-from-catalog', $term_names, true );
if ( $exclude_search && $exclude_catalog ) {
$catalog_visibility = 'hidden';
@ -365,10 +386,12 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
$catalog_visibility = 'visible';
}
$product->set_props( array(
$product->set_props(
array(
'featured' => $featured,
'catalog_visibility' => $catalog_visibility,
) );
)
);
}
/**
@ -382,14 +405,16 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
if ( ! empty( $meta_attributes ) && is_array( $meta_attributes ) ) {
$attributes = array();
foreach ( $meta_attributes as $meta_attribute_key => $meta_attribute_value ) {
$meta_value = array_merge( array(
$meta_value = array_merge(
array(
'name' => '',
'value' => '',
'position' => 0,
'is_visible' => 0,
'is_variation' => 0,
'is_taxonomy' => 0,
), (array) $meta_attribute_value );
), (array) $meta_attribute_value
);
// Check if is a taxonomy attribute.
if ( ! empty( $meta_value['is_taxonomy'] ) ) {
@ -419,7 +444,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
/**
* Read downloads from post meta.
*
* @param WC_Product
* @param WC_Product $product Product object.
* @since 3.0.0
*/
protected function read_downloads( &$product ) {
@ -444,8 +469,8 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
/**
* Helper method that updates all the post meta for a product based on it's settings in the WC_Product class.
*
* @param WC_Product
* @param bool Force update. Used during create.
* @param WC_Product $product Product object.
* @param bool $force Force update. Used during create.
* @since 3.0.0
*/
protected function update_post_meta( &$product, $force = false ) {
@ -614,7 +639,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
*
* @since 3.0.0
*
* @param WC_Product $product
* @param WC_Product $product Product object.
* @param bool $force Force update. Used during create.
*/
protected function update_visibility( &$product, $force = false ) {
@ -660,8 +685,8 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
/**
* Update attributes which are a mix of terms and meta data.
*
* @param WC_Product
* @param bool Force update. Used during create.
* @param WC_Product $product Product object.
* @param bool $force Force update. Used during create.
* @since 3.0.0
*/
protected function update_attributes( &$product, $force = false ) {
@ -708,8 +733,8 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
* Update downloads.
*
* @since 3.0.0
* @param WC_Product $product
* @param bool Force update. Used during create.
* @param WC_Product $product Product object.
* @param bool $force Force update. Used during create.
* @return bool If updated or not.
*/
protected function update_downloads( &$product, $force = false ) {
@ -740,7 +765,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
/**
* Make sure we store the product type and version (to track data changes).
*
* @param WC_Product
* @param WC_Product $product Product object.
* @since 3.0.0
*/
protected function update_version_and_type( &$product ) {
@ -760,7 +785,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
/**
* Clear any caches.
*
* @param WC_Product
* @param WC_Product $product Product object.
* @since 3.0.0
*/
protected function clear_caches( &$product ) {
@ -786,8 +811,10 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
$decimals = absint( wc_get_price_decimals() );
return $wpdb->get_results( "
SELECT post.ID as id, post.post_parent as parent_id FROM `$wpdb->posts` AS post
// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
return $wpdb->get_results(
$wpdb->prepare(
"SELECT post.ID as id, post.post_parent as parent_id FROM `$wpdb->posts` AS post
LEFT JOIN `$wpdb->postmeta` AS meta ON post.ID = meta.post_id
LEFT JOIN `$wpdb->postmeta` AS meta2 ON post.ID = meta2.post_id
WHERE post.post_type IN ( 'product', 'product_variation' )
@ -796,9 +823,12 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
AND meta2.meta_key = '_price'
AND CAST( meta.meta_value AS DECIMAL ) >= 0
AND CAST( meta.meta_value AS CHAR ) != ''
AND CAST( meta.meta_value AS DECIMAL( 10, {$decimals} ) ) = CAST( meta2.meta_value AS DECIMAL( 10, {$decimals} ) )
GROUP BY post.ID;
" );
AND CAST( meta.meta_value AS DECIMAL( 10, %d ) ) = CAST( meta2.meta_value AS DECIMAL( 10, %d ) )
GROUP BY post.ID",
$decimals,
$decimals
)
);
}
/**
@ -812,10 +842,12 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
public function get_featured_product_ids() {
$product_visibility_term_ids = wc_get_product_visibility_term_ids();
return get_posts( array(
return get_posts(
array(
'post_type' => array( 'product', 'product_variation' ),
'posts_per_page' => -1,
'post_status' => 'publish',
// phpcs:ignore WordPress.VIP.SlowDBQuery.slow_db_query_tax_query
'tax_query' => array(
'relation' => 'AND',
array(
@ -831,28 +863,35 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
),
),
'fields' => 'id=>parent',
) );
)
);
}
/**
* Check if product sku is found for any other product IDs.
*
* @since 3.0.0
* @param int $product_id
* @param string $sku Will be slashed to work around https://core.trac.wordpress.org/ticket/27421
* @param int $product_id Product ID.
* @param string $sku Will be slashed to work around https://core.trac.wordpress.org/ticket/27421.
* @return bool
*/
public function is_existing_sku( $product_id, $sku ) {
global $wpdb;
return $wpdb->get_var( $wpdb->prepare( "
SELECT $wpdb->posts.ID
// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
return $wpdb->get_var(
$wpdb->prepare(
"SELECT $wpdb->posts.ID
FROM $wpdb->posts
LEFT JOIN $wpdb->postmeta ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id )
WHERE $wpdb->posts.post_type IN ( 'product', 'product_variation' )
AND $wpdb->posts.post_status != 'trash'
AND $wpdb->postmeta.meta_key = '_sku' AND $wpdb->postmeta.meta_value = '%s'
AND $wpdb->postmeta.post_id <> %d LIMIT 1
", wp_slash( $sku ), $product_id ) );
AND $wpdb->postmeta.meta_key = '_sku' AND $wpdb->postmeta.meta_value = %s
AND $wpdb->postmeta.post_id <> %d
LIMIT 1",
wp_slash( $sku ), $product_id
)
);
}
/**
@ -865,16 +904,20 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
public function get_product_id_by_sku( $sku ) {
global $wpdb;
$id = $wpdb->get_var( $wpdb->prepare( "
SELECT posts.ID
// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
$id = $wpdb->get_var(
$wpdb->prepare(
"SELECT posts.ID
FROM $wpdb->posts AS posts
LEFT JOIN $wpdb->postmeta AS postmeta ON ( posts.ID = postmeta.post_id )
WHERE posts.post_type IN ( 'product', 'product_variation' )
AND posts.post_status != 'trash'
AND postmeta.meta_key = '_sku'
AND postmeta.meta_value = '%s'
LIMIT 1
", $sku ) );
AND postmeta.meta_value = %s
LIMIT 1",
$sku
)
);
return (int) apply_filters( 'woocommerce_get_product_id_by_sku', $id, $sku );
}
@ -887,8 +930,11 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
*/
public function get_starting_sales() {
global $wpdb;
return $wpdb->get_col( $wpdb->prepare( "
SELECT postmeta.post_id FROM {$wpdb->postmeta} as postmeta
// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
return $wpdb->get_col(
$wpdb->prepare(
"SELECT postmeta.post_id FROM {$wpdb->postmeta} as postmeta
LEFT JOIN {$wpdb->postmeta} as postmeta_2 ON postmeta.post_id = postmeta_2.post_id
LEFT JOIN {$wpdb->postmeta} as postmeta_3 ON postmeta.post_id = postmeta_3.post_id
WHERE postmeta.meta_key = '_sale_price_dates_from'
@ -896,8 +942,10 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
AND postmeta_3.meta_key = '_sale_price'
AND postmeta.meta_value > 0
AND postmeta.meta_value < %s
AND postmeta_2.meta_value != postmeta_3.meta_value
", current_time( 'timestamp', true ) ) );
AND postmeta_2.meta_value != postmeta_3.meta_value",
current_time( 'timestamp', true )
)
);
}
/**
@ -908,8 +956,11 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
*/
public function get_ending_sales() {
global $wpdb;
return $wpdb->get_col( $wpdb->prepare( "
SELECT postmeta.post_id FROM {$wpdb->postmeta} as postmeta
// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
return $wpdb->get_col(
$wpdb->prepare(
"SELECT postmeta.post_id FROM {$wpdb->postmeta} as postmeta
LEFT JOIN {$wpdb->postmeta} as postmeta_2 ON postmeta.post_id = postmeta_2.post_id
LEFT JOIN {$wpdb->postmeta} as postmeta_3 ON postmeta.post_id = postmeta_3.post_id
WHERE postmeta.meta_key = '_sale_price_dates_to'
@ -917,8 +968,10 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
AND postmeta_3.meta_key = '_regular_price'
AND postmeta.meta_value > 0
AND postmeta.meta_value < %s
AND postmeta_2.meta_value != postmeta_3.meta_value
", current_time( 'timestamp', true ) ) );
AND postmeta_2.meta_value != postmeta_3.meta_value",
current_time( 'timestamp', true )
)
);
}
/**
@ -938,7 +991,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
'fields' => 'ids',
'post_status' => 'publish',
'numberposts' => 1,
'meta_query' => array(),
'meta_query' => array(), // phpcs:ignore WordPress.VIP.SlowDBQuery.slow_db_query_meta_query
);
// Allow large queries in case user has many variations or attributes.
@ -968,7 +1021,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
array(
'key' => $attribute_field_name,
'compare' => 'NOT EXISTS',
)
),
);
}
@ -990,14 +1043,22 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
/**
* Make sure all variations have a sort order set so they can be reordered correctly.
*
* @param int $parent_id
* @param int $parent_id Product ID.
*/
public function sort_all_product_variations( $parent_id ) {
global $wpdb;
$ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'product_variation' AND post_parent = %d AND post_status = 'publish' ORDER BY menu_order ASC, ID ASC", $parent_id ) );
// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
$ids = $wpdb->get_col(
$wpdb->prepare(
"SELECT ID FROM {$wpdb->posts} WHERE post_type = 'product_variation' AND post_parent = %d AND post_status = 'publish' ORDER BY menu_order ASC, ID ASC",
$parent_id
)
);
$index = 1;
foreach ( $ids as $id ) {
// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
$wpdb->update( $wpdb->posts, array( 'menu_order' => ( $index++ ) ), array( 'ID' => absint( $id ) ) );
}
}
@ -1010,7 +1071,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
* @param array $tags_array List of tags IDs.
* @param array $exclude_ids Excluded IDs.
* @param int $limit Limit of results.
* @param int $product_id
* @param int $product_id Product ID.
* @return array
*/
public function get_related_products( $cats_array, $tags_array, $exclude_ids, $limit, $product_id ) {
@ -1025,6 +1086,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
$related_product_query = (array) apply_filters( 'woocommerce_product_related_posts_query', $this->get_related_products_query( $cats_array, $tags_array, $exclude_ids, $limit + 10 ), $product_id, $args );
// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery, WordPress.WP.PreparedSQL.NotPrepared
return $wpdb->get_col( implode( ' ', $related_product_query ) );
}
@ -1066,22 +1128,22 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
AND p.post_type = 'product'
",
'limits' => "
LIMIT " . absint( $limit ) . "
",
'limits' => '
LIMIT ' . absint( $limit ) . '
',
);
if ( count( $exclude_term_ids ) ) {
$query['join'] .= " LEFT JOIN ( SELECT object_id FROM {$wpdb->term_relationships} WHERE term_taxonomy_id IN ( " . implode( ',', array_map( 'absint', $exclude_term_ids ) ) . " ) ) AS exclude_join ON exclude_join.object_id = p.ID";
$query['where'] .= " AND exclude_join.object_id IS NULL";
$query['join'] .= " LEFT JOIN ( SELECT object_id FROM {$wpdb->term_relationships} WHERE term_taxonomy_id IN ( " . implode( ',', array_map( 'absint', $exclude_term_ids ) ) . ' ) ) AS exclude_join ON exclude_join.object_id = p.ID';
$query['where'] .= ' AND exclude_join.object_id IS NULL';
}
if ( count( $include_term_ids ) ) {
$query['join'] .= " INNER JOIN ( SELECT object_id FROM {$wpdb->term_relationships} INNER JOIN {$wpdb->term_taxonomy} using( term_taxonomy_id ) WHERE term_id IN ( " . implode( ',', array_map( 'absint', $include_term_ids ) ) . " ) ) AS include_join ON include_join.object_id = p.ID";
$query['join'] .= " INNER JOIN ( SELECT object_id FROM {$wpdb->term_relationships} INNER JOIN {$wpdb->term_taxonomy} using( term_taxonomy_id ) WHERE term_id IN ( " . implode( ',', array_map( 'absint', $include_term_ids ) ) . ' ) ) AS include_join ON include_join.object_id = p.ID';
}
if ( count( $exclude_ids ) ) {
$query['where'] .= " AND p.ID NOT IN ( " . implode( ',', array_map( 'absint', $exclude_ids ) ) . " )";
$query['where'] .= ' AND p.ID NOT IN ( ' . implode( ',', array_map( 'absint', $exclude_ids ) ) . ' )';
}
return $query;
@ -1093,24 +1155,39 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
* Uses queries rather than update_post_meta so we can do this in one query (to avoid stock issues).
*
* @since 3.0.0 this supports set, increase and decrease.
* @param int
* @param int|null $stock_quantity
* @param string $operation set, increase and decrease.
* @param int $product_id_with_stock Product ID.
* @param int|null $stock_quantity Stock quantity.
* @param string $operation Set, increase and decrease.
*/
public function update_product_stock( $product_id_with_stock, $stock_quantity = null, $operation = 'set' ) {
global $wpdb;
add_post_meta( $product_id_with_stock, '_stock', 0, true );
// Update stock in DB directly
// Update stock in DB directly.
switch ( $operation ) {
case 'increase':
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value = meta_value + %f WHERE post_id = %d AND meta_key='_stock'", $stock_quantity, $product_id_with_stock ) );
// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
$wpdb->query(
$wpdb->prepare(
"UPDATE {$wpdb->postmeta} SET meta_value = meta_value + %f WHERE post_id = %d AND meta_key='_stock'", $stock_quantity, $product_id_with_stock
)
);
break;
case 'decrease':
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value = meta_value - %f WHERE post_id = %d AND meta_key='_stock'", $stock_quantity, $product_id_with_stock ) );
// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
$wpdb->query(
$wpdb->prepare(
"UPDATE {$wpdb->postmeta} SET meta_value = meta_value - %f WHERE post_id = %d AND meta_key='_stock'", $stock_quantity, $product_id_with_stock
)
);
break;
default:
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value = %f WHERE post_id = %d AND meta_key='_stock'", $stock_quantity, $product_id_with_stock ) );
// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
$wpdb->query(
$wpdb->prepare(
"UPDATE {$wpdb->postmeta} SET meta_value = %f WHERE post_id = %d AND meta_key='_stock'", $stock_quantity, $product_id_with_stock
)
);
break;
}
@ -1123,24 +1200,39 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
* Uses queries rather than update_post_meta so we can do this in one query for performance.
*
* @since 3.0.0 this supports set, increase and decrease.
* @param int
* @param int|null $quantity
* @param int $product_id Product ID.
* @param int|null $quantity Quantity.
* @param string $operation set, increase and decrease.
*/
public function update_product_sales( $product_id, $quantity = null, $operation = 'set' ) {
global $wpdb;
add_post_meta( $product_id, 'total_sales', 0, true );
// Update stock in DB directly
// Update stock in DB directly.
switch ( $operation ) {
case 'increase':
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value = meta_value + %f WHERE post_id = %d AND meta_key='total_sales'", $quantity, $product_id ) );
// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
$wpdb->query(
$wpdb->prepare(
"UPDATE {$wpdb->postmeta} SET meta_value = meta_value + %f WHERE post_id = %d AND meta_key='total_sales'", $quantity, $product_id
)
);
break;
case 'decrease':
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value = meta_value - %f WHERE post_id = %d AND meta_key='total_sales'", $quantity, $product_id ) );
// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
$wpdb->query(
$wpdb->prepare(
"UPDATE {$wpdb->postmeta} SET meta_value = meta_value - %f WHERE post_id = %d AND meta_key='total_sales'", $quantity, $product_id
)
);
break;
default:
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value = %f WHERE post_id = %d AND meta_key='total_sales'", $quantity, $product_id ) );
// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
$wpdb->query(
$wpdb->prepare(
"UPDATE {$wpdb->postmeta} SET meta_value = %f WHERE post_id = %d AND meta_key='total_sales'", $quantity, $product_id
)
);
break;
}
@ -1151,7 +1243,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
* Update a products average rating meta.
*
* @since 3.0.0
* @param WC_Product $product
* @param WC_Product $product Product object.
*/
public function update_average_rating( $product ) {
update_post_meta( $product->get_id(), '_wc_average_rating', $product->get_average_rating( 'edit' ) );
@ -1162,7 +1254,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
* Update a products review count meta.
*
* @since 3.0.0
* @param WC_Product $product
* @param WC_Product $product Product object.
*/
public function update_review_count( $product ) {
update_post_meta( $product->get_id(), '_wc_review_count', $product->get_review_count( 'edit' ) );
@ -1172,7 +1264,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
* Update a products rating counts.
*
* @since 3.0.0
* @param WC_Product $product
* @param WC_Product $product Product object.
*/
public function update_rating_counts( $product ) {
update_post_meta( $product->get_id(), '_wc_rating_count', $product->get_rating_counts( 'edit' ) );
@ -1182,7 +1274,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
* Get shipping class ID by slug.
*
* @since 3.0.0
* @param $slug string
* @param string $slug Product shipping class slug.
* @return int|false
*/
public function get_shipping_class_id_by_slug( $slug ) {
@ -1197,9 +1289,9 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
/**
* Returns an array of products.
*
* @param array $args @see wc_get_products
*
* @param array $args Args to pass to WC_Product_Query().
* @return array|object
* @see wc_get_products
*/
public function get_products( $args = array() ) {
$query = new WC_Product_Query( $args );
@ -1209,17 +1301,14 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
/**
* Search product data for a term and return ids.
*
* @param string $term
* @param string $type of product
* @param bool $include_variations in search or not
* @param string $term Search term.
* @param string $type Type of product.
* @param bool $include_variations Include variations in search or not.
* @return array of ids
*/
public function search_products( $term, $type = '', $include_variations = false ) {
global $wpdb;
$search_fields = array_map( 'wc_clean', apply_filters( 'woocommerce_product_search_fields', array(
'_sku',
) ) );
$like_term = '%' . $wpdb->esc_like( $term ) . '%';
$post_types = $include_variations ? array( 'product', 'product_variation' ) : array( 'product' );
$post_statuses = current_user_can( 'edit_private_products' ) ? array( 'private', 'publish' ) : array( 'publish' );
@ -1227,15 +1316,17 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
$type_where = '';
if ( $type ) {
if ( in_array( $type, array( 'virtual', 'downloadable' ) ) ) {
if ( in_array( $type, array( 'virtual', 'downloadable' ), true ) ) {
$type_join = " LEFT JOIN {$wpdb->postmeta} postmeta_type ON posts.ID = postmeta_type.post_id ";
$type_where = " AND ( postmeta_type.meta_key = '_{$type}' AND postmeta_type.meta_value = 'yes' ) ";
}
}
// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
$product_ids = $wpdb->get_col(
$wpdb->prepare( "
SELECT DISTINCT posts.ID FROM {$wpdb->posts} posts
// phpcs:disable
$wpdb->prepare(
"SELECT DISTINCT posts.ID FROM {$wpdb->posts} posts
LEFT JOIN {$wpdb->postmeta} postmeta ON posts.ID = postmeta.post_id
$type_join
WHERE (
@ -1248,12 +1339,12 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
AND posts.post_type IN ('" . implode( "','", $post_types ) . "')
AND posts.post_status IN ('" . implode( "','", $post_statuses ) . "')
$type_where
ORDER BY posts.post_parent ASC, posts.post_title ASC
",
ORDER BY posts.post_parent ASC, posts.post_title ASC",
$like_term,
$like_term,
$like_term
)
// phpcs:enable
);
if ( is_numeric( $term ) ) {
@ -1276,7 +1367,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
* Get the product type based on product ID.
*
* @since 3.0.0
* @param int $product_id
* @param int $product_id Product ID.
* @return bool|string
*/
public function get_product_type( $product_id ) {
@ -1295,8 +1386,9 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
* Add ability to get products by 'reviews_allowed' in WC_Product_Query.
*
* @since 3.2.0
* @param string $where where clause
* @param WP_Query $wp_query
* @param string $where Where clause.
* @param WP_Query $wp_query WP_Query instance.
* @return string
*/
public function reviews_allowed_query_where( $where, $wp_query ) {
global $wpdb;
@ -1316,7 +1408,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
* Get valid WP_Query args from a WC_Product_Query's query variables.
*
* @since 3.2.0
* @param array $query_vars query vars from a WC_Product_Query
* @param array $query_vars Query vars from a WC_Product_Query.
* @return array
*/
protected function get_wp_query_args( $query_vars ) {
@ -1369,13 +1461,14 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
$wp_query_args['date_query'] = array();
}
if ( ! isset( $wp_query_args['meta_query'] ) ) {
// phpcs:ignore WordPress.VIP.SlowDBQuery.slow_db_query_meta_query
$wp_query_args['meta_query'] = array();
}
// Handle product types.
if ( 'variation' === $query_vars['type'] ) {
$wp_query_args['post_type'] = 'product_variation';
} elseif ( is_array( $query_vars['type'] ) && in_array( 'variation', $query_vars['type'] ) ) {
} elseif ( is_array( $query_vars['type'] ) && in_array( 'variation', $query_vars['type'], true ) ) {
$wp_query_args['post_type'] = array( 'product_variation', 'product' );
$wp_query_args['tax_query'][] = array(
'relation' => 'OR',
@ -1547,7 +1640,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
*
* @since 3.2.0
*
* @param array $query_vars query vars from a WC_Product_Query
* @param array $query_vars Query vars from a WC_Product_Query.
*
* @return array|object
*/

View File

@ -4,8 +4,6 @@
*
* Based on https://pippinsplugins.com/batch-processing-for-big-data/
*
* @author Automattic
* @category Admin
* @package WooCommerce/Export
* @version 3.1.0
*/
@ -25,13 +23,6 @@ if ( ! class_exists( 'WC_CSV_Exporter', false ) ) {
*/
abstract class WC_CSV_Batch_Exporter extends WC_CSV_Exporter {
/**
* The file being exported to.
*
* @var string
*/
protected $file;
/**
* Page being exported
*
@ -43,11 +34,19 @@ abstract class WC_CSV_Batch_Exporter extends WC_CSV_Exporter {
* Constructor.
*/
public function __construct() {
$upload_dir = wp_upload_dir();
$this->file = trailingslashit( $upload_dir['basedir'] ) . $this->get_filename();
$this->column_names = $this->get_default_column_names();
}
/**
* Get file path to export to.
*
* @return string
*/
protected function get_file_path() {
$upload_dir = wp_upload_dir();
return trailingslashit( $upload_dir['basedir'] ) . $this->get_filename();
}
/**
* Get the file contents.
*
@ -56,11 +55,11 @@ abstract class WC_CSV_Batch_Exporter extends WC_CSV_Exporter {
*/
public function get_file() {
$file = '';
if ( @file_exists( $this->file ) ) {
$file = @file_get_contents( $this->file );
if ( @file_exists( $this->get_file_path() ) ) {
$file = @file_get_contents( $this->get_file_path() );
} else {
@file_put_contents( $this->file, '' );
@chmod( $this->file, 0664 );
@file_put_contents( $this->get_file_path(), '' );
@chmod( $this->get_file_path(), 0664 );
}
return $file;
}
@ -73,7 +72,7 @@ abstract class WC_CSV_Batch_Exporter extends WC_CSV_Exporter {
public function export() {
$this->send_headers();
$this->send_content( $this->get_file() );
@unlink( $this->file );
@unlink( $this->get_file_path() );
die();
}
@ -84,7 +83,7 @@ abstract class WC_CSV_Batch_Exporter extends WC_CSV_Exporter {
*/
public function generate_file() {
if ( 1 === $this->get_page() ) {
@unlink( $this->file );
@unlink( $this->get_file_path() );
}
$this->prepare_data_to_export();
$this->write_csv_data( $this->get_csv_data() );
@ -105,7 +104,7 @@ abstract class WC_CSV_Batch_Exporter extends WC_CSV_Exporter {
}
$file .= $data;
@file_put_contents( $this->file, $file );
@file_put_contents( $this->get_file_path(), $file );
}
/**

View File

@ -2,8 +2,6 @@
/**
* Handles CSV export.
*
* @author Automattic
* @category Admin
* @package WooCommerce/Export
* @version 3.1.0
*/
@ -24,6 +22,13 @@ abstract class WC_CSV_Exporter {
*/
protected $export_type = '';
/**
* Filename to export to.
*
* @var string
*/
protected $filename = 'wc-export.csv';
/**
* Batch limit.
*
@ -183,15 +188,23 @@ abstract class WC_CSV_Exporter {
header( 'Expires: 0' );
}
/**
* Set filename to export to.
*
* @param string $filename Filename to export to.
* @return string
*/
public function set_filename( $filename ) {
$this->filename = sanitize_file_name( str_replace( '.csv', '', $filename ) . '.csv' );
}
/**
* Generate and return a filename.
*
* @return string
*/
public function get_filename() {
$filename = 'wc-' . $this->export_type . '-export-' . date_i18n( 'Y-m-d', current_time( 'timestamp' ) ) . '.csv';
return sanitize_file_name( apply_filters( "woocommerce_{$this->export_type}_export_get_filename", $filename ) );
return sanitize_file_name( apply_filters( "woocommerce_{$this->export_type}_export_get_filename", $this->filename ) );
}
/**
@ -365,9 +378,14 @@ abstract class WC_CSV_Exporter {
$data = $data ? 1 : 0;
}
$use_mb = function_exists( 'mb_convert_encoding' );
$data = (string) urldecode( $data );
if ( $use_mb ) {
$encoding = mb_detect_encoding( $data, 'UTF-8, ISO-8859-1', true );
$data = 'UTF-8' === $encoding ? $data : utf8_encode( $data );
}
return $this->escape_data( $data );
}

View File

@ -2,8 +2,6 @@
/**
* Handles product CSV export.
*
* @author Automattic
* @category Admin
* @package WooCommerce/Export
* @version 3.1.0
*/

View File

@ -2,8 +2,6 @@
/**
* Products shortcode
*
* @author Automattic
* @category Shortcodes
* @package WooCommerce/Shortcodes
* @version 3.2.4
*/
@ -474,7 +472,7 @@ class WC_Shortcode_Products {
* @return string
*/
protected function get_transient_name() {
$transient_name = 'wc_loop' . substr( md5( wp_json_encode( $this->query_args ) . $this->type ), 28 );
$transient_name = 'wc_product_loop' . substr( md5( wp_json_encode( $this->query_args ) . $this->type ), 28 );
if ( 'rand' === $this->query_args['orderby'] ) {
// When using rand, we'll cache a number of random queries and pull those to avoid querying rand on each page load.

View File

@ -660,6 +660,49 @@ function wc_mail( $to, $subject, $message, $headers = "Content-Type: text/html\r
$mailer->send( $to, $subject, $message, $headers, $attachments );
}
/**
* Return "theme support" values from the current theme, if set.
*
* @since 3.3.0
* @param string $prop Name of prop (or key::subkey for arrays of props) if you want a specific value. Leave blank to get all props as an array.
* @param mixed $default Optional value to return if the theme does not declare support for a prop.
* @return mixed Value of prop(s).
*/
function wc_get_theme_support( $prop = '', $default = null ) {
$theme_support = get_theme_support( 'woocommerce' );
$theme_support = is_array( $theme_support ) ? $theme_support[0] : false;
if ( ! $theme_support ) {
return $default;
}
if ( $prop ) {
$prop_stack = explode( '::', $prop );
$prop_key = array_shift( $prop_stack );
if ( isset( $theme_support[ $prop_key ] ) ) {
$value = $theme_support[ $prop_key ];
if ( count( $prop_stack ) ) {
foreach ( $prop_stack as $prop_key ) {
if ( is_array( $value ) && isset( $value[ $prop_key ] ) ) {
$value = $value[ $prop_key ];
} else {
$value = $default;
break;
}
}
}
} else {
$value = $default;
}
return $value;
}
return $theme_support;
}
/**
* Get an image size by name or defined dimensions.
*
@ -673,8 +716,6 @@ function wc_mail( $to, $subject, $message, $headers = "Content-Type: text/html\r
* @return array Array of dimensions including width, height, and cropping mode. Cropping mode is 0 for no crop, and 1 for hard crop.
*/
function wc_get_image_size( $image_size ) {
$theme_support = get_theme_support( 'woocommerce' );
$theme_support = is_array( $theme_support ) ? $theme_support[0] : false;
$size = array(
'width' => 600,
'height' => 600,
@ -689,23 +730,12 @@ function wc_get_image_size( $image_size ) {
);
$image_size = $size['width'] . '_' . $size['height'];
} elseif ( in_array( $image_size, array( 'single', 'shop_single', 'woocommerce_single' ), true ) ) {
// If the theme supports woocommerce, take image sizes from that definition.
if ( isset( $theme_support['single_image_width'] ) ) {
$size['width'] = $theme_support['single_image_width'];
} else {
$size['width'] = get_option( 'woocommerce_single_image_width', 600 );
}
$size['width'] = wc_get_theme_support( 'single_image_width', get_option( 'woocommerce_single_image_width', 600 ) );
$size['height'] = 9999999999;
$size['crop'] = 0;
$image_size = 'single';
} elseif ( in_array( $image_size, array( 'thumbnail', 'shop_thumbnail', 'shop_catalog', 'woocommerce_thumbnail' ), true ) ) {
// If the theme supports woocommerce, take image sizes from that definition.
if ( isset( $theme_support['thumbnail_image_width'] ) ) {
$size['width'] = $theme_support['thumbnail_image_width'];
} else {
$size['width'] = get_option( 'woocommerce_thumbnail_image_width', 300 );
}
$size['width'] = wc_get_theme_support( 'thumbnail_image_width', get_option( 'woocommerce_thumbnail_image_width', 300 ) );
$cropping = get_option( 'woocommerce_thumbnail_cropping', '1: 1' );
if ( 'uncropped' === $cropping ) {

View File

@ -833,14 +833,22 @@ function wc_get_product_backorder_options() {
* @return array
*/
function wc_get_related_products( $product_id, $limit = 5, $exclude_ids = array() ) {
$product_id = absint( $product_id );
$limit = $limit > 0 ? $limit : 5;
$exclude_ids = array_merge( array( 0, $product_id ), $exclude_ids );
$transient_name = 'wc_related_' . $product_id;
$related_posts = get_transient( $transient_name );
$limit = $limit > 0 ? $limit : 5;
$query_args = http_build_query( array(
'limit' => $limit,
'exclude_ids' => $exclude_ids,
) );
$transient = get_transient( $transient_name );
$related_posts = $transient && isset( $transient[ $query_args ] ) ? $transient[ $query_args ] : false;
// We want to query related posts if they are not cached, or we don't have enough.
if ( false === $related_posts || count( $related_posts ) < $limit ) {
$cats_array = apply_filters( 'woocommerce_product_related_posts_relate_by_category', true, $product_id ) ? apply_filters( 'woocommerce_get_related_product_cat_terms', wc_get_product_term_ids( $product_id, 'product_cat' ), $product_id ) : array();
$tags_array = apply_filters( 'woocommerce_product_related_posts_relate_by_tag', true, $product_id ) ? apply_filters( 'woocommerce_get_related_product_tag_terms', wc_get_product_term_ids( $product_id, 'product_tag' ), $product_id ) : array();
@ -852,9 +860,20 @@ function wc_get_related_products( $product_id, $limit = 5, $exclude_ids = array(
$related_posts = $data_store->get_related_products( $cats_array, $tags_array, $exclude_ids, $limit + 10, $product_id );
}
set_transient( $transient_name, $related_posts, DAY_IN_SECONDS );
if ( $transient ) {
$transient[ $query_args ] = $related_posts;
} else {
$transient = array( $query_args => $related_posts );
}
set_transient( $transient_name, $transient, DAY_IN_SECONDS );
}
$related_posts = apply_filters( 'woocommerce_related_products', $related_posts, $product_id, array(
'limit' => $limit,
'excluded_ids' => $exclude_ids,
) );
shuffle( $related_posts );
return array_slice( $related_posts, 0, $limit );

View File

@ -311,21 +311,19 @@ function wc_product_cat_class( $class = '', $category = null ) {
*/
function wc_get_default_products_per_row() {
$columns = get_option( 'woocommerce_catalog_columns', 3 );
$product_grid = wc_get_theme_support( 'product_grid' );
$min_columns = isset( $product_grid['min_columns'] ) ? absint( $product_grid['min_columns'] ) : 0;
$max_columns = isset( $product_grid['max_columns'] ) ? absint( $product_grid['max_columns'] ) : 0;
// Theme support.
$theme_support = get_theme_support( 'woocommerce' );
$theme_support = is_array( $theme_support ) ? $theme_support[0] : false;
if ( isset( $theme_support['product_grid']['min_columns'] ) && $columns < $theme_support['product_grid']['min_columns'] ) {
$columns = $theme_support['product_grid']['min_columns'];
if ( $min_columns && $columns < $min_columns ) {
$columns = $min_columns;
update_option( 'woocommerce_catalog_columns', $columns );
} elseif ( ! empty( $theme_support['product_grid']['max_columns'] ) && $columns > $theme_support['product_grid']['max_columns'] ) {
$columns = $theme_support['product_grid']['max_columns'];
} elseif ( $max_columns && $columns > $max_columns ) {
$columns = $max_columns;
update_option( 'woocommerce_catalog_columns', $columns );
}
// Legacy filter.
if ( has_filter( 'loop_shop_columns' ) ) {
if ( has_filter( 'loop_shop_columns' ) ) { // Legacy filter handling.
$columns = apply_filters( 'loop_shop_columns', $columns );
}
@ -340,16 +338,15 @@ function wc_get_default_products_per_row() {
*/
function wc_get_default_product_rows_per_page() {
$rows = absint( get_option( 'woocommerce_catalog_rows', 4 ) );
$product_grid = wc_get_theme_support( 'product_grid' );
$min_rows = isset( $product_grid['min_rows'] ) ? absint( $product_grid['min_rows'] ): 0;
$max_rows = isset( $product_grid['max_rows'] ) ? absint( $product_grid['max_rows'] ): 0;
// Theme support.
$theme_support = get_theme_support( 'woocommerce' );
$theme_support = is_array( $theme_support ) ? $theme_support[0] : false;
if ( isset( $theme_support['product_grid']['min_rows'] ) && $rows < $theme_support['product_grid']['min_rows'] ) {
$rows = $theme_support['product_grid']['min_rows'];
if ( $min_rows && $rows < $min_rows ) {
$rows = $min_rows;
update_option( 'woocommerce_catalog_rows', $rows );
} elseif ( ! empty( $theme_support['product_grid']['max_rows'] ) && $rows > $theme_support['product_grid']['max_rows'] ) {
$rows = $theme_support['product_grid']['max_rows'];
} elseif ( $max_rows && $rows > $max_rows ) {
$rows = $max_rows;
update_option( 'woocommerce_catalog_rows', $rows );
}
@ -362,19 +359,14 @@ function wc_get_default_product_rows_per_page() {
* @since 3.3.0
*/
function wc_reset_product_grid_settings() {
$theme_support = get_theme_support( 'woocommerce' );
$theme_support = is_array( $theme_support ) ? $theme_support[0] : false;
$product_grid = wc_get_theme_support( 'product_grid' );
if ( isset( $theme_support['product_grid']['default_rows'] ) ) {
update_option( 'woocommerce_catalog_rows', absint( $theme_support['product_grid']['default_rows'] ) );
} else {
delete_option( 'woocommerce_catalog_rows' );
if ( ! empty( $product_grid['default_rows'] ) ) {
update_option( 'woocommerce_catalog_rows', absint( $product_grid['default_rows'] ) );
}
if ( isset( $theme_support['product_grid']['default_rows'] ) ) {
update_option( 'woocommerce_catalog_columns', absint( $theme_support['product_grid']['default_columns'] ) );
} else {
delete_option( 'woocommerce_catalog_columns' );
if ( ! empty( $product_grid['default_columns'] ) ) {
update_option( 'woocommerce_catalog_columns', absint( $product_grid['default_columns'] ) );
}
}
add_action( 'after_switch_theme', 'wc_reset_product_grid_settings' );
@ -778,7 +770,11 @@ if ( ! function_exists( 'woocommerce_template_loop_product_link_open' ) ) {
* Insert the opening anchor tag for products in the loop.
*/
function woocommerce_template_loop_product_link_open() {
echo '<a href="' . esc_url( get_the_permalink() ) . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">';
global $product;
$link = apply_filters( 'woocommerce_loop_product_link', get_the_permalink(), $product );
echo '<a href="' . esc_url( $link ) . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">';
}
}

View File

@ -47,7 +47,7 @@
"istanbul": "^1.0.0-alpha",
"mocha": "^3.0.2",
"stylelint": "~8.2.0",
"wc-e2e-page-objects": "0.5.0"
"wc-e2e-page-objects": "0.6.0"
},
"engines": {
"node": ">=8.9.3",

View File

@ -161,7 +161,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woocommerce/wo
== Changelog ==
= 3.3.0 - 2017-XX-XX =
= 3.3.0 - 2018-XX-XX =
* Feature - Improved default appearance in themes which do not support WooCommerce, making the shop page shortcode based.
* Feature - Products shortcodes; improved random sorting, with some caching.
* Feature - Products shortcodes; support for pagination.

View File

@ -165,7 +165,6 @@ h1 {
margin: 0;
text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>;
text-shadow: 0 1px 0 <?php echo esc_attr( $base_lighter_20 ); ?>;
-webkit-font-smoothing: antialiased;
}
h2 {

View File

@ -4,6 +4,10 @@
"admin": {
"username": "admin",
"password": "password"
},
"customer": {
"username": "Customer",
"password": "password"
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,122 @@
/**
* External dependencies
*/
import config from 'config';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import test from 'selenium-webdriver/testing';
import { WebDriverManager, WebDriverHelper as helper } from 'wp-e2e-webdriver';
import { CustomerFlow, MyAccountPage, PageMap } from 'wc-e2e-page-objects';
chai.use( chaiAsPromised );
const assert = chai.assert;
let manager;
let driver;
test.describe( 'My account page', function() {
const loginAsCustomer = () => {
return new CustomerFlow( driver, {
baseUrl: config.get( 'url' ),
username: config.get( 'users.customer.username' ),
password: config.get( 'users.customer.password' )
} );
};
const getMyAccountSubPageUrl = path => {
return PageMap.getPageUrl( config.get( 'url' ), {
path: '/my-account/%s'
}, path );
};
const untrailingslashit = url => {
return url.endsWith( '/' ) ? url.substring( 0, url.length - 1 ) : url;
};
// open browser
test.before( function() {
this.timeout( config.get( 'startBrowserTimeoutMs' ) );
manager = new WebDriverManager( 'chrome', { baseUrl: config.get( 'url' ) } );
driver = manager.getDriver();
helper.clearCookiesAndDeleteLocalStorage( driver );
} );
this.timeout( config.get( 'mochaTimeoutMs' ) );
test.it( 'allows customer to login', () => {
loginAsCustomer();
const myAccount = new MyAccountPage( driver, {
baseUrl: config.get( 'url' ),
visit: false
} );
assert.eventually.ok( myAccount.hasText( 'Hello Customer' ), 'see "Hello Customer" text' );
assert.eventually.ok( myAccount.hasMenu( 'Dashboard' ), 'see Dashboard menu.' );
assert.eventually.ok( myAccount.hasMenu( 'Orders' ), 'see Orders menu' );
} );
test.it( 'allows customer to see orders', () => {
loginAsCustomer();
const myAccount = new MyAccountPage( driver, {
baseUrl: config.get( 'url' ),
visit: false
} );
myAccount.clickMenu( 'Orders' );
assert.eventually.equal(
driver.getCurrentUrl().then( untrailingslashit ),
untrailingslashit( getMyAccountSubPageUrl( 'orders' ) )
);
assert.eventually.ok( myAccount.hasText( 'Orders' ), 'see "Orders" text' );
} );
test.it( 'allows customer to see downloads', () => {
loginAsCustomer();
const myAccount = new MyAccountPage( driver, {
baseUrl: config.get( 'url' ),
visit: false
} );
myAccount.clickMenu( 'Downloads' );
assert.eventually.equal(
driver.getCurrentUrl().then( untrailingslashit ),
untrailingslashit( getMyAccountSubPageUrl( 'downloads' ) )
);
assert.eventually.ok( myAccount.hasText( 'Downloads' ), 'see "Downloads" text' );
} );
test.it( 'allows customer to edit addresses', () => {
loginAsCustomer();
const myAccount = new MyAccountPage( driver, {
baseUrl: config.get( 'url' ),
visit: false
} );
myAccount.clickMenu( 'Addresses' );
assert.eventually.equal(
driver.getCurrentUrl().then( untrailingslashit ),
untrailingslashit( getMyAccountSubPageUrl( 'edit-address' ) )
);
assert.eventually.ok( myAccount.hasText( 'Addresses' ), 'see "Addresses" text' );
} );
test.it( 'allows customer to edit account details', () => {
loginAsCustomer();
const myAccount = new MyAccountPage( driver, {
baseUrl: config.get( 'url' ),
visit: false
} );
myAccount.clickMenu( 'Account details' );
assert.eventually.equal(
driver.getCurrentUrl().then( untrailingslashit ),
untrailingslashit( getMyAccountSubPageUrl( 'edit-account' ) )
);
assert.eventually.ok( myAccount.hasText( 'Account details' ), 'see "Account details" text' );
} );
// quit browser
test.after( () => {
manager.quitBrowser();
} );
} );

View File

@ -16,6 +16,13 @@ let manager;
let driver;
test.describe( 'Single Product Page', function() {
const visitProductByPath = path => {
return new SingleProductPage( driver, { url: manager.getPageUrl( path ) } );
};
const visitCart = () => {
return new CartPage( driver, { url: manager.getPageUrl( '/cart' ) } );
};
// open browser
test.before( function() {
this.timeout( config.get( 'startBrowserTimeoutMs' ) );
@ -29,28 +36,29 @@ test.describe( 'Single Product Page', function() {
this.timeout( config.get( 'mochaTimeoutMs' ) );
test.it( 'should be able to add simple products to the cart', () => {
const productPage = new SingleProductPage( driver, { url: manager.getPageUrl( '/product/t-shirt' ) } );
const productPage = visitProductByPath( '/product/t-shirt' );
productPage.setQuantity( 5 );
productPage.addToCart();
const cartPage = new CartPage( driver, { url: manager.getPageUrl( '/cart' ) } );
assert.eventually.equal( cartPage.hasItem( 'T-Shirt', { qty: 5 } ), true );
assert.eventually.equal( visitCart().hasItem( 'T-Shirt', { qty: 5 } ), true );
} );
test.it( 'should be able to add variation products to the cart', () => {
const variableProductPage = new SingleProductPage( driver, { url: manager.getPageUrl( '/product/hoodie' ) } );
let variableProductPage;
variableProductPage = visitProductByPath( '/product/hoodie' );
variableProductPage.selectVariation( 'Color', 'Blue' );
variableProductPage.addToCart();
// Pause for a half-second. Driver goes too fast and makes wrong selections otherwise.
variableProductPage.selectVariation( 'Logo', 'Yes' );
driver.sleep( 500 );
variableProductPage.selectVariation( 'Color', 'Green' );
variableProductPage.addToCart();
assert.eventually.ok( visitCart().hasItem( 'Hoodie - Blue, Yes' ), '"Hoodie - Blue, Yes" in the cart' );
const cartPage = new CartPage( driver, { url: manager.getPageUrl( '/cart' ) } );
assert.eventually.equal( cartPage.hasItem( 'Hoodie - Blue' ), true );
assert.eventually.equal( cartPage.hasItem( 'Hoodie - Green' ), true );
variableProductPage = visitProductByPath( '/product/hoodie' );
variableProductPage.selectVariation( 'Color', 'Green' );
variableProductPage.selectVariation( 'Logo', 'No' );
driver.sleep( 500 );
variableProductPage.addToCart();
assert.eventually.ok( visitCart().hasItem( 'Hoodie - Green, No' ), '"Hoodie - Green, No" in the cart' );
} );
// quit browser

View File

@ -330,6 +330,92 @@ class WC_Tests_API_Orders extends WC_REST_Unit_Test_Case {
WC_Helper_Order::delete_order( $order->get_id() );
}
/**
* Tests updating an order and adding a coupon.
*
* @since 3.3.0
*/
public function test_update_order_add_coupons() {
wp_set_current_user( $this->user );
$order = WC_Helper_Order::create_order();
$order_item = current( $order->get_items() );
$coupon = WC_Helper_Coupon::create_coupon( 'fake-coupon' );
$coupon->set_amount( 5 );
$coupon->save();
$request = new WP_REST_Request( 'PUT', '/wc/v2/orders/' . $order->get_id() );
$request->set_body_params( array(
'coupon_lines' => array(
array(
'code' => 'fake-coupon',
'discount_total' => '5',
'discount_tax' => '0',
),
),
'line_items' => array(
array(
'id' => $order_item->get_id(),
'product_id' => $order_item->get_product_id(),
'total' => '35.00',
),
),
) );
$response = $this->server->dispatch( $request );
$data = $response->get_data();
$this->assertEquals( 200, $response->get_status() );
$this->assertCount( 1, $data['coupon_lines'] );
$this->assertEquals( '45.00', $data['total'] );
WC_Helper_Order::delete_order( $order->get_id() );
}
/**
* Tests updating an order and removing a coupon.
*
* @since 3.3.0
*/
public function test_update_order_remove_coupons() {
wp_set_current_user( $this->user );
$order = WC_Helper_Order::create_order();
$order_item = current( $order->get_items() );
$coupon = WC_Helper_Coupon::create_coupon( 'fake-coupon' );
$coupon->set_amount( 5 );
$coupon->save();
$order->apply_coupon( $coupon );
$order->save();
// Check that the coupon is applied.
$this->assertEquals( '45.00', $order->get_total() );
$request = new WP_REST_Request( 'PUT', '/wc/v2/orders/' . $order->get_id() );
$coupon_data = current( $order->get_items( 'coupon' ) );
$request->set_body_params( array(
'coupon_lines' => array(
array(
'id' => $coupon_data->get_id(),
'code' => null,
),
),
'line_items' => array(
array(
'id' => $order_item->get_id(),
'product_id' => $order_item->get_product_id(),
'total' => '40.00',
),
),
) );
$response = $this->server->dispatch( $request );
$data = $response->get_data();
$this->assertEquals( 200, $response->get_status() );
$this->assertTrue( empty( $data['coupon_lines'] ) );
$this->assertEquals( '50.00', $data['total'] );
WC_Helper_Order::delete_order( $order->get_id() );
}
/**
* Tests updating an order without the correct permissions.
*

View File

@ -3,7 +3,7 @@
* Plugin Name: WooCommerce
* Plugin URI: https://woocommerce.com/
* Description: An eCommerce toolkit that helps you sell anything. Beautifully.
* Version: 3.3.0-beta.1
* Version: 3.3.0-beta.2
* Author: Automattic
* Author URI: https://woocommerce.com
*