Merge branch 'master' of github.com:woothemes/woocommerce into create_order_with_product_sku
This commit is contained in:
commit
b8578c044d
|
@ -1,18 +1,9 @@
|
|||
@-moz-keyframes spin {
|
||||
/**
|
||||
* _animation.scss
|
||||
* Custom WooCommerce Animations.
|
||||
*/
|
||||
@include keyframes( spin ) {
|
||||
100% {
|
||||
-moz-transform: rotate(360deg);
|
||||
@include transform( rotate(360deg) );
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes spin {
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform:rotate(360deg);
|
||||
}
|
||||
}
|
|
@ -127,11 +127,11 @@
|
|||
}
|
||||
|
||||
@mixin darkorlighttextshadow($a, $opacity: .8) {
|
||||
@if lightness($a) >= 65% {
|
||||
@include text_shadow(0, -1px, 0, rgba(0, 0, 0, $opacity));
|
||||
} @else {
|
||||
@include text_shadow(0, 1px, 0, rgba(255, 255, 255, $opacity));
|
||||
}
|
||||
@if lightness($a) >= 65% {
|
||||
@include text_shadow(0, -1px, 0, rgba(0, 0, 0, $opacity));
|
||||
} @else {
|
||||
@include text_shadow(0, 1px, 0, rgba(255, 255, 255, $opacity));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -228,14 +228,14 @@
|
|||
margin-top: -.5em;
|
||||
display: block;
|
||||
-webkit-animation: spin 1s ease-in-out infinite;
|
||||
-moz-animation: spin 1s ease-in-out infinite;
|
||||
animation: spin 1s ease-in-out infinite;
|
||||
content: "";
|
||||
background: url(../images/icons/loader.svg) center center;
|
||||
background-size: cover;
|
||||
-moz-animation: spin 1s ease-in-out infinite;
|
||||
animation: spin 1s ease-in-out infinite;
|
||||
content: "";
|
||||
background: url(../images/icons/loader.svg) center center;
|
||||
background-size: cover;
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
font-size: 2em;
|
||||
color: rgba(#000,0.75);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -306,7 +306,7 @@ table.wc_status_table {
|
|||
}
|
||||
|
||||
.text {
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
width: 99%;
|
||||
float: left;
|
||||
margin: 1px 1% 1px 1px;
|
||||
|
@ -345,7 +345,7 @@ table.wc_status_table {
|
|||
.weight,
|
||||
.stock,
|
||||
.length {
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
margin-left: 4.4em;
|
||||
}
|
||||
|
@ -353,7 +353,7 @@ table.wc_status_table {
|
|||
.length,
|
||||
.width,
|
||||
.height {
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
width: 25%;
|
||||
}
|
||||
}
|
||||
|
@ -674,13 +674,13 @@ ul.wc_coupon_list_block {
|
|||
|
||||
.button {
|
||||
width: 24px;
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
float: right;
|
||||
}
|
||||
|
||||
select {
|
||||
width: 225px;
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
|
@ -780,7 +780,7 @@ ul.wc_coupon_list_block {
|
|||
font-size: 1em !important;
|
||||
width: 10em;
|
||||
margin: 0 0 0 .5em;
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
|
||||
input[type="text"] {
|
||||
width: 96%;
|
||||
|
@ -958,7 +958,7 @@ ul.wc_coupon_list_block {
|
|||
|
||||
input {
|
||||
width: 100%;
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
border: 0;
|
||||
box-shadow: none;
|
||||
margin: 0;
|
||||
|
@ -1248,7 +1248,7 @@ ul.wc_coupon_list_block {
|
|||
ul.order_actions {
|
||||
li {
|
||||
padding: 6px 10px;
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: 0;
|
||||
|
@ -2121,7 +2121,7 @@ img.help_tip {
|
|||
width: 100%;
|
||||
margin: 0;
|
||||
font-family: monospace;
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.iris-picker {
|
||||
|
@ -2225,7 +2225,7 @@ img.help_tip {
|
|||
background: #f7f7f7;
|
||||
@include border-radius(2px);
|
||||
position: relative;
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
|
@ -2431,7 +2431,7 @@ img.help_tip {
|
|||
padding: 0 0 10px;
|
||||
background-color: #fafafa;
|
||||
border-right: 1px solid #eee;
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
|
||||
&:after {
|
||||
content: "";
|
||||
|
@ -2702,7 +2702,7 @@ img.help_tip {
|
|||
}
|
||||
|
||||
.woocommerce_options_panel {
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
|
||||
.downloadable_files {
|
||||
padding: 0 9px 0 162px;
|
||||
|
@ -3670,7 +3670,7 @@ img.ui-datepicker-trigger {
|
|||
padding: 6px 0 0 0;
|
||||
border-top: 4px solid #999;
|
||||
text-align: center;
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
|
@ -4036,7 +4036,7 @@ table.bar_chart {
|
|||
*/
|
||||
.wc-backbone-modal {
|
||||
* {
|
||||
@include box-sizing(content-box);
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.wc-backbone-modal-content {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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;float:left;font-size:.8em;border-left:1px solid #fff;border-right:1px solid #ececec;text-align:center;-webkit-box-sizing:border-box;-moz-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;-moz-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;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;-webkit-font-smoothing:antialiased;margin:0 12px 12px 0;text-indent:0;top:0;left:0;height:100%;text-align:center;content:"";font-size:2em;position:relative;width:auto;line-height:1.2em;color:#464646;float:left}#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{content:"\e01f"}#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:"\e02c";color:#ffba00}#woocommerce_dashboard_status .wc_status_list li.out-of-stock a:before{content:"\e02c";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;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:#b3b3b3;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;float:left;font-size:.8em;border-left:1px solid #fff;border-right:1px solid #ececec;text-align:center;box-sizing:border-box}ul.woocommerce_stats li:first-child{border-left:0}ul.woocommerce_stats li:last-child{border-right:0}#woocommerce_dashboard_status .wc_status_list li.low-in-stock,#woocommerce_dashboard_status .wc_status_list li.processing-orders{border-right:1px solid #ececec}ul.woocommerce_stats strong{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:4em;line-height:1.2em;font-weight:400;text-align:center;display:block}#woocommerce_dashboard_status .inside{padding:0;margin:0}#woocommerce_dashboard_status .wc_status_list{overflow:hidden;margin:0}#woocommerce_dashboard_status .wc_status_list li{width:50%;float:left;padding:0;box-sizing:border-box;margin:0;border-top:1px solid #ececec;color:#aaa}#woocommerce_dashboard_status .wc_status_list li a{display:block;color:#aaa;padding:9px 12px;-webkit-transition:all ease .5s;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;-webkit-font-smoothing:antialiased;margin:0 12px 12px 0;text-indent:0;top:0;left:0;height:100%;text-align:center;content:"";font-size:2em;position:relative;width:auto;line-height:1.2em;color:#464646;float:left}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month,#woocommerce_dashboard_status .wc_status_list li.sales-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li:first-child{border-top:0}#woocommerce_dashboard_status .wc_status_list li.sales-this-month a:before{content:"\e01f"}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month a:before{content:"\e006"}#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 a:before{content:"\e02c";color:#ffba00}#woocommerce_dashboard_status .wc_status_list li.out-of-stock a:before{content:"\e02c";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;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:#b3b3b3;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"}
|
|
@ -27,7 +27,7 @@ ul.woocommerce_stats {
|
|||
border-left: 1px solid #fff;
|
||||
border-right: 1px solid #ececec;
|
||||
text-align: center;
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
li:first-child {
|
||||
|
@ -62,7 +62,7 @@ ul.woocommerce_stats {
|
|||
width: 50%;
|
||||
float: left;
|
||||
padding: 0;
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
border-top: 1px solid #ececec;
|
||||
color: #aaa;
|
||||
|
|
|
@ -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}#adminmenu #toplevel_page_woocommerce .menu-icon-generic div.wp-menu-image:before{font-family:WooCommerce!important;content:"\e03d";font-size:1.3em!important}#adminmenu #menu-posts-product .menu-icon-post div.wp-menu-image:before{font-family:WooCommerce!important;content:"\e01d";font-size:1.3em!important}#adminmenu #toplevel_page_wc-reports .menu-icon-generic div.wp-menu-image:before{font-family:WooCommerce!important;content:"\e023";font-size:1.3em!important}span.mce_woocommerce_shortcodes_button{background-image:none!important;display:block;text-indent:-9999px;position:relative;height:1em;width:1em}span.mce_woocommerce_shortcodes_button:before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";font-size:.9em;line-height:1.2}.wc_plugin_upgrade_notice{font-weight:400;color:#fff;background:#d54d21;padding:1em;margin:9px 0}.wc_plugin_upgrade_notice a{color:#fff;text-decoration:underline}.wc_plugin_upgrade_notice:before{content:"\f348";display:inline-block;font:400 18px/1 dashicons;speak:none;margin:0 8px 0 -2px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top}
|
||||
@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}#adminmenu #toplevel_page_woocommerce .menu-icon-generic div.wp-menu-image:before{font-family:WooCommerce!important;content:"\e03d";font-size:1.3em!important}#adminmenu #menu-posts-product .menu-icon-post div.wp-menu-image:before{font-family:WooCommerce!important;content:"\e01d";font-size:1.3em!important}#adminmenu #toplevel_page_wc-reports .menu-icon-generic div.wp-menu-image:before{font-family:WooCommerce!important;content:"\e023";font-size:1.3em!important}span.mce_woocommerce_shortcodes_button{background-image:none!important;display:block;text-indent:-9999px;position:relative;height:1em;width:1em}span.mce_woocommerce_shortcodes_button:before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";font-size:.9em;line-height:1.2}.wc_plugin_upgrade_notice{font-weight:400;color:#fff;background:#d54d21;padding:1em;margin:9px 0}.wc_plugin_upgrade_notice a{color:#fff;text-decoration:underline}.wc_plugin_upgrade_notice:before{content:"\f348";display:inline-block;font:400 18px/1 dashicons;speak:none;margin:0 8px 0 -2px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top}
|
File diff suppressed because one or more lines are too long
|
@ -232,11 +232,20 @@ div.pp_woocommerce {
|
|||
}
|
||||
}
|
||||
|
||||
// RTL support
|
||||
.rtl {
|
||||
div.pp_woocommerce {
|
||||
.pp_content_container {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 768px) {
|
||||
div.pp_woocommerce {
|
||||
left: 5% !important;
|
||||
right: 5% !important;
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
width: 90% !important;
|
||||
|
||||
.pp_gallery,
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -309,7 +309,7 @@
|
|||
}
|
||||
|
||||
.input-text {
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
@ -462,4 +462,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -134,7 +134,7 @@
|
|||
.button,
|
||||
.input-text {
|
||||
width: 48%;
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.input-text + .button,
|
||||
|
@ -175,7 +175,7 @@
|
|||
#place_order {
|
||||
float: none;
|
||||
width: 100%;
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -889,7 +889,7 @@ p.demo_store {
|
|||
}
|
||||
|
||||
textarea {
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
@ -1277,7 +1277,7 @@ p.demo_store {
|
|||
|
||||
input.input-text,
|
||||
textarea {
|
||||
@include box-sizing(border-box);
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
outline: 0;
|
||||
|
@ -1474,6 +1474,8 @@ p.demo_store {
|
|||
.ui-slider {
|
||||
position: relative;
|
||||
text-align: left;
|
||||
margin-left: .5em;
|
||||
margin-right: .5em;
|
||||
}
|
||||
|
||||
.ui-slider .ui-slider-handle {
|
||||
|
@ -1487,9 +1489,9 @@ p.demo_store {
|
|||
outline: none;
|
||||
top: -.3em;
|
||||
|
||||
&:last-child {
|
||||
margin-left: -.8em;
|
||||
}
|
||||
//&:last-child {
|
||||
margin-left: -.5em;
|
||||
//}
|
||||
}
|
||||
|
||||
.ui-slider .ui-slider-range {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -828,10 +828,13 @@ abstract class WC_Abstract_Order {
|
|||
$this->customer_note = $result->post_excerpt;
|
||||
$this->post_status = $result->post_status;
|
||||
|
||||
// Billing email cam default to user if set
|
||||
// Billing email can default to user if set
|
||||
if ( empty( $this->billing_email ) && ! empty( $this->customer_user ) && ( $user = get_user_by( 'id', $this->customer_user ) ) ) {
|
||||
$this->billing_email = $user->user_email;
|
||||
}
|
||||
|
||||
// Orders store the state of prices including tax when created
|
||||
$this->prices_include_tax = metadata_exists( 'post', $this->id, '_prices_include_tax' ) ? get_post_meta( $this->id, '_prices_include_tax', true ) : $this->prices_include_tax;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1263,11 +1266,30 @@ abstract class WC_Abstract_Order {
|
|||
* @return float
|
||||
*/
|
||||
public function get_total_discount( $ex_tax = true ) {
|
||||
if ( $ex_tax ) {
|
||||
return apply_filters( 'woocommerce_order_amount_total_discount', (double) $this->cart_discount, $this );
|
||||
if ( ! $this->order_version || version_compare( $this->order_version, '2.3.7', '<' ) ) {
|
||||
// Backwards compatible total calculation - totals were not stored consistently in old versions.
|
||||
if ( $ex_tax ) {
|
||||
if ( $this->prices_include_tax ) {
|
||||
$total_discount = (double) $this->cart_discount - (double) $this->cart_discount_tax;
|
||||
} else {
|
||||
$total_discount = (double) $this->cart_discount;
|
||||
}
|
||||
} else {
|
||||
if ( $this->prices_include_tax ) {
|
||||
$total_discount = (double) $this->cart_discount;
|
||||
} else {
|
||||
$total_discount = (double) $this->cart_discount + (double) $this->cart_discount_tax;
|
||||
}
|
||||
}
|
||||
// New logic - totals are always stored exclusive of tax, tax total is stored in cart_discount_tax
|
||||
} else {
|
||||
return apply_filters( 'woocommerce_order_amount_total_discount', (double) $this->cart_discount + (double) $this->cart_discount_tax, $this );
|
||||
if ( $ex_tax ) {
|
||||
$total_discount = (double) $this->cart_discount;
|
||||
} else {
|
||||
$total_discount = (double) $this->cart_discount + (double) $this->cart_discount_tax;
|
||||
}
|
||||
}
|
||||
return apply_filters( 'woocommerce_order_amount_total_discount', $total_discount, $this );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1378,7 +1400,7 @@ abstract class WC_Abstract_Order {
|
|||
|
||||
$price = $round ? number_format( (float) $price, 2, '.', '' ) : $price;
|
||||
|
||||
return apply_filters( 'woocommerce_order_amount_item_subtotal', $price, $this, $item );
|
||||
return apply_filters( 'woocommerce_order_amount_item_subtotal', $price, $this, $item, $inc_tax, $round );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1399,7 +1421,7 @@ abstract class WC_Abstract_Order {
|
|||
|
||||
$price = $round ? round( $price, 2 ) : $price;
|
||||
|
||||
return apply_filters( 'woocommerce_order_amount_line_subtotal', $price, $this, $item );
|
||||
return apply_filters( 'woocommerce_order_amount_line_subtotal', $price, $this, $item, $inc_tax, $round );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1422,7 +1444,7 @@ abstract class WC_Abstract_Order {
|
|||
|
||||
$price = $round ? round( $price, 2 ) : $price;
|
||||
|
||||
return apply_filters( 'woocommerce_order_amount_item_total', $price, $this );
|
||||
return apply_filters( 'woocommerce_order_amount_item_total', $price, $this, $item, $inc_tax, $round );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1441,7 +1463,7 @@ abstract class WC_Abstract_Order {
|
|||
// Check if we need to round
|
||||
$line_total = $round ? round( $line_total, 2 ) : $line_total;
|
||||
|
||||
return apply_filters( 'woocommerce_order_amount_line_total', $line_total, $this );
|
||||
return apply_filters( 'woocommerce_order_amount_line_total', $line_total, $this, $item, $inc_tax, $round );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -243,7 +243,6 @@ abstract class WC_Settings_API {
|
|||
* @return string
|
||||
*/
|
||||
public function get_tooltip_html( $data ) {
|
||||
|
||||
if ( $data['desc_tip'] === true ) {
|
||||
$tip = $data['description'];
|
||||
} elseif ( ! empty( $data['desc_tip'] ) ) {
|
||||
|
@ -252,7 +251,7 @@ abstract class WC_Settings_API {
|
|||
$tip = '';
|
||||
}
|
||||
|
||||
return $tip ? '<img class="help_tip" data-tip="' . esc_attr( $tip ) . '" src="' . WC()->plugin_url() . '/assets/images/help.png" height="16" width="16" />' : '';
|
||||
return $tip ? '<img class="help_tip" data-tip="' . esc_attr( wc_sanitize_tooltip( $tip ) ) . '" src="' . WC()->plugin_url() . '/assets/images/help.png" height="16" width="16" />' : '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -659,7 +658,8 @@ abstract class WC_Settings_API {
|
|||
'options' => array()
|
||||
);
|
||||
|
||||
$data = wp_parse_args( $data, $defaults );
|
||||
$data = wp_parse_args( $data, $defaults );
|
||||
$value = (array) $this->get_option( $key, array() );
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
|
@ -673,7 +673,7 @@ abstract class WC_Settings_API {
|
|||
<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
|
||||
<select multiple="multiple" class="multiselect <?php echo esc_attr( $data['class'] ); ?>" name="<?php echo esc_attr( $field ); ?>[]" id="<?php echo esc_attr( $field ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); ?>>
|
||||
<?php foreach ( (array) $data['options'] as $option_key => $option_value ) : ?>
|
||||
<option value="<?php echo esc_attr( $option_key ); ?>" <?php selected( in_array( $option_key, $this->get_option( $key, array() ) ), true ); ?>><?php echo esc_attr( $option_value ); ?></option>
|
||||
<option value="<?php echo esc_attr( $option_key ); ?>" <?php selected( in_array( $option_key, $value ), true ); ?>><?php echo esc_attr( $option_value ); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php echo $this->get_description_html( $data ); ?>
|
||||
|
|
|
@ -45,7 +45,7 @@ class WC_Admin_Assets {
|
|||
|
||||
// Admin styles for WC pages only
|
||||
wp_enqueue_style( 'woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css', array(), WC_VERSION );
|
||||
wp_enqueue_style( 'jquery-ui-style', '//ajax.googleapis.com/ajax/libs/jqueryui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), WC_VERSION );
|
||||
wp_enqueue_style( 'jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), $jquery_version );
|
||||
wp_enqueue_style( 'wp-color-picker' );
|
||||
}
|
||||
|
||||
|
|
|
@ -163,6 +163,8 @@ class WC_Admin_Dashboard {
|
|||
<?php printf( _n( "<strong>%s product</strong> out of stock", "<strong>%s products</strong> out of stock", $outofstock_count, 'woocommerce' ), $outofstock_count ); ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php do_action( 'woocommerce_after_dashboard_status_widget', $reports ); ?>
|
||||
</ul>
|
||||
<?php
|
||||
}
|
||||
|
|
|
@ -477,9 +477,8 @@ class WC_Admin_Post_Types {
|
|||
|
||||
break;
|
||||
case 'customer_message' :
|
||||
|
||||
if ( $the_order->customer_message ) {
|
||||
echo '<span class="note-on tips" data-tip="' . esc_attr( $the_order->customer_message ) . '">' . __( 'Yes', 'woocommerce' ) . '</span>';
|
||||
echo '<span class="note-on tips" data-tip="' . esc_attr( wc_sanitize_tooltip( $the_order->customer_message ) ) . '">' . __( 'Yes', 'woocommerce' ) . '</span>';
|
||||
} else {
|
||||
echo '<span class="na">–</span>';
|
||||
}
|
||||
|
@ -536,7 +535,8 @@ class WC_Admin_Post_Types {
|
|||
if ( $post->comment_count ) {
|
||||
|
||||
// check the status of the post
|
||||
$status = ( 'trash' !== $post->post_status ) ? '' : 'post-trashed';
|
||||
$status = ( 'trash' !== $post->post_status ) ? '' : 'post-trashed';
|
||||
|
||||
$latest_notes = get_comments( array(
|
||||
'post_id' => $post->ID,
|
||||
'number' => 1,
|
||||
|
@ -546,9 +546,9 @@ class WC_Admin_Post_Types {
|
|||
$latest_note = current( $latest_notes );
|
||||
|
||||
if ( $post->comment_count == 1 ) {
|
||||
echo '<span class="note-on tips" data-tip="' . esc_attr( $latest_note->comment_content ) . '">' . __( 'Yes', 'woocommerce' ) . '</span>';
|
||||
echo '<span class="note-on tips" data-tip="' . esc_attr( wc_sanitize_tooltip( $latest_note->comment_content ) ) . '">' . __( 'Yes', 'woocommerce' ) . '</span>';
|
||||
} else {
|
||||
$note_tip = isset( $latest_note->comment_content ) ? esc_attr( $latest_note->comment_content . '<small style="display:block">' . sprintf( _n( 'plus %d other note', 'plus %d other notes', ( $post->comment_count - 1 ), 'woocommerce' ), ( $post->comment_count - 1 ) ) . '</small>' ) : sprintf( _n( '%d note', '%d notes', $post->comment_count, 'woocommerce' ), $post->comment_count );
|
||||
$note_tip = isset( $latest_note->comment_content ) ? esc_attr( wc_sanitize_tooltip( $latest_note->comment_content ) . '<small style="display:block">' . sprintf( _n( 'plus %d other note', 'plus %d other notes', ( $post->comment_count - 1 ), 'woocommerce' ), ( $post->comment_count - 1 ) ) . '</small>' ) : sprintf( _n( '%d note', '%d notes', $post->comment_count, 'woocommerce' ), $post->comment_count );
|
||||
|
||||
echo '<span class="note-on tips" data-tip="' . $note_tip . '">' . __( 'Yes', 'woocommerce' ) . '</span>';
|
||||
}
|
||||
|
@ -581,7 +581,7 @@ class WC_Admin_Post_Types {
|
|||
$customer_tip .= __( 'Tel:', 'woocommerce' ) . ' ' . $the_order->billing_phone;
|
||||
}
|
||||
|
||||
echo '<div class="tips" data-tip="' . esc_attr( $customer_tip ) . '">';
|
||||
echo '<div class="tips" data-tip="' . esc_attr( wc_sanitize_tooltip( $customer_tip ) ) . '">';
|
||||
|
||||
if ( $the_order->user_id ) {
|
||||
$user_info = get_userdata( $the_order->user_id );
|
||||
|
|
|
@ -621,7 +621,7 @@ class WC_Admin_Settings {
|
|||
if ( $description && in_array( $value['type'], array( 'textarea', 'radio' ) ) ) {
|
||||
$description = '<p style="margin-top:0">' . wp_kses_post( $description ) . '</p>';
|
||||
} elseif ( $description && in_array( $value['type'], array( 'checkbox' ) ) ) {
|
||||
$description = wp_kses_post( $description );
|
||||
$description = wp_kses_post( $description );
|
||||
} elseif ( $description ) {
|
||||
$description = '<span class="description">' . wp_kses_post( $description ) . '</span>';
|
||||
}
|
||||
|
|
|
@ -109,12 +109,10 @@ class WC_Meta_Box_Order_Downloads {
|
|||
|
||||
$format = array( '%d', '%s', '%s' );
|
||||
|
||||
$expiry = ( array_key_exists( $i, $access_expires ) && $access_expires[ $i ] != '' ) ? date_i18n( 'Y-m-d', strtotime( $access_expires[ $i ] ) ) : null;
|
||||
$expiry = ( array_key_exists( $i, $access_expires ) && '' != $access_expires[ $i ] ) ? date_i18n( 'Y-m-d', strtotime( $access_expires[ $i ] ) ) : null;
|
||||
|
||||
if ( ! is_null( $expiry ) ) {
|
||||
$data['access_expires'] = $expiry;
|
||||
$format[] = '%s';
|
||||
}
|
||||
$data['access_expires'] = $expiry;
|
||||
$format[] = '%s';
|
||||
|
||||
$wpdb->update( $wpdb->prefix . "woocommerce_downloadable_product_permissions",
|
||||
$data,
|
||||
|
|
|
@ -660,7 +660,7 @@ class WC_Meta_Box_Product_Data {
|
|||
<div id="message" class="inline woocommerce-message">
|
||||
<p><?php _e( 'Before adding variations, add and save some attributes on the <strong>Attributes</strong> tab.', 'woocommerce' ); ?></p>
|
||||
|
||||
<p class="submit"><a class="button-primary" href="<?php echo esc_url( apply_filters( 'woocommerce_docs_url', 'http://docs.woothemes.com/document/product-variations', 'product-variations' ) ); ?>" target="_blank"><?php _e( 'Learn more', 'woocommerce' ); ?></a></p>
|
||||
<p class="submit"><a class="button-primary" href="<?php echo esc_url( apply_filters( 'woocommerce_docs_url', 'http://docs.woothemes.com/document/variable-product/', 'product-variations' ) ); ?>" target="_blank"><?php _e( 'Learn more', 'woocommerce' ); ?></a></p>
|
||||
</div>
|
||||
|
||||
<?php else : ?>
|
||||
|
@ -1233,7 +1233,7 @@ class WC_Meta_Box_Product_Data {
|
|||
|
||||
for ( $i = 0; $i < $file_url_size; $i ++ ) {
|
||||
if ( ! empty( $file_urls[ $i ] ) ) {
|
||||
$file_url = 0 === strpos( $file_urls[ $i ], '[' ) ? wc_clean( $file_urls[ $i ] ) : esc_url_raw( $file_urls[ $i ] );
|
||||
$file_url = ( 0 === strpos( $file_urls[ $i ], '[' ) && 0 !== strpos( $file_urls[ $i ], 'http' ) ) ? wc_clean( $file_urls[ $i ] ) : esc_url_raw( $file_urls[ $i ] );
|
||||
$file_name = wc_clean( $file_names[ $i ] );
|
||||
$file_hash = md5( $file_url );
|
||||
$files[ $file_hash ] = array(
|
||||
|
|
|
@ -176,21 +176,22 @@ class WC_Settings_Tax extends WC_Settings_Page {
|
|||
|
||||
// get the order position of the first tax rate id
|
||||
$tax_rate_order = absint( $wpdb->get_var( $wpdb->prepare( "SELECT tax_rate_order FROM {$wpdb->prefix}woocommerce_tax_rates WHERE tax_rate_id = %s", $first_tax_rate_id ) ) );
|
||||
|
||||
|
||||
$index = isset( $tax_rate_order ) ? $tax_rate_order : 0;
|
||||
|
||||
// Loop posted fields
|
||||
foreach ( $_POST['tax_rate_country'] as $key => $value ) {
|
||||
$mode = 0 === strpos( $key, 'new-' ) ? 'insert' : 'update';
|
||||
$tax_rate = $this->get_posted_tax_rate( $key, $index ++, $current_class );
|
||||
$mode = 0 === strpos( $key, 'new-' ) ? 'insert' : 'update';
|
||||
$tax_rate = $this->get_posted_tax_rate( $key, $index ++, $current_class );
|
||||
|
||||
if ( 'insert' === $mode ) {
|
||||
$tax_rate_id = WC_Tax::_insert_tax_rate( $tax_rate );
|
||||
} elseif ( 1 == $_POST['remove_tax_rate'][ $key ] ) {
|
||||
WC_Tax::_delete_tax_rate( $key );
|
||||
$tax_rate_id = absint( $key );
|
||||
WC_Tax::_delete_tax_rate( $tax_rate_id );
|
||||
continue;
|
||||
} else {
|
||||
$tax_rate_id = $key;
|
||||
$tax_rate_id = absint( $key );
|
||||
WC_Tax::_update_tax_rate( $tax_rate_id, $tax_rate );
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
$php_version = phpversion();
|
||||
|
||||
if ( version_compare( $php_version, '5.4', '<' ) ) {
|
||||
echo '<mark class="error">' . sprintf( __( '%s - We recommend a minimum PHP version of 5.4. See: <a href="%s" target="_blank">How to update your PHP version</a>', 'woocommerce' ), esc_html( $php_version ), ' http://docs.woothemes.com/document/how-to-update-your-php-version/' ) . '</mark>';
|
||||
echo '<mark class="error">' . sprintf( __( '%s - We recommend a minimum PHP version of 5.4. See: <a href="%s" target="_blank">How to update your PHP version</a>', 'woocommerce' ), esc_html( $php_version ), 'http://docs.woothemes.com/document/how-to-update-your-php-version/' ) . '</mark>';
|
||||
} else {
|
||||
echo '<mark class="yes">' . esc_html( $php_version ) . '</mark>';
|
||||
}
|
||||
|
|
|
@ -341,6 +341,9 @@ function wc_save_order_items( $order_id, $items ) {
|
|||
// Set the currency
|
||||
add_post_meta( $order_id, '_order_currency', get_woocommerce_currency(), true );
|
||||
|
||||
// Update version after saving
|
||||
update_post_meta( $order_id, '_order_version', WC_VERSION );
|
||||
|
||||
// inform other plugins that the items have been saved
|
||||
do_action( 'woocommerce_saved_order_items', $order_id, $items );
|
||||
}
|
||||
|
|
|
@ -180,6 +180,7 @@ function woocommerce_wp_select( $field ) {
|
|||
$field['style'] = isset( $field['style'] ) ? $field['style'] : '';
|
||||
$field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : '';
|
||||
$field['value'] = isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true );
|
||||
$field['name'] = isset( $field['name'] ) ? $field['name'] : $field['id'];
|
||||
|
||||
// Custom attribute handling
|
||||
$custom_attributes = array();
|
||||
|
@ -191,7 +192,7 @@ function woocommerce_wp_select( $field ) {
|
|||
}
|
||||
}
|
||||
|
||||
echo '<p class="form-field ' . esc_attr( $field['id'] ) . '_field ' . esc_attr( $field['wrapper_class'] ) . '"><label for="' . esc_attr( $field['id'] ) . '">' . wp_kses_post( $field['label'] ) . '</label><select id="' . esc_attr( $field['id'] ) . '" name="' . esc_attr( $field['id'] ) . '" class="' . esc_attr( $field['class'] ) . '" style="' . esc_attr( $field['style'] ) . '" ' . implode( ' ', $custom_attributes ) . '>';
|
||||
echo '<p class="form-field ' . esc_attr( $field['id'] ) . '_field ' . esc_attr( $field['wrapper_class'] ) . '"><label for="' . esc_attr( $field['id'] ) . '">' . wp_kses_post( $field['label'] ) . '</label><select id="' . esc_attr( $field['id'] ) . '" name="' . esc_attr( $field['name'] ) . '" class="' . esc_attr( $field['class'] ) . '" style="' . esc_attr( $field['style'] ) . '" ' . implode( ' ', $custom_attributes ) . '>';
|
||||
|
||||
foreach ( $field['options'] as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '" ' . selected( esc_attr( $field['value'] ), esc_attr( $key ), false ) . '>' . esc_html( $value ) . '</option>';
|
||||
|
|
|
@ -366,7 +366,7 @@ class WC_API_Customers extends WC_API_Resource {
|
|||
|
||||
// Checks for an error in the customer creation.
|
||||
if ( is_wp_error( $id ) ) {
|
||||
throw new WC_API_Exception( 'woocommerce_api_cannot_create_customer', $id->get_error_message(), 400 );
|
||||
throw new WC_API_Exception( $id->get_error_code(), $id->get_error_message(), 400 );
|
||||
}
|
||||
|
||||
// Added customer data.
|
||||
|
|
|
@ -303,7 +303,7 @@ class WC_API_Orders extends WC_API_Resource {
|
|||
/**
|
||||
* Get the total number of orders
|
||||
*
|
||||
* @since 2.1
|
||||
* @since 2.4
|
||||
* @param string $status
|
||||
* @param array $filter
|
||||
* @return array
|
||||
|
@ -316,12 +316,28 @@ class WC_API_Orders extends WC_API_Resource {
|
|||
}
|
||||
|
||||
if ( ! empty( $status ) ) {
|
||||
$filter['status'] = $status;
|
||||
|
||||
if ( $status == 'any' ) {
|
||||
|
||||
$order_statuses = array();
|
||||
|
||||
foreach ( wc_get_order_statuses() as $slug => $name ) {
|
||||
$filter['status'] = str_replace( 'wc-', '', $slug );
|
||||
$query = $this->query_orders( $filter );
|
||||
$order_statuses[ str_replace( 'wc-', '', $slug ) ] = (int) $query->found_posts;
|
||||
}
|
||||
|
||||
return array( 'count' => $order_statuses );
|
||||
|
||||
} else {
|
||||
$filter['status'] = $status;
|
||||
}
|
||||
}
|
||||
|
||||
$query = $this->query_orders( $filter );
|
||||
|
||||
return array( 'count' => (int) $query->found_posts );
|
||||
|
||||
} catch ( WC_API_Exception $e ) {
|
||||
return new WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );
|
||||
}
|
||||
|
|
|
@ -264,7 +264,7 @@ class WC_API_Products extends WC_API_Resource {
|
|||
return $this->get_product( $id );
|
||||
} catch ( WC_API_Exception $e ) {
|
||||
// Remove the product when fails
|
||||
wp_delete_post( $id, true );
|
||||
$this->clear_product( $id );
|
||||
|
||||
return new WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );
|
||||
}
|
||||
|
@ -1256,7 +1256,10 @@ class WC_API_Products extends WC_API_Resource {
|
|||
}
|
||||
|
||||
update_post_meta( $variation_id, '_backorders', $backorders );
|
||||
wc_update_product_stock( $variation_id, wc_stock_amount( $variation['stock_quantity'] ) );
|
||||
|
||||
if ( isset( $variation['stock_quantity'] ) ) {
|
||||
wc_update_product_stock( $variation_id, wc_stock_amount( $variation['stock_quantity'] ) );
|
||||
}
|
||||
} else {
|
||||
delete_post_meta( $variation_id, '_backorders' );
|
||||
delete_post_meta( $variation_id, '_stock' );
|
||||
|
@ -1870,4 +1873,26 @@ class WC_API_Products extends WC_API_Resource {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear product
|
||||
*/
|
||||
protected function clear_product( $product_id ) {
|
||||
if ( 0 >= $product_id ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Delete product attachments
|
||||
$attachments = get_children( array(
|
||||
'post_parent' => $product_id,
|
||||
'post_status' => 'any',
|
||||
'post_type' => 'attachment',
|
||||
) );
|
||||
|
||||
foreach ( (array) $attachments as $attachment ) {
|
||||
wp_delete_attachment( $attachment->ID, true );
|
||||
}
|
||||
|
||||
// Delete product
|
||||
wp_delete_post( $product_id, true );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -452,7 +452,7 @@ class WC_AJAX {
|
|||
check_ajax_referer( 'add-attribute', 'security' );
|
||||
|
||||
$taxonomy = esc_attr( $_POST['taxonomy'] );
|
||||
$term = stripslashes( $_POST['term'] );
|
||||
$term = wc_clean( $_POST['term'] );
|
||||
|
||||
if ( taxonomy_exists( $taxonomy ) ) {
|
||||
|
||||
|
@ -463,10 +463,11 @@ class WC_AJAX {
|
|||
'error' => $result->get_error_message()
|
||||
) );
|
||||
} else {
|
||||
$term = get_term_by( 'id', $result['term_id'], $taxonomy );
|
||||
wp_send_json( array(
|
||||
'term_id' => $result['term_id'],
|
||||
'name' => $term,
|
||||
'slug' => sanitize_title( $term ),
|
||||
'term_id' => $term->term_id,
|
||||
'name' => $term->name,
|
||||
'slug' => $term->slug
|
||||
) );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1736,17 +1736,9 @@ class WC_Cart {
|
|||
$discount_amount = isset( $this->coupon_discount_amounts[ $code ] ) ? $this->coupon_discount_amounts[ $code ] : 0;
|
||||
|
||||
if ( $ex_tax ) {
|
||||
if ( $this->prices_include_tax ) {
|
||||
return $discount_amount - $this->get_coupon_discount_tax_amount( $code );
|
||||
} else {
|
||||
return $discount_amount;
|
||||
}
|
||||
return $discount_amount;
|
||||
} else {
|
||||
if ( $this->prices_include_tax ) {
|
||||
return $discount_amount;
|
||||
} else {
|
||||
return $discount_amount + $this->get_coupon_discount_tax_amount( $code );
|
||||
}
|
||||
return $discount_amount + $this->get_coupon_discount_tax_amount( $code );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1819,11 +1811,11 @@ class WC_Cart {
|
|||
$total_discount = $discount_amount * $values['quantity'];
|
||||
$total_discount_tax = 0;
|
||||
|
||||
if ( $this->prices_include_tax || $this->tax_display_cart === 'incl' ) {
|
||||
$tax_rates = WC_Tax::get_rates( $product->get_tax_class() );
|
||||
$taxes = WC_Tax::calc_tax( $discount_amount, $tax_rates, $this->prices_include_tax );
|
||||
$total_discount_tax = WC_Tax::get_tax_total( $taxes ) * $values['quantity'];
|
||||
}
|
||||
// Calc discounted tax
|
||||
$tax_rates = WC_Tax::get_rates( $product->get_tax_class() );
|
||||
$taxes = WC_Tax::calc_tax( $discount_amount, $tax_rates, $this->prices_include_tax );
|
||||
$total_discount_tax = WC_Tax::get_tax_total( $taxes ) * $values['quantity'];
|
||||
$total_discount = $this->prices_include_tax ? $total_discount - $total_discount_tax : $total_discount;
|
||||
|
||||
$this->discount_cart += $total_discount;
|
||||
$this->discount_cart_tax += $total_discount_tax;
|
||||
|
@ -2176,7 +2168,6 @@ class WC_Cart {
|
|||
return apply_filters( 'woocommerce_cart_total_discount', $total_discount, $this );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the total (product) discount amount - these are applied before tax.
|
||||
*
|
||||
|
|
|
@ -351,7 +351,7 @@ class WC_Countries {
|
|||
'BE' => $postcode_before_city,
|
||||
'CA' => "{company}\n{name}\n{address_1}\n{address_2}\n{city} {state} {postcode}\n{country}",
|
||||
'CH' => $postcode_before_city,
|
||||
'CL' => "{company}\n{name}\n{address_1}\n{address_2}\n{state}\n{city}",
|
||||
'CL' => "{company}\n{name}\n{address_1}\n{address_2}\n{state}\n{postcode} {city}\n{country}",
|
||||
'CN' => "{country} {postcode}\n{state}, {city}, {address_2}, {address_1}\n{company}\n{name}",
|
||||
'CZ' => $postcode_before_city,
|
||||
'DE' => $postcode_before_city,
|
||||
|
@ -520,7 +520,7 @@ class WC_Countries {
|
|||
'state' => array(
|
||||
'type' => 'state',
|
||||
'label' => __( 'State / County', 'woocommerce' ),
|
||||
'placeholder' => __( 'State / County', 'woocommerce' ),
|
||||
'placeholder' => __( 'Make a selection', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'class' => array( 'form-row-first', 'address-field' ),
|
||||
'validate' => array( 'state' )
|
||||
|
@ -556,6 +556,7 @@ class WC_Countries {
|
|||
/**
|
||||
* Get country locale settings.
|
||||
* @return array
|
||||
* @todo [2.4] Check select2 4.0.0 compatibility with `placeholder` attribute and uncomment relevant lines. https://github.com/woothemes/woocommerce/issues/7729
|
||||
*/
|
||||
public function get_country_locale() {
|
||||
if ( ! $this->locale ) {
|
||||
|
@ -590,7 +591,7 @@ class WC_Countries {
|
|||
),
|
||||
'state' => array(
|
||||
'label' => __( 'State', 'woocommerce' ),
|
||||
'placeholder' => __( 'State', 'woocommerce' ),
|
||||
//'placeholder' => __( 'State', 'woocommerce' ),
|
||||
)
|
||||
),
|
||||
'BD' => array(
|
||||
|
@ -599,7 +600,7 @@ class WC_Countries {
|
|||
),
|
||||
'state' => array(
|
||||
'label' => __( 'District', 'woocommerce' ),
|
||||
'placeholder' => __( 'District', 'woocommerce' ),
|
||||
//'placeholder' => __( 'District', 'woocommerce' ),
|
||||
)
|
||||
),
|
||||
'BE' => array(
|
||||
|
@ -607,7 +608,7 @@ class WC_Countries {
|
|||
'state' => array(
|
||||
'required' => false,
|
||||
'label' => __( 'Province', 'woocommerce' ),
|
||||
'placeholder' => __( 'Province', 'woocommerce' ),
|
||||
//'placeholder' => __( 'Province', 'woocommerce' ),
|
||||
),
|
||||
),
|
||||
'BI' => array(
|
||||
|
@ -630,14 +631,14 @@ class WC_Countries {
|
|||
'CA' => array(
|
||||
'state' => array(
|
||||
'label' => __( 'Province', 'woocommerce' ),
|
||||
'placeholder' => __( 'Province', 'woocommerce' ),
|
||||
//'placeholder' => __( 'Province', 'woocommerce' ),
|
||||
)
|
||||
),
|
||||
'CH' => array(
|
||||
'postcode_before_city' => true,
|
||||
'state' => array(
|
||||
'label' => __( 'Canton', 'woocommerce' ),
|
||||
'placeholder' => __( 'Canton', 'woocommerce' ),
|
||||
//'placeholder' => __( 'Canton', 'woocommerce' ),
|
||||
'required' => false
|
||||
)
|
||||
),
|
||||
|
@ -646,18 +647,17 @@ class WC_Countries {
|
|||
'required' => true,
|
||||
),
|
||||
'postcode' => array(
|
||||
'required' => false,
|
||||
'hidden' => true
|
||||
'required' => false
|
||||
),
|
||||
'state' => array(
|
||||
'label' => __( 'Region', 'woocommerce' ),
|
||||
'placeholder' => __( 'Region', 'woocommerce' )
|
||||
//'placeholder' => __( 'Region', 'woocommerce' )
|
||||
)
|
||||
),
|
||||
'CN' => array(
|
||||
'state' => array(
|
||||
'label' => __( 'Province', 'woocommerce' ),
|
||||
'placeholder' => __( 'Province', 'woocommerce' ),
|
||||
//'placeholder' => __( 'Province', 'woocommerce' ),
|
||||
)
|
||||
),
|
||||
'CO' => array(
|
||||
|
@ -710,19 +710,19 @@ class WC_Countries {
|
|||
),
|
||||
'state' => array(
|
||||
'label' => __( 'Region', 'woocommerce' ),
|
||||
'placeholder' => __( 'Region', 'woocommerce' ),
|
||||
//'placeholder' => __( 'Region', 'woocommerce' ),
|
||||
)
|
||||
),
|
||||
'HU' => array(
|
||||
'state' => array(
|
||||
'label' => __( 'County', 'woocommerce' ),
|
||||
'placeholder' => __( 'County', 'woocommerce' ),
|
||||
//'placeholder' => __( 'County', 'woocommerce' ),
|
||||
)
|
||||
),
|
||||
'ID' => array(
|
||||
'state' => array(
|
||||
'label' => __( 'Province', 'woocommerce' ),
|
||||
'placeholder' => __( 'Province', 'woocommerce' ),
|
||||
//'placeholder' => __( 'Province', 'woocommerce' ),
|
||||
)
|
||||
),
|
||||
'IS' => array(
|
||||
|
@ -742,7 +742,7 @@ class WC_Countries {
|
|||
'state' => array(
|
||||
'required' => true,
|
||||
'label' => __( 'Province', 'woocommerce' ),
|
||||
'placeholder' => __( 'Province', 'woocommerce' ),
|
||||
//'placeholder' => __( 'Province', 'woocommerce' ),
|
||||
)
|
||||
),
|
||||
'JP' => array(
|
||||
|
@ -760,7 +760,7 @@ class WC_Countries {
|
|||
'state' => array(
|
||||
'required' => false,
|
||||
'label' => __( 'Province', 'woocommerce' ),
|
||||
'placeholder' => __( 'Province', 'woocommerce' ),
|
||||
//'placeholder' => __( 'Province', 'woocommerce' ),
|
||||
)
|
||||
),
|
||||
'NZ' => array(
|
||||
|
@ -778,7 +778,7 @@ class WC_Countries {
|
|||
'postcode_before_city' => true,
|
||||
'state' => array(
|
||||
'label' => __( 'District', 'woocommerce' ),
|
||||
'placeholder' => __( 'District', 'woocommerce' ),
|
||||
//'placeholder' => __( 'District', 'woocommerce' ),
|
||||
),
|
||||
'postcode' => array(
|
||||
'required' => false,
|
||||
|
@ -822,14 +822,14 @@ class WC_Countries {
|
|||
'postcode_before_city' => true,
|
||||
'state' => array(
|
||||
'label' => __( 'Province', 'woocommerce' ),
|
||||
'placeholder' => __( 'Province', 'woocommerce' ),
|
||||
//'placeholder' => __( 'Province', 'woocommerce' ),
|
||||
)
|
||||
),
|
||||
'LI' => array(
|
||||
'postcode_before_city' => true,
|
||||
'state' => array(
|
||||
'label' => __( 'Municipality', 'woocommerce' ),
|
||||
'placeholder' => __( 'Municipality', 'woocommerce' ),
|
||||
//'placeholder' => __( 'Municipality', 'woocommerce' ),
|
||||
'required' => false
|
||||
)
|
||||
),
|
||||
|
@ -848,7 +848,7 @@ class WC_Countries {
|
|||
'postcode_before_city' => true,
|
||||
'state' => array(
|
||||
'label' => __( 'Province', 'woocommerce' ),
|
||||
'placeholder' => __( 'Province', 'woocommerce' ),
|
||||
//'placeholder' => __( 'Province', 'woocommerce' ),
|
||||
)
|
||||
),
|
||||
'US' => array(
|
||||
|
@ -858,7 +858,7 @@ class WC_Countries {
|
|||
),
|
||||
'state' => array(
|
||||
'label' => __( 'State', 'woocommerce' ),
|
||||
'placeholder' => __( 'State', 'woocommerce' ),
|
||||
//'placeholder' => __( 'State', 'woocommerce' ),
|
||||
)
|
||||
),
|
||||
'GB' => array(
|
||||
|
@ -868,7 +868,7 @@ class WC_Countries {
|
|||
),
|
||||
'state' => array(
|
||||
'label' => __( 'County', 'woocommerce' ),
|
||||
'placeholder' => __( 'County', 'woocommerce' ),
|
||||
//'placeholder' => __( 'County', 'woocommerce' ),
|
||||
'required' => false
|
||||
)
|
||||
),
|
||||
|
@ -895,7 +895,7 @@ class WC_Countries {
|
|||
'ZA' => array(
|
||||
'state' => array(
|
||||
'label' => __( 'Province', 'woocommerce' ),
|
||||
'placeholder' => __( 'Province', 'woocommerce' ),
|
||||
//'placeholder' => __( 'Province', 'woocommerce' ),
|
||||
)
|
||||
),
|
||||
'ZW' => array(
|
||||
|
@ -908,7 +908,7 @@ class WC_Countries {
|
|||
|
||||
$this->locale = array_intersect_key( $this->locale, array_merge( $this->get_allowed_countries(), $this->get_shipping_countries() ) );
|
||||
|
||||
// Default Locale Can be filters to override fields in get_address_fields().
|
||||
// Default Locale Can be filtered to override fields in get_address_fields().
|
||||
// Countries with no specific locale will use default.
|
||||
$this->locale['default'] = apply_filters('woocommerce_get_country_locale_default', $this->get_default_address_fields() );
|
||||
|
||||
|
|
|
@ -438,8 +438,7 @@ class WC_Query {
|
|||
$q->set( 'posts_per_page', $q->get( 'posts_per_page' ) ? $q->get( 'posts_per_page' ) : apply_filters( 'loop_shop_per_page', get_option( 'posts_per_page' ) ) );
|
||||
|
||||
// Set a special variable
|
||||
$q->set( 'wc_query', true );
|
||||
$q->query['wc_query'] = 'product_query';
|
||||
$q->set( 'wc_query', 'product_query' );
|
||||
|
||||
// Store variables
|
||||
$this->post__in = $post__in;
|
||||
|
@ -860,11 +859,11 @@ class WC_Query {
|
|||
public function price_filter( $filtered_posts = array() ) {
|
||||
global $wpdb;
|
||||
|
||||
if ( isset( $_GET['max_price'] ) && isset( $_GET['min_price'] ) ) {
|
||||
if ( isset( $_GET['max_price'] ) || isset( $_GET['min_price'] ) ) {
|
||||
|
||||
$matched_products = array();
|
||||
$min = floatval( $_GET['min_price'] );
|
||||
$max = floatval( $_GET['max_price'] );
|
||||
$min = isset( $_GET['min_price'] ) ? floatval( $_GET['min_price'] ) : 0;
|
||||
$max = isset( $_GET['max_price'] ) ? floatval( $_GET['max_price'] ) : 9999999999;
|
||||
|
||||
$matched_products_query = apply_filters( 'woocommerce_price_filter_results', $wpdb->get_results( $wpdb->prepare( '
|
||||
SELECT DISTINCT ID, post_parent, post_type FROM %1$s
|
||||
|
|
|
@ -811,22 +811,59 @@ class WC_Shortcodes {
|
|||
if ( isset( $atts['sku'] ) ) {
|
||||
$args['meta_query'][] = array(
|
||||
'key' => '_sku',
|
||||
'value' => $atts['sku'],
|
||||
'value' => sanitize_text_field( $atts['sku'] ),
|
||||
'compare' => '='
|
||||
);
|
||||
|
||||
$args['post_type'] = array( 'product', 'product_variation' );
|
||||
}
|
||||
|
||||
if ( isset( $atts['id'] ) ) {
|
||||
$args['p'] = $atts['id'];
|
||||
$args['p'] = absint( $atts['id'] );
|
||||
}
|
||||
|
||||
$single_product = new WP_Query( $args );
|
||||
|
||||
$preselected_id = '0';
|
||||
|
||||
// check if sku is a variation
|
||||
if ( isset( $atts['sku'] ) && $single_product->have_posts() && $single_product->post->post_type === 'product_variation' ) {
|
||||
|
||||
$variation = new WC_Product_Variation( $single_product->post->ID );
|
||||
$attributes = $variation->get_variation_attributes();
|
||||
|
||||
// set preselected id to be used by JS to provide context
|
||||
$preselected_id = $single_product->post->ID;
|
||||
|
||||
// get the parent product object
|
||||
$args = array(
|
||||
'posts_per_page' => 1,
|
||||
'post_type' => 'product',
|
||||
'post_status' => 'publish',
|
||||
'ignore_sticky_posts' => 1,
|
||||
'no_found_rows' => 1,
|
||||
'p' => $single_product->post->post_parent
|
||||
);
|
||||
|
||||
$single_product = new WP_Query( $args );
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
jQuery( document ).ready( function( $ ) {
|
||||
var $variations_form = $( '[data-product-page-preselected-id="<?php echo esc_attr( $preselected_id ); ?>"]' ).find( 'form.variations_form' );
|
||||
|
||||
<?php foreach( $attributes as $attr => $value ) { ?>
|
||||
$variations_form.find( 'select[name="<?php echo esc_attr( $attr ); ?>"]' ).val( '<?php echo $value; ?>' );
|
||||
<?php } ?>
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
ob_start();
|
||||
|
||||
while ( $single_product->have_posts() ) : $single_product->the_post(); wp_enqueue_script( 'wc-single-product' ); ?>
|
||||
|
||||
<div class="single-product">
|
||||
<div class="single-product" data-product-page-preselected-id="<?php echo esc_attr( $preselected_id ); ?>">
|
||||
|
||||
<?php wc_get_template_part( 'content', 'single-product' ); ?>
|
||||
|
||||
|
@ -839,7 +876,6 @@ class WC_Shortcodes {
|
|||
return '<div class="woocommerce">' . ob_get_clean() . '</div>';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show messages
|
||||
*
|
||||
|
|
|
@ -793,6 +793,8 @@ class WC_Tax {
|
|||
private static function _update_tax_rate_locations( $tax_rate_id, $values, $type ) {
|
||||
global $wpdb;
|
||||
|
||||
$tax_rate_id = absint( $tax_rate_id );
|
||||
|
||||
$wpdb->query(
|
||||
$wpdb->prepare( "
|
||||
DELETE FROM {$wpdb->prefix}woocommerce_tax_rate_locations WHERE tax_rate_id = %d AND location_type = %s;
|
||||
|
|
|
@ -9,8 +9,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
*
|
||||
* Provides a PayPal Standard Payment Gateway.
|
||||
*
|
||||
* @class WC_Paypal
|
||||
* @extends WC_Gateway_Paypal
|
||||
* @class WC_Gateway_Paypal
|
||||
* @extends WC_Payment_Gateway
|
||||
* @version 2.3.0
|
||||
* @package WooCommerce/Classes/Payment
|
||||
* @author WooThemes
|
||||
|
@ -36,12 +36,13 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
|
|||
$this->init_settings();
|
||||
|
||||
// Define user set variables
|
||||
$this->title = $this->get_option( 'title' );
|
||||
$this->description = $this->get_option( 'description' );
|
||||
$this->testmode = 'yes' === $this->get_option( 'testmode', 'no' );
|
||||
$this->email = $this->get_option( 'email' );
|
||||
$this->receiver_email = $this->get_option( 'receiver_email', $this->email );
|
||||
$this->identity_token = $this->get_option( 'identity_token' );
|
||||
$this->title = $this->get_option( 'title' );
|
||||
$this->description = $this->get_option( 'description' );
|
||||
$this->testmode = 'yes' === $this->get_option( 'testmode', 'no' );
|
||||
$this->debug = 'yes' === $this->get_option( 'debug', 'no' );
|
||||
$this->email = $this->get_option( 'email' );
|
||||
$this->receiver_email = $this->get_option( 'receiver_email', $this->email );
|
||||
$this->identity_token = $this->get_option( 'identity_token' );
|
||||
|
||||
add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
|
||||
|
||||
|
@ -63,7 +64,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
|
|||
* @param string $message
|
||||
*/
|
||||
public function log( $message ) {
|
||||
if ( $this->testmode ) {
|
||||
if ( $this->debug ) {
|
||||
if ( empty( $this->log ) ) {
|
||||
$this->log = new WC_Logger();
|
||||
}
|
||||
|
@ -238,7 +239,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
|
|||
}
|
||||
|
||||
/**
|
||||
* Can the order be refunded via paypal?
|
||||
* Can the order be refunded via PayPal?
|
||||
* @param WC_Order $order
|
||||
* @return bool
|
||||
*/
|
||||
|
|
|
@ -59,14 +59,13 @@ function wc_attribute_label( $name, $product = '' ) {
|
|||
$label = $wpdb->get_var( $wpdb->prepare( "SELECT attribute_label FROM {$wpdb->prefix}woocommerce_attribute_taxonomies WHERE attribute_name = %s;", $name ) );
|
||||
|
||||
if ( ! $label ) {
|
||||
$label = ucfirst( $name );
|
||||
$label = $name;
|
||||
}
|
||||
} elseif ( $product && ( $attributes = $product->get_attributes() ) && isset( $attributes[ sanitize_title( $name ) ]['name'] ) ) {
|
||||
// Attempt to get label from product, as entered by the user
|
||||
$label = $attributes[ sanitize_title( $name ) ]['name'];
|
||||
} else {
|
||||
// Just format as best as we can
|
||||
$label = ucwords( str_replace( '-', ' ', $name ) );
|
||||
$label = str_replace( '-', ' ', $name );
|
||||
}
|
||||
|
||||
return apply_filters( 'woocommerce_attribute_label', $label, $name, $product );
|
||||
|
|
|
@ -4,20 +4,18 @@
|
|||
*
|
||||
* Functions for determining the current query/page.
|
||||
*
|
||||
* @author WooThemes
|
||||
* @category Core
|
||||
* @package WooCommerce/Functions
|
||||
* @author WooThemes
|
||||
* @category Core
|
||||
* @package WooCommerce/Functions
|
||||
* @version 2.3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* is_woocommerce - Returns true if on a page which uses WooCommerce templates (cart and checkout are standard pages with shortcodes and thus are not included)
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function is_woocommerce() {
|
||||
|
@ -28,8 +26,6 @@ if ( ! function_exists( 'is_shop' ) ) {
|
|||
|
||||
/**
|
||||
* is_shop - Returns true when viewing the product type archive (shop).
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function is_shop() {
|
||||
|
@ -41,8 +37,6 @@ if ( ! function_exists( 'is_product_taxonomy' ) ) {
|
|||
|
||||
/**
|
||||
* is_product_taxonomy - Returns true when viewing a product taxonomy archive.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function is_product_taxonomy() {
|
||||
|
@ -54,9 +48,7 @@ if ( ! function_exists( 'is_product_category' ) ) {
|
|||
|
||||
/**
|
||||
* is_product_category - Returns true when viewing a product category.
|
||||
*
|
||||
* @access public
|
||||
* @param string $term (default: '') The term slug your checking for. Leave blank to return true on any.
|
||||
* @param string $term (default: '') The term slug your checking for. Leave blank to return true on any.
|
||||
* @return bool
|
||||
*/
|
||||
function is_product_category( $term = '' ) {
|
||||
|
@ -68,9 +60,7 @@ if ( ! function_exists( 'is_product_tag' ) ) {
|
|||
|
||||
/**
|
||||
* is_product_tag - Returns true when viewing a product tag.
|
||||
*
|
||||
* @access public
|
||||
* @param string $term (default: '') The term slug your checking for. Leave blank to return true on any.
|
||||
* @param string $term (default: '') The term slug your checking for. Leave blank to return true on any.
|
||||
* @return bool
|
||||
*/
|
||||
function is_product_tag( $term = '' ) {
|
||||
|
@ -82,8 +72,6 @@ if ( ! function_exists( 'is_product' ) ) {
|
|||
|
||||
/**
|
||||
* is_product - Returns true when viewing a single product.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function is_product() {
|
||||
|
@ -95,8 +83,6 @@ if ( ! function_exists( 'is_cart' ) ) {
|
|||
|
||||
/**
|
||||
* is_cart - Returns true when viewing the cart page.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function is_cart() {
|
||||
|
@ -108,8 +94,6 @@ if ( ! function_exists( 'is_checkout' ) ) {
|
|||
|
||||
/**
|
||||
* is_checkout - Returns true when viewing the checkout page.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function is_checkout() {
|
||||
|
@ -121,8 +105,6 @@ if ( ! function_exists( 'is_checkout_pay_page' ) ) {
|
|||
|
||||
/**
|
||||
* is_checkout_pay - Returns true when viewing the checkout's pay page.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function is_checkout_pay_page() {
|
||||
|
@ -136,8 +118,6 @@ if ( ! function_exists( 'is_wc_endpoint_url' ) ) {
|
|||
|
||||
/**
|
||||
* is_wc_endpoint_url - Check if an endpoint is showing
|
||||
*
|
||||
* @access public
|
||||
* @param string $endpoint
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -169,8 +149,6 @@ if ( ! function_exists( 'is_account_page' ) ) {
|
|||
|
||||
/**
|
||||
* is_account_page - Returns true when viewing an account page.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function is_account_page() {
|
||||
|
@ -182,8 +160,6 @@ if ( ! function_exists( 'is_view_order_page' ) ) {
|
|||
|
||||
/**
|
||||
* is_view_order_page - Returns true when on the view order page.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function is_view_order_page() {
|
||||
|
@ -197,8 +173,6 @@ if ( ! function_exists( 'is_order_received_page' ) ) {
|
|||
|
||||
/**
|
||||
* is_order_received_page - Returns true when viewing the order received page.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function is_order_received_page() {
|
||||
|
@ -212,8 +186,6 @@ if ( ! function_exists( 'is_add_payment_method_page' ) ) {
|
|||
|
||||
/**
|
||||
* is_add_payment_method_page - Returns true when viewing the add payment method page.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function is_add_payment_method_page() {
|
||||
|
@ -227,8 +199,6 @@ if ( ! function_exists( 'is_lost_password_page' ) ) {
|
|||
|
||||
/**
|
||||
* is_lost_password_page - Returns true when viewing the lost password page.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function is_lost_password_page() {
|
||||
|
@ -242,8 +212,6 @@ if ( ! function_exists( 'is_ajax' ) ) {
|
|||
|
||||
/**
|
||||
* is_ajax - Returns true when the page is loaded via ajax.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function is_ajax() {
|
||||
|
@ -255,8 +223,6 @@ if ( ! function_exists( 'is_store_notice_showing' ) ) {
|
|||
|
||||
/**
|
||||
* is_store_notice_showing - Returns true when store notice is active.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function is_store_notice_showing() {
|
||||
|
@ -268,14 +234,12 @@ if ( ! function_exists( 'is_filtered' ) ) {
|
|||
|
||||
/**
|
||||
* is_filtered - Returns true when filtering products using layered nav or price sliders.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function is_filtered() {
|
||||
global $_chosen_attributes;
|
||||
|
||||
return apply_filters( 'woocommerce_is_filtered', ( sizeof( $_chosen_attributes ) > 0 || ( isset( $_GET['max_price'] ) && isset( $_GET['min_price'] ) ) ) );
|
||||
return apply_filters( 'woocommerce_is_filtered', ( sizeof( $_chosen_attributes ) > 0 || isset( $_GET['max_price'] ) || isset( $_GET['min_price'] ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -283,9 +247,8 @@ if ( ! function_exists( 'taxonomy_is_product_attribute' ) ) {
|
|||
|
||||
/**
|
||||
* Returns true when the passed taxonomy name is a product attribute.
|
||||
*
|
||||
* @uses $wc_product_attributes global which stores taxonomy names upon registration
|
||||
* @param string $name of the attribute
|
||||
* @uses $wc_product_attributes global which stores taxonomy names upon registration
|
||||
* @param string $name of the attribute
|
||||
* @return bool
|
||||
*/
|
||||
function taxonomy_is_product_attribute( $name ) {
|
||||
|
@ -299,14 +262,13 @@ if ( ! function_exists( 'meta_is_product_attribute' ) ) {
|
|||
|
||||
/**
|
||||
* Returns true when the passed meta name is a product attribute.
|
||||
*
|
||||
* @param string $name of the attribute
|
||||
* @param mixed $value
|
||||
* @param int $product_id
|
||||
* @param string $name of the attribute
|
||||
* @param mixed $value
|
||||
* @param int $product_id
|
||||
* @return bool
|
||||
*/
|
||||
function meta_is_product_attribute( $name, $value, $product_id ) {
|
||||
$product = wc_get_product( $product_id );
|
||||
$product = wc_get_product( $product_id );
|
||||
|
||||
if ( $product->product_type != 'variable' ) {
|
||||
return false;
|
||||
|
@ -323,7 +285,6 @@ if ( ! function_exists( 'wc_tax_enabled' ) ) {
|
|||
|
||||
/**
|
||||
* Are store-wide taxes enabled?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function wc_tax_enabled() {
|
||||
|
@ -335,7 +296,6 @@ if ( ! function_exists( 'wc_prices_include_tax' ) ) {
|
|||
|
||||
/**
|
||||
* Are prices inclusive of tax?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function wc_prices_include_tax() {
|
||||
|
@ -349,12 +309,12 @@ if ( ! function_exists( 'wc_prices_include_tax' ) ) {
|
|||
* + starts with `action.woocommerce_` or `action.wc_`
|
||||
* + it has a valid resource & event
|
||||
*
|
||||
* @param string $topic webhook topic
|
||||
* @param string $topic webhook topic
|
||||
* @return bool true if valid, false otherwise
|
||||
*/
|
||||
function wc_is_webhook_valid_topic( $topic ) {
|
||||
|
||||
// custom topics are prefixed with woocommerce_ or wc_ are valid
|
||||
// Custom topics are prefixed with woocommerce_ or wc_ are valid
|
||||
if ( 0 === strpos( $topic, 'action.woocommerce_' ) || 0 === strpos( $topic, 'action.wc_' ) ) {
|
||||
return true;
|
||||
}
|
||||
|
@ -379,18 +339,17 @@ function wc_is_webhook_valid_topic( $topic ) {
|
|||
/**
|
||||
* Simple check for validating a URL, it must start with http:// or https://
|
||||
* and pass FILTER_VALIDATE_URL validation
|
||||
*
|
||||
* @param string $url
|
||||
* @param string $url
|
||||
* @return bool
|
||||
*/
|
||||
function wc_is_valid_url( $url ) {
|
||||
|
||||
// must start with http:// or https://
|
||||
// Must start with http:// or https://
|
||||
if ( 0 !== strpos( $url, 'http://' ) && 0 !== strpos( $url, 'https://' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// must pass validation
|
||||
// Must pass validation
|
||||
if ( ! filter_var( $url, FILTER_VALIDATE_URL ) ) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -111,6 +111,8 @@ function wc_create_order( $args = array() ) {
|
|||
update_post_meta( $order_id, '_customer_user', $args['customer_id'] );
|
||||
}
|
||||
|
||||
update_post_meta( $order_id, '_order_version', WC_VERSION );
|
||||
|
||||
return new WC_Order( $order_id );
|
||||
}
|
||||
|
||||
|
|
|
@ -253,6 +253,24 @@ function wc_clean( $var ) {
|
|||
return sanitize_text_field( $var );
|
||||
}
|
||||
|
||||
/**
|
||||
* Sanitize a string destined to be a tooltip. Prevents XSS.
|
||||
* @param string $var
|
||||
* @return string
|
||||
*/
|
||||
function wc_sanitize_tooltip( $var ) {
|
||||
return wp_kses( html_entity_decode( $var ), array(
|
||||
'br' => array(),
|
||||
'em' => array(),
|
||||
'strong' => array(),
|
||||
'span' => array(),
|
||||
'ul' => array(),
|
||||
'li' => array(),
|
||||
'ol' => array(),
|
||||
'p' => array(),
|
||||
) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge two arrays
|
||||
*
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
*
|
||||
* Functions for product specific things.
|
||||
*
|
||||
* @author WooThemes
|
||||
* @category Core
|
||||
* @package WooCommerce/Functions
|
||||
* @version 2.1.0
|
||||
* @author WooThemes
|
||||
* @category Core
|
||||
* @package WooCommerce/Functions
|
||||
* @version 2.3.0
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -563,7 +563,14 @@ function wc_product_has_unique_sku( $product_id, $sku ) {
|
|||
function wc_get_product_id_by_sku( $sku ) {
|
||||
global $wpdb;
|
||||
|
||||
$product_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key='_sku' AND meta_value='%s' LIMIT 1", $sku ) );
|
||||
$product_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 postmeta.meta_key = '_sku' AND postmeta.meta_value = '%s'
|
||||
LIMIT 1
|
||||
", $sku ) );
|
||||
|
||||
return ( $product_id ) ? intval( $product_id ) : 0;
|
||||
}
|
||||
|
|
|
@ -189,6 +189,12 @@ function wc_body_class( $classes ) {
|
|||
$classes[] = 'woocommerce-demo-store';
|
||||
}
|
||||
|
||||
foreach ( WC()->query->query_vars as $key => $value ) {
|
||||
if ( is_wc_endpoint_url( $key ) ) {
|
||||
$classes[] = 'woocommerce-' . sanitize_html_class( $key );
|
||||
}
|
||||
}
|
||||
|
||||
return array_unique( $classes );
|
||||
}
|
||||
|
||||
|
|
|
@ -45,11 +45,11 @@ function wc_create_new_customer( $email, $username = '', $password = '' ) {
|
|||
|
||||
// Check the e-mail address
|
||||
if ( empty( $email ) || ! is_email( $email ) ) {
|
||||
return new WP_Error( 'registration-error', __( 'Please provide a valid email address.', 'woocommerce' ) );
|
||||
return new WP_Error( 'registration-error-invalid-email', __( 'Please provide a valid email address.', 'woocommerce' ) );
|
||||
}
|
||||
|
||||
if ( email_exists( $email ) ) {
|
||||
return new WP_Error( 'registration-error', __( 'An account is already registered with your email address. Please login.', 'woocommerce' ) );
|
||||
return new WP_Error( 'registration-error-email-exists', __( 'An account is already registered with your email address. Please login.', 'woocommerce' ) );
|
||||
}
|
||||
|
||||
// Handle username creation
|
||||
|
@ -58,11 +58,11 @@ function wc_create_new_customer( $email, $username = '', $password = '' ) {
|
|||
$username = sanitize_user( $username );
|
||||
|
||||
if ( empty( $username ) || ! validate_username( $username ) ) {
|
||||
return new WP_Error( 'registration-error', __( 'Please enter a valid account username.', 'woocommerce' ) );
|
||||
return new WP_Error( 'registration-error-invalid-username', __( 'Please enter a valid account username.', 'woocommerce' ) );
|
||||
}
|
||||
|
||||
if ( username_exists( $username ) )
|
||||
return new WP_Error( 'registration-error', __( 'An account is already registered with that username. Please choose another.', 'woocommerce' ) );
|
||||
return new WP_Error( 'registration-error-username-exists', __( 'An account is already registered with that username. Please choose another.', 'woocommerce' ) );
|
||||
} else {
|
||||
|
||||
$username = sanitize_user( current( explode( '@', $email ) ), true );
|
||||
|
@ -83,7 +83,7 @@ function wc_create_new_customer( $email, $username = '', $password = '' ) {
|
|||
$password_generated = true;
|
||||
|
||||
} elseif ( empty( $password ) ) {
|
||||
return new WP_Error( 'registration-error', __( 'Please enter an account password.', 'woocommerce' ) );
|
||||
return new WP_Error( 'registration-error-missing-password', __( 'Please enter an account password.', 'woocommerce' ) );
|
||||
|
||||
} else {
|
||||
$password_generated = false;
|
||||
|
|
12
package.json
12
package.json
|
@ -12,14 +12,14 @@
|
|||
"grunt": "^0.4.5",
|
||||
"grunt-checktextdomain": "^0.1.1",
|
||||
"grunt-contrib-clean": "^0.6.0",
|
||||
"grunt-contrib-cssmin": "^0.11.0",
|
||||
"grunt-contrib-cssmin": "^0.12.2",
|
||||
"grunt-contrib-jshint": "^0.11.0",
|
||||
"grunt-contrib-sass": "^0.8.1",
|
||||
"grunt-contrib-uglify": "^0.7.0",
|
||||
"grunt-contrib-sass": "^0.9.2",
|
||||
"grunt-contrib-uglify": "^0.8.0",
|
||||
"grunt-contrib-watch": "^0.6.1",
|
||||
"grunt-shell": "^1.1.1",
|
||||
"grunt-wp-i18n": "^0.4.9",
|
||||
"node-bourbon": "^1.2.3"
|
||||
"grunt-shell": "^1.1.2",
|
||||
"grunt-wp-i18n": "^0.5.0",
|
||||
"node-bourbon": "^4.2.1-beta1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8.0",
|
||||
|
|
15
readme.txt
15
readme.txt
|
@ -4,7 +4,7 @@ Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, affiliate
|
|||
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=paypal@woothemes.com&item_name=Donation+for+WooCommerce
|
||||
Requires at least: 4.0
|
||||
Tested up to: 4.1
|
||||
Stable tag: 2.3.5
|
||||
Stable tag: 2.3.6
|
||||
License: GPLv3
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
|
@ -138,12 +138,25 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
|
|||
|
||||
== Changelog ==
|
||||
|
||||
* Fix - Allow saving of empty download expiry date on orders.
|
||||
* Fix - get_total_discount() function with certain tax setups.
|
||||
* Fix - Price filter styling.
|
||||
* Fix - Support price filter min or max only.
|
||||
* Fix - stock management for variations for Products API.
|
||||
* Tweak - Revised how discounts/discount taxes are stored for consistency. Always store ex. tax to make data retrieval easier, and to ensure totals are correct after settings changes. Backwards compatibility maintained through use of order versioning.
|
||||
* Tweak - Delete product attachments when the Products API fails.
|
||||
|
||||
= 2.3.6 - 13/03/2015 =
|
||||
* Fix - Removal of coupons containing spaces.
|
||||
* Fix - Unclosed div in profile page.
|
||||
* Fix - Export report CSV.
|
||||
* Fix - Settings API - allow multiselect fields to be emptied.
|
||||
* Fix - Saving an order needs to save the discount amount ex. tax like the cart.
|
||||
* Fix - Order again with custom attributes.
|
||||
* Fix - Prevent potential XSS within tooltips (discovered by FortiGuard Labs).
|
||||
* Fix - Paypal debug option.
|
||||
* Fix - Removed $q->query['wc_query'] = 'product_query' which broke redirects (#7703). Use $q->get('wc_query') instead.
|
||||
* Fix - Sanitize tax_rate_id when saving taxes in the backend to prevent potential SQL injection (discovered by WordFence).
|
||||
* Tweak - Show discounts inc. tax when showing order totals inc. tax.
|
||||
* Tweak - Use 30 days instead of year for transients to avoid bugs in memcache plugins.
|
||||
* Tweak - Add reports menu item if user can access reports but not the main WC section.
|
||||
|
|
|
@ -31,7 +31,15 @@ get_header( 'shop' ); ?>
|
|||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_archive_description' ); ?>
|
||||
<?php
|
||||
/**
|
||||
* woocommerce_archive_description hook
|
||||
*
|
||||
* @hooked woocommerce_taxonomy_archive_description - 10
|
||||
* @hooked woocommerce_product_archive_description - 10
|
||||
*/
|
||||
do_action( 'woocommerce_archive_description' );
|
||||
?>
|
||||
|
||||
<?php if ( have_posts() ) : ?>
|
||||
|
||||
|
|
|
@ -23,6 +23,11 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?>
|
|||
<?php
|
||||
foreach ( $grouped_products as $product_id ) :
|
||||
$product = wc_get_product( $product_id );
|
||||
|
||||
if ( 'yes' === get_option( 'woocommerce_hide_out_of_stock_items' ) && ! $product->is_in_stock() ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$post = $product->post;
|
||||
setup_postdata( $post );
|
||||
?>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* Plugin Name: WooCommerce
|
||||
* Plugin URI: http://www.woothemes.com/woocommerce/
|
||||
* Description: An e-commerce toolkit that helps you sell anything. Beautifully.
|
||||
* Version: 2.3.5
|
||||
* Version: 2.4.0-dev
|
||||
* Author: WooThemes
|
||||
* Author URI: http://woothemes.com
|
||||
* Requires at least: 4.0
|
||||
|
@ -33,7 +33,7 @@ final class WooCommerce {
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $version = '2.3.5';
|
||||
public $version = '2.4.0-dev';
|
||||
|
||||
/**
|
||||
* @var WooCommerce The single instance of the class
|
||||
|
|
Loading…
Reference in New Issue