diff --git a/assets/css/woocommerce.css b/assets/css/woocommerce.css index c2fb54bdeb3..01b7405a85b 100644 --- a/assets/css/woocommerce.css +++ b/assets/css/woocommerce.css @@ -1 +1 @@ -@charset "UTF-8";.clear,.woocommerce .woocommerce-breadcrumb:after,.woocommerce .woocommerce-error:after,.woocommerce .woocommerce-info:after,.woocommerce .woocommerce-message:after{clear:both}@-webkit-keyframes spin{100%{-webkit-transform:rotate(360deg)}}@-moz-keyframes spin{100%{-moz-transform:rotate(360deg)}}@keyframes spin{100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-ms-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}@font-face{font-family:star;src:url(../fonts/star.eot);src:url(../fonts/star.eot?#iefix) format("embedded-opentype"),url(../fonts/star.woff) format("woff"),url(../fonts/star.ttf) format("truetype"),url(../fonts/star.svg#star) format("svg");font-weight:400;font-style:normal}@font-face{font-family:WooCommerce;src:url(../fonts/WooCommerce.eot);src:url(../fonts/WooCommerce.eot?#iefix) format("embedded-opentype"),url(../fonts/WooCommerce.woff) format("woff"),url(../fonts/WooCommerce.ttf) format("truetype"),url(../fonts/WooCommerce.svg#WooCommerce) format("svg");font-weight:400;font-style:normal}p.demo_store{position:fixed;top:0;left:0;right:0;margin:0;width:100%;font-size:1em;padding:1em 0;text-align:center;background-color:#a46497;color:#fff;z-index:99998;box-shadow:0 1px 1em rgba(0,0,0,.2)}.admin-bar p.demo_store{top:32px}.woocommerce .blockUI.blockOverlay{position:relative}.woocommerce .blockUI.blockOverlay:before,.woocommerce .loader:before{height:1em;width:1em;position:absolute;top:50%;left:50%;margin-left:-.5em;margin-top:-.5em;display:block;content:"";-webkit-animation:spin 1s ease-in-out infinite;-moz-animation:spin 1s ease-in-out infinite;animation:spin 1s ease-in-out infinite;background:url(../images/icons/loader.svg) center center;background-size:cover;line-height:1;text-align:center;font-size:2em;color:rgba(0,0,0,.75)}.woocommerce a.remove{display:block;font-size:1.5em;height:1em;width:1em;text-align:center;line-height:1;border-radius:100%;color:red!important;text-decoration:none;font-weight:700;border:0}.woocommerce a.remove:hover{color:#fff!important;background:red}.woocommerce .woocommerce-error,.woocommerce .woocommerce-info,.woocommerce .woocommerce-message{padding:1em 2em 1em 3.5em!important;margin:0 0 2em!important;position:relative;background-color:#f7f6f7;color:#515151;border-top:3px solid #a46497;list-style:none!important;width:auto;word-wrap:break-word}.woocommerce .woocommerce-error:after,.woocommerce .woocommerce-error:before,.woocommerce .woocommerce-info:after,.woocommerce .woocommerce-info:before,.woocommerce .woocommerce-message:after,.woocommerce .woocommerce-message:before{content:" ";display:table}.woocommerce .woocommerce-error:before,.woocommerce .woocommerce-info:before,.woocommerce .woocommerce-message:before{font-family:WooCommerce;content:"\e028";display:inline-block;position:absolute;top:1em;left:1.5em}.woocommerce .woocommerce-error .button,.woocommerce .woocommerce-info .button,.woocommerce .woocommerce-message .button{float:right}.woocommerce .woocommerce-error li,.woocommerce .woocommerce-info li,.woocommerce .woocommerce-message li{list-style:none!important;padding-left:0!important;margin-left:0!important}.woocommerce .woocommerce-message{border-top-color:#8fae1b}.woocommerce .woocommerce-message:before{content:"\e015";color:#8fae1b}.woocommerce .woocommerce-info{border-top-color:#1e85be}.woocommerce .woocommerce-info:before{color:#1e85be}.woocommerce .woocommerce-error{border-top-color:#b81c23}.woocommerce .woocommerce-error:before{content:"\e016";color:#b81c23}.woocommerce small.note{display:block;color:#777;font-size:.857em;margin-top:10px}.woocommerce .woocommerce-breadcrumb{margin:0 0 1em;padding:0;font-size:.92em;color:#777}.woocommerce .woocommerce-breadcrumb:after,.woocommerce .woocommerce-breadcrumb:before{content:" ";display:table}.woocommerce .woocommerce-breadcrumb a{color:#777}.woocommerce .quantity .qty{width:3.631em;text-align:center}.woocommerce div.product{margin-bottom:0;position:relative}.woocommerce div.product .product_title{clear:none;margin-top:0;padding:0}.woocommerce #reviews #comments .add_review:after,.woocommerce .products ul:after,.woocommerce div.product form.cart:after,.woocommerce div.product p.cart:after,.woocommerce nav.woocommerce-pagination ul,.woocommerce ul.products:after{clear:both}.woocommerce div.product p.price,.woocommerce div.product span.price{color:#77a464;font-size:1.25em}.woocommerce div.product p.price ins,.woocommerce div.product span.price ins{background:inherit;font-weight:700}.woocommerce div.product p.price del,.woocommerce div.product span.price del{opacity:.5;display:block}.woocommerce div.product p.stock{font-size:.92em}.woocommerce div.product .stock{color:#77a464}.woocommerce div.product .out-of-stock{color:red}.woocommerce div.product .woocommerce-product-rating{margin-bottom:1.618em}.woocommerce div.product div.images,.woocommerce div.product div.summary{margin-bottom:2em}.woocommerce div.product div.images img{display:block;width:100%;height:auto;box-shadow:none}.woocommerce div.product div.images div.thumbnails{padding-top:1em}.woocommerce div.product div.social{text-align:right;margin:0 0 1em}.woocommerce div.product div.social span{margin:0 0 0 2px}.woocommerce div.product div.social span span{margin:0}.woocommerce div.product div.social span .stButton .chicklets{padding-left:16px;width:0}.woocommerce div.product div.social iframe{float:left;margin-top:3px}.woocommerce div.product .woocommerce-tabs ul.tabs{list-style:none;padding:0 0 0 1em;margin:0 0 1.618em;overflow:hidden;position:relative}.woocommerce div.product .woocommerce-tabs ul.tabs li{border:1px solid #d3ced2;background-color:#ebe9eb;display:inline-block;position:relative;z-index:0;border-radius:4px 4px 0 0;margin:0 -5px;padding:0 1em}.woocommerce div.product .woocommerce-tabs ul.tabs li a{display:inline-block;padding:.5em 0;font-weight:700;color:#515151;text-decoration:none}.woocommerce div.product form.cart:after,.woocommerce div.product form.cart:before,.woocommerce div.product p.cart:after,.woocommerce div.product p.cart:before{content:" ";display:table}.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover{text-decoration:none;color:#6b6b6b}.woocommerce div.product .woocommerce-tabs ul.tabs li.active{background:#fff;z-index:2;border-bottom-color:#fff}.woocommerce div.product .woocommerce-tabs ul.tabs li.active a{color:inherit;text-shadow:inherit}.woocommerce div.product .woocommerce-tabs ul.tabs li.active:before{box-shadow:2px 2px 0 #fff}.woocommerce div.product .woocommerce-tabs ul.tabs li.active:after{box-shadow:-2px 2px 0 #fff}.woocommerce div.product .woocommerce-tabs ul.tabs li:after,.woocommerce div.product .woocommerce-tabs ul.tabs li:before{border:1px solid #d3ced2;position:absolute;bottom:-1px;width:5px;height:5px;content:" "}.woocommerce div.product .woocommerce-tabs ul.tabs li:before{left:-6px;-webkit-border-bottom-right-radius:4px;-moz-border-bottom-right-radius:4px;border-bottom-right-radius:4px;border-width:0 1px 1px 0;box-shadow:2px 2px 0 #ebe9eb}.woocommerce div.product .woocommerce-tabs ul.tabs li:after{right:-6px;-webkit-border-bottom-left-radius:4px;-moz-border-bottom-left-radius:4px;border-bottom-left-radius:4px;border-width:0 0 1px 1px;box-shadow:-2px 2px 0 #ebe9eb}.woocommerce div.product .woocommerce-tabs ul.tabs:before{position:absolute;content:" ";width:100%;bottom:0;left:0;border-bottom:1px solid #d3ced2;z-index:1}.woocommerce div.product .woocommerce-tabs .panel{margin:0 0 2em;padding:0}.woocommerce div.product form.cart,.woocommerce div.product p.cart{margin-bottom:2em}.woocommerce div.product form.cart div.quantity{float:left;margin:0 4px 0 0}.woocommerce div.product form.cart table{border-width:0 0 1px}.woocommerce div.product form.cart table td{padding-left:0}.woocommerce div.product form.cart table div.quantity{float:none;margin:0}.woocommerce div.product form.cart table small.stock{display:block;float:none}.woocommerce div.product form.cart .variations{margin-bottom:1em;border:0}.woocommerce div.product form.cart .variations td,.woocommerce div.product form.cart .variations th{border:0}.woocommerce div.product form.cart .variations label{font-weight:700}.woocommerce div.product form.cart .variations select{width:100%;float:left}.woocommerce div.product form.cart .variations td.label{padding-right:1em}.woocommerce div.product form.cart .variations td{vertical-align:top}.woocommerce div.product form.cart .button{vertical-align:middle;float:left}.woocommerce div.product form.cart .group_table td.label{padding-right:1em;padding-left:1em}.woocommerce div.product form.cart .group_table td{vertical-align:top;padding-bottom:.5em;border:0}.woocommerce span.onsale{min-height:3.236em;min-width:3.236em;padding:.202em;font-weight:700;position:absolute;text-align:center;line-height:3.236;top:-.5em;left:-.5em;margin:0;border-radius:100%;background-color:#77a464;color:#fff;font-size:.857em;-webkit-font-smoothing:antialiased}.woocommerce .products ul,.woocommerce ul.products{margin:0 0 1em;padding:0;list-style:none;clear:both}.woocommerce .products ul:after,.woocommerce .products ul:before,.woocommerce ul.products:after,.woocommerce ul.products:before{content:" ";display:table}.woocommerce .products ul li,.woocommerce ul.products li{list-style:none}.woocommerce ul.products li.product .onsale{top:0;right:0;left:auto;margin:-.5em -.5em 0 0}.woocommerce ul.products li.product h3{padding:.5em 0;margin:0;font-size:1em}.woocommerce ul.products li.product a{text-decoration:none}.woocommerce ul.products li.product a img{width:100%;height:auto;display:block;margin:0 0 1em;box-shadow:none}.woocommerce ul.products li.product strong{display:block}.woocommerce ul.products li.product .star-rating{font-size:.857em}.woocommerce ul.products li.product .button{margin-top:1em}.woocommerce ul.products li.product .price{color:#77a464;display:block;font-weight:400;margin-bottom:.5em;font-size:.857em}.woocommerce ul.products li.product .price del{color:inherit;opacity:.5;display:block}.woocommerce ul.products li.product .price ins{background:0 0;font-weight:700}.woocommerce ul.products li.product .price .from{font-size:.67em;margin:-2px 0 0;text-transform:uppercase;color:rgba(132,132,132,.5)}.woocommerce .woocommerce-ordering,.woocommerce .woocommerce-result-count{margin:0 0 1em}.woocommerce .woocommerce-ordering select{vertical-align:top}.woocommerce nav.woocommerce-pagination{text-align:center}.woocommerce nav.woocommerce-pagination ul{display:inline-block;white-space:nowrap;padding:0;border:1px solid #d3ced2;border-right:0;margin:1px}.woocommerce nav.woocommerce-pagination ul li{border-right:1px solid #d3ced2;padding:0;margin:0;float:left;display:inline;overflow:hidden}.woocommerce nav.woocommerce-pagination ul li a,.woocommerce nav.woocommerce-pagination ul li span{margin:0;text-decoration:none;line-height:1;font-size:1em;font-weight:400;padding:.5em;min-width:1em;display:block}.woocommerce nav.woocommerce-pagination ul li a:focus,.woocommerce nav.woocommerce-pagination ul li a:hover,.woocommerce nav.woocommerce-pagination ul li span.current{background:#ebe9eb;color:#8a7e88}.woocommerce #respond input#submit,.woocommerce a.button,.woocommerce button.button,.woocommerce input.button{font-size:100%;margin:0;line-height:1;cursor:pointer;position:relative;font-family:inherit;text-decoration:none;overflow:visible;padding:.618em 1em;font-weight:700;border-radius:3px;left:auto;color:#515151;background-color:#ebe9eb;border:0;white-space:nowrap;display:inline-block;background-image:none;box-shadow:none;-webkit-box-shadow:none;text-shadow:none}.woocommerce #respond input#submit.loading,.woocommerce a.button.loading,.woocommerce button.button.loading,.woocommerce input.button.loading{opacity:.25;padding-right:2.618em}.woocommerce #respond input#submit.loading:after,.woocommerce a.button.loading:after,.woocommerce button.button.loading:after,.woocommerce input.button.loading:after{font-family:WooCommerce;content:"\e01c";vertical-align:top;-webkit-font-smoothing:antialiased;font-weight:400;position:absolute;top:.618em;right:1em;-webkit-animation:spin 2s linear infinite;-moz-animation:spin 2s linear infinite;animation:spin 2s linear infinite}.woocommerce #respond input#submit.added:after,.woocommerce a.button.added:after,.woocommerce button.button.added:after,.woocommerce input.button.added:after{font-family:WooCommerce;content:"\e017";margin-left:.53em;vertical-align:bottom}.woocommerce #respond input#submit:hover,.woocommerce a.button:hover,.woocommerce button.button:hover,.woocommerce input.button:hover{background-color:#dad8da;text-decoration:none;background-image:none;color:#515151}.woocommerce #respond input#submit.alt,.woocommerce a.button.alt,.woocommerce button.button.alt,.woocommerce input.button.alt{background-color:#a46497;color:#fff;-webkit-font-smoothing:antialiased}.woocommerce #respond input#submit.alt:hover,.woocommerce a.button.alt:hover,.woocommerce button.button.alt:hover,.woocommerce input.button.alt:hover{background-color:#935386;color:#fff}.woocommerce #respond input#submit.alt.disabled,.woocommerce #respond input#submit.alt.disabled:hover,.woocommerce #respond input#submit.alt:disabled,.woocommerce #respond input#submit.alt:disabled:hover,.woocommerce #respond input#submit.alt:disabled[disabled],.woocommerce #respond input#submit.alt:disabled[disabled]:hover,.woocommerce a.button.alt.disabled,.woocommerce a.button.alt.disabled:hover,.woocommerce a.button.alt:disabled,.woocommerce a.button.alt:disabled:hover,.woocommerce a.button.alt:disabled[disabled],.woocommerce a.button.alt:disabled[disabled]:hover,.woocommerce button.button.alt.disabled,.woocommerce button.button.alt.disabled:hover,.woocommerce button.button.alt:disabled,.woocommerce button.button.alt:disabled:hover,.woocommerce button.button.alt:disabled[disabled],.woocommerce button.button.alt:disabled[disabled]:hover,.woocommerce input.button.alt.disabled,.woocommerce input.button.alt.disabled:hover,.woocommerce input.button.alt:disabled,.woocommerce input.button.alt:disabled:hover,.woocommerce input.button.alt:disabled[disabled],.woocommerce input.button.alt:disabled[disabled]:hover{background-color:#a46497;color:#fff}.woocommerce #respond input#submit.disabled,.woocommerce #respond input#submit:disabled,.woocommerce #respond input#submit:disabled[disabled],.woocommerce a.button.disabled,.woocommerce a.button:disabled,.woocommerce a.button:disabled[disabled],.woocommerce button.button.disabled,.woocommerce button.button:disabled,.woocommerce button.button:disabled[disabled],.woocommerce input.button.disabled,.woocommerce input.button:disabled,.woocommerce input.button:disabled[disabled]{color:inherit;cursor:not-allowed;opacity:.5}.woocommerce #respond input#submit.disabled:hover,.woocommerce #respond input#submit:disabled:hover,.woocommerce #respond input#submit:disabled[disabled]:hover,.woocommerce a.button.disabled:hover,.woocommerce a.button:disabled:hover,.woocommerce a.button:disabled[disabled]:hover,.woocommerce button.button.disabled:hover,.woocommerce button.button:disabled:hover,.woocommerce button.button:disabled[disabled]:hover,.woocommerce input.button.disabled:hover,.woocommerce input.button:disabled:hover,.woocommerce input.button:disabled[disabled]:hover{color:inherit;background-color:#ebe9eb}.woocommerce .cart .button,.woocommerce .cart input.button{float:none}.woocommerce a.added_to_cart{padding-top:.5em;white-space:nowrap;display:inline-block}.woocommerce #reviews #comments .add_review:after,.woocommerce #reviews #comments .add_review:before,.woocommerce #reviews #comments ol.commentlist li .comment-text:after,.woocommerce #reviews #comments ol.commentlist li .comment-text:before,.woocommerce #reviews #comments ol.commentlist:after,.woocommerce #reviews #comments ol.commentlist:before{content:" ";display:table}.woocommerce #reviews h2 small{float:right;color:#777;font-size:15px;margin:10px 0 0}.woocommerce #reviews h2 small a{text-decoration:none;color:#777}.woocommerce #reviews h3{margin:0}.woocommerce #reviews #respond{margin:0;border:0;padding:0}.woocommerce #reviews #comment{height:75px}.woocommerce #reviews #comments h2{clear:none}.woocommerce #review_form #respond:after,.woocommerce #reviews #comments ol.commentlist li .comment-text:after,.woocommerce #reviews #comments ol.commentlist:after,.woocommerce .woocommerce-product-rating:after,.woocommerce td.product-name dl.variation:after{clear:both}.woocommerce #reviews #comments ol.commentlist{margin:0;width:100%;background:0 0;list-style:none}.woocommerce #reviews #comments ol.commentlist li{padding:0;margin:0 0 20px;position:relative;background:0;border:0}.woocommerce #reviews #comments ol.commentlist li .meta{color:#777;font-size:.75em}.woocommerce #reviews #comments ol.commentlist li img.avatar{float:left;position:absolute;top:0;left:0;padding:3px;width:32px;height:auto;background:#ebe9eb;border:1px solid #e4e1e3;margin:0;box-shadow:none}.woocommerce #reviews #comments ol.commentlist li .comment-text{margin:0 0 0 50px;border:1px solid #e4e1e3;border-radius:4px;padding:1em 1em 0}.woocommerce #reviews #comments ol.commentlist li .comment-text p{margin:0 0 1em}.woocommerce #reviews #comments ol.commentlist li .comment-text p.meta{font-size:.83em}.woocommerce #reviews #comments ol.commentlist ul.children{list-style:none;margin:20px 0 0 50px}.woocommerce #reviews #comments ol.commentlist ul.children .star-rating{display:none}.woocommerce #reviews #comments ol.commentlist #respond{border:1px solid #e4e1e3;border-radius:4px;padding:1em 1em 0;margin:20px 0 0 50px}.woocommerce #reviews #comments .commentlist>li:before{content:""}.woocommerce .star-rating{float:right;overflow:hidden;position:relative;height:1em;line-height:1;font-size:1em;width:5.4em;font-family:star}.woocommerce .star-rating:before{content:"\73\73\73\73\73";color:#d3ced2;float:left;top:0;left:0;position:absolute}.woocommerce .star-rating span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}.woocommerce .star-rating span:before{content:"\53\53\53\53\53";top:0;position:absolute;left:0}.woocommerce .woocommerce-product-rating{line-height:2;display:block}.woocommerce .woocommerce-product-rating:after,.woocommerce .woocommerce-product-rating:before{content:" ";display:table}.woocommerce .woocommerce-product-rating .star-rating{margin:.5em 4px 0 0;float:left}.woocommerce .products .star-rating{display:block;margin:0 0 .5em;float:none}.woocommerce .hreview-aggregate .star-rating{margin:10px 0 0}.woocommerce #review_form #respond{position:static;margin:0;width:auto;padding:0;background:0 0;border:0}.woocommerce #review_form #respond:after,.woocommerce #review_form #respond:before{content:" ";display:table}.woocommerce #review_form #respond p{margin:0 0 10px}.woocommerce #review_form #respond .form-submit input{left:auto}.woocommerce #review_form #respond textarea{box-sizing:border-box;width:100%}.woocommerce p.stars{position:relative;font-size:1em}.woocommerce p.stars a{display:inline-block;font-weight:700;margin-right:1em;text-indent:-9999px;position:relative;border-bottom:0!important;outline:0}.woocommerce p.stars a:last-child{border-right:0}.woocommerce p.stars a.star-1,.woocommerce p.stars a.star-2,.woocommerce p.stars a.star-3,.woocommerce p.stars a.star-4,.woocommerce p.stars a.star-5{border-right:1px solid #ccc}.woocommerce p.stars a.star-1:after,.woocommerce p.stars a.star-2:after,.woocommerce p.stars a.star-3:after,.woocommerce p.stars a.star-4:after,.woocommerce p.stars a.star-5:after{font-family:WooCommerce;text-indent:0;position:absolute;top:0;left:0}.woocommerce p.stars a.star-1{width:2em}.woocommerce p.stars a.star-1:after{content:"\e021"}.woocommerce p.stars a.star-1.active:after,.woocommerce p.stars a.star-1:hover:after{content:""}.woocommerce p.stars a.star-2{width:3em}.woocommerce p.stars a.star-2:after{content:"\e021\e021"}.woocommerce p.stars a.star-2.active:after,.woocommerce p.stars a.star-2:hover:after{content:""}.woocommerce p.stars a.star-3{width:4em}.woocommerce p.stars a.star-3:after{content:"\e021\e021\e021"}.woocommerce p.stars a.star-3.active:after,.woocommerce p.stars a.star-3:hover:after{content:""}.woocommerce p.stars a.star-4{width:5em}.woocommerce p.stars a.star-4:after{content:"\e021\e021\e021\e021"}.woocommerce p.stars a.star-4.active:after,.woocommerce p.stars a.star-4:hover:after{content:""}.woocommerce p.stars a.star-5{width:6em;border:0}.woocommerce p.stars a.star-5:after{content:"\e021\e021\e021\e021\e021"}.woocommerce p.stars a.star-5.active:after,.woocommerce p.stars a.star-5:hover:after{content:""}.woocommerce table.shop_attributes{border:0;border-top:1px dotted rgba(0,0,0,.1);margin-bottom:1.618em;width:100%}.woocommerce table.shop_attributes td,.woocommerce table.shop_attributes th{margin:0;border-top:0;border-bottom:1px dotted rgba(0,0,0,.1);line-height:1.5}.woocommerce table.shop_attributes th{width:150px;font-weight:700;padding:8px}.woocommerce table.shop_attributes td{font-style:italic;padding:0}.woocommerce table.shop_attributes td p{margin:0;padding:8px 0}.woocommerce table.shop_attributes .alt td,.woocommerce table.shop_attributes .alt th{background:rgba(0,0,0,.025)}.woocommerce table.shop_table{border:1px solid rgba(0,0,0,.1);margin:0 -1px 24px 0;text-align:left;width:100%;border-collapse:separate;border-radius:5px}.woocommerce table.shop_table th{font-weight:700;padding:9px 12px}.woocommerce table.shop_table td{border-top:1px solid rgba(0,0,0,.1);padding:6px 12px;vertical-align:middle}.woocommerce table.shop_table td small{font-weight:400}.woocommerce table.shop_table tbody:first-child tr:first-child td,.woocommerce table.shop_table tbody:first-child tr:first-child th{border-top:0}.woocommerce table.shop_table tbody th,.woocommerce table.shop_table tfoot td,.woocommerce table.shop_table tfoot th{font-weight:700;border-top:1px solid rgba(0,0,0,.1)}.woocommerce table.my_account_orders{font-size:.85em}.woocommerce table.my_account_orders td,.woocommerce table.my_account_orders th{padding:4px 8px;vertical-align:middle}.woocommerce table.my_account_orders .button{white-space:nowrap}.woocommerce table.my_account_orders .order-actions{text-align:right}.woocommerce table.my_account_orders .order-actions .button{margin:.125em 0 .125em .25em}.woocommerce td.product-name dl.variation{margin:.25em 0}.woocommerce td.product-name dl.variation:after,.woocommerce td.product-name dl.variation:before{content:" ";display:table}.woocommerce td.product-name dl.variation dd,.woocommerce td.product-name dl.variation dt{display:inline-block;float:left;margin-bottom:1em}.woocommerce td.product-name dl.variation dt{font-weight:700;padding:0 0 .25em;margin:0 4px 0 0;clear:left}.woocommerce ul.cart_list li dl:after,.woocommerce ul.cart_list li:after,.woocommerce ul.product_list_widget li dl:after,.woocommerce ul.product_list_widget li:after{clear:both}.woocommerce td.product-name dl.variation dd{padding:0 0 .25em}.woocommerce td.product-name dl.variation dd p:last-child{margin-bottom:0}.woocommerce td.product-name p.backorder_notification{font-size:.83em}.woocommerce td.product-quantity{min-width:80px}.woocommerce ul.cart_list,.woocommerce ul.product_list_widget{list-style:none;padding:0;margin:0}.woocommerce ul.cart_list li,.woocommerce ul.product_list_widget li{padding:4px 0;margin:0;list-style:none}.woocommerce ul.cart_list li:after,.woocommerce ul.cart_list li:before,.woocommerce ul.product_list_widget li:after,.woocommerce ul.product_list_widget li:before{content:" ";display:table}.woocommerce ul.cart_list li a,.woocommerce ul.product_list_widget li a{display:block;font-weight:700}.woocommerce ul.cart_list li img,.woocommerce ul.product_list_widget li img{float:right;margin-left:4px;width:32px;height:auto;box-shadow:none}.woocommerce ul.cart_list li dl,.woocommerce ul.product_list_widget li dl{margin:0;padding-left:1em;border-left:2px solid rgba(0,0,0,.1)}.woocommerce ul.cart_list li dl:after,.woocommerce ul.cart_list li dl:before,.woocommerce ul.product_list_widget li dl:after,.woocommerce ul.product_list_widget li dl:before{content:" ";display:table}.woocommerce ul.cart_list li dl dd,.woocommerce ul.cart_list li dl dt,.woocommerce ul.product_list_widget li dl dd,.woocommerce ul.product_list_widget li dl dt{display:inline-block;float:left;margin-bottom:1em}.woocommerce ul.cart_list li dl dt,.woocommerce ul.product_list_widget li dl dt{font-weight:700;padding:0 0 .25em;margin:0 4px 0 0;clear:left}.woocommerce .order_details:after,.woocommerce .widget_layered_nav ul li:after,.woocommerce .widget_shopping_cart .buttons:after,.woocommerce-account .addresses .title:after,.woocommerce-cart .wc-proceed-to-checkout:after,.woocommerce.widget_shopping_cart .buttons:after{clear:both}.woocommerce ul.cart_list li dl dd,.woocommerce ul.product_list_widget li dl dd{padding:0 0 .25em}.woocommerce ul.cart_list li dl dd p:last-child,.woocommerce ul.product_list_widget li dl dd p:last-child{margin-bottom:0}.woocommerce ul.cart_list li .star-rating,.woocommerce ul.product_list_widget li .star-rating{float:none}.woocommerce .widget_shopping_cart .total,.woocommerce.widget_shopping_cart .total{border-top:3px double #ebe9eb;padding:4px 0 0}.woocommerce .widget_shopping_cart .total strong,.woocommerce.widget_shopping_cart .total strong{min-width:40px;display:inline-block}.woocommerce .widget_shopping_cart .cart_list li,.woocommerce.widget_shopping_cart .cart_list li{padding-left:2em;position:relative;padding-top:0}.woocommerce .widget_shopping_cart .cart_list li a.remove,.woocommerce.widget_shopping_cart .cart_list li a.remove{position:absolute;top:0;left:0}.woocommerce .widget_shopping_cart .buttons:after,.woocommerce .widget_shopping_cart .buttons:before,.woocommerce.widget_shopping_cart .buttons:after,.woocommerce.widget_shopping_cart .buttons:before{content:" ";display:table}.woocommerce form .form-row{padding:3px;margin:0 0 6px}.woocommerce form .form-row [placeholder]:focus::-webkit-input-placeholder{-webkit-transition:opacity .5s .5s ease;-moz-transition:opacity .5s .5s ease;transition:opacity .5s .5s ease;opacity:0}.woocommerce form .form-row label{line-height:2}.woocommerce form .form-row label.hidden{visibility:hidden}.woocommerce form .form-row label.inline{display:inline}.woocommerce form .form-row select{cursor:pointer;margin:0}.woocommerce form .form-row .required{color:red;font-weight:700;border:0}.woocommerce form .form-row .input-checkbox{display:inline;margin:-2px 8px 0 0;text-align:center;vertical-align:middle}.woocommerce form .form-row input.input-text,.woocommerce form .form-row textarea{box-sizing:border-box;width:100%;margin:0;outline:0;line-height:1}.woocommerce form .form-row textarea{height:4em;line-height:1.5;display:block;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.woocommerce form .form-row .select2-container{width:100%;line-height:2em}.woocommerce form .form-row.woocommerce-invalid .select2-container,.woocommerce form .form-row.woocommerce-invalid input.input-text,.woocommerce form .form-row.woocommerce-invalid select{border-color:#a00}.woocommerce form .form-row.woocommerce-validated .select2-container,.woocommerce form .form-row.woocommerce-validated input.input-text,.woocommerce form .form-row.woocommerce-validated select{border-color:#69bf29}.woocommerce form .form-row ::-webkit-input-placeholder{line-height:normal}.woocommerce form .form-row :-moz-placeholder{line-height:normal}.woocommerce form .form-row :-ms-input-placeholder{line-height:normal}.woocommerce form.checkout_coupon,.woocommerce form.login,.woocommerce form.register{border:1px solid #d3ced2;padding:20px;margin:2em 0;text-align:left;border-radius:5px}.woocommerce ul#shipping_method{list-style:none;margin:0;padding:0}.woocommerce ul#shipping_method li{margin:0;padding:.25em 0 .25em 22px;text-indent:-22px;list-style:none}.woocommerce ul#shipping_method .amount{font-weight:700}.woocommerce p.woocommerce-shipping-contents{margin:0}.woocommerce .order_details{margin:0 0 1.5em;list-style:none}.woocommerce .order_details:after,.woocommerce .order_details:before{content:" ";display:table}.woocommerce .order_details li{float:left;margin-right:2em;text-transform:uppercase;font-size:.715em;line-height:1;border-right:1px dashed #d3ced2;padding-right:2em;margin-left:0;padding-left:0}.woocommerce .order_details li strong{display:block;font-size:1.4em;text-transform:none;line-height:1.5}.woocommerce .order_details li:last-of-type{border:none}.woocommerce .widget_layered_nav ul{margin:0;padding:0;border:0;list-style:none}.woocommerce .widget_layered_nav ul li{padding:0 0 1px;list-style:none}.woocommerce .widget_layered_nav ul li:after,.woocommerce .widget_layered_nav ul li:before{content:" ";display:table}.woocommerce .widget_layered_nav ul li.chosen a:before,.woocommerce .widget_layered_nav_filters ul li a:before{font-family:WooCommerce;speak:none;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;text-decoration:none;font-weight:400;line-height:1;content:"";color:#a00}.woocommerce .widget_layered_nav ul li a,.woocommerce .widget_layered_nav ul li span{padding:1px 0}.woocommerce .widget_layered_nav ul li.chosen a:before{margin-right:.618em}.woocommerce .widget_layered_nav_filters ul{margin:0;padding:0;border:0;list-style:none;overflow:hidden;zoom:1}.woocommerce .widget_layered_nav_filters ul li{float:left;padding:0 1px 1px 0;list-style:none}.woocommerce .widget_layered_nav_filters ul li a{text-decoration:none}.woocommerce .widget_layered_nav_filters ul li a:before{margin-right:.618em}.woocommerce .widget_price_filter .price_slider{margin-bottom:1em}.woocommerce .widget_price_filter .price_slider_amount{text-align:right;line-height:2.4;font-size:.8751em}.woocommerce .widget_price_filter .price_slider_amount .button{font-size:1.15em;float:left}.woocommerce .widget_price_filter .ui-slider{position:relative;text-align:left;margin-left:.5em;margin-right:.5em}.woocommerce .widget_price_filter .ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1em;height:1em;background-color:#a46497;border-radius:1em;cursor:ew-resize;outline:0;top:-.3em;margin-left:-.5em}.woocommerce .widget_price_filter .ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;border-radius:1em;background-color:#a46497}.woocommerce .widget_price_filter .price_slider_wrapper .ui-widget-content{border-radius:1em;background-color:#602053;border:0}.woocommerce .widget_price_filter .ui-slider-horizontal{height:.5em}.woocommerce .widget_price_filter .ui-slider-horizontal .ui-slider-range{top:0;height:100%}.woocommerce .widget_price_filter .ui-slider-horizontal .ui-slider-range-min{left:-1px}.woocommerce .widget_price_filter .ui-slider-horizontal .ui-slider-range-max{right:-1px}.woocommerce-account .addresses .title:after,.woocommerce-account .addresses .title:before{content:" ";display:table}.woocommerce-account .addresses .title h3{float:left}.woocommerce-account .addresses .title .edit,.woocommerce-account ul.digital-downloads li .count{float:right}.woocommerce-account ol.commentlist.notes li.note p.meta{font-weight:700;margin-bottom:0}.woocommerce-account ol.commentlist.notes li.note .description p:last-child{margin-bottom:0}.woocommerce-account ul.digital-downloads{margin-left:0;padding-left:0}.woocommerce-account ul.digital-downloads li{list-style:none;margin-left:0;padding-left:0}.woocommerce-account ul.digital-downloads li:before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-right:.618em;content:"";text-decoration:none}.woocommerce-cart table.cart .product-thumbnail{min-width:32px}.woocommerce-cart table.cart img{width:32px;box-shadow:none}.woocommerce-cart table.cart td,.woocommerce-cart table.cart th{vertical-align:middle}.woocommerce-cart table.cart td.actions .coupon .input-text{float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #d3ced2;padding:6px 6px 5px;margin:0 4px 0 0;outline:0;line-height:1}.woocommerce-cart table.cart input{margin:0;vertical-align:middle;line-height:1}.woocommerce-cart .wc-proceed-to-checkout{padding:1em 0}.woocommerce-cart .wc-proceed-to-checkout:after,.woocommerce-cart .wc-proceed-to-checkout:before{content:" ";display:table}.woocommerce-cart .wc-proceed-to-checkout a.checkout-button{display:block;text-align:center;margin-bottom:1em}.woocommerce-cart .cart-collaterals .shipping_calculator .button{width:100%;float:none;display:block}.woocommerce-cart .cart-collaterals .shipping_calculator .shipping-calculator-button:after{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-left:.618em;content:"";text-decoration:none}.woocommerce-cart .cart-collaterals .cart_totals p small{color:#777;font-size:.83em}.woocommerce-cart .cart-collaterals .cart_totals table{border-collapse:separate;margin:0 0 6px;padding:0;border-left:0}.woocommerce-cart .cart-collaterals .cart_totals table tr:first-child td,.woocommerce-cart .cart-collaterals .cart_totals table tr:first-child th{border-top:0}.woocommerce-cart .cart-collaterals .cart_totals table th{width:25%}.woocommerce-cart .cart-collaterals .cart_totals table td,.woocommerce-cart .cart-collaterals .cart_totals table th{vertical-align:top;border-left:0;border-right:0;padding:6px 0;line-height:2em}.woocommerce-cart .cart-collaterals .cart_totals table small{color:#777}.woocommerce-cart .cart-collaterals .cart_totals table select{width:100%}.woocommerce-cart .cart-collaterals .cart_totals .discount td{color:#77a464}.woocommerce-cart .cart-collaterals .cart_totals tr td,.woocommerce-cart .cart-collaterals .cart_totals tr th{border-top:1px solid #ebe9eb}.woocommerce-cart .cart-collaterals .cross-sells ul.products li.product{margin-top:0}.woocommerce-checkout .checkout .col-2 h3#ship-to-different-address{float:left;clear:none}.woocommerce-checkout .checkout .col-2 .form-row-first,.woocommerce-checkout .checkout .col-2 .notes{clear:left}.woocommerce-checkout .checkout .create-account small{font-size:11px;color:#777;font-weight:400}.woocommerce-checkout .checkout div.shipping-address{padding:0;clear:left;width:100%}.single-product .twentythirteen p.stars,.woocommerce-checkout #payment ul.payment_methods:after,.woocommerce-checkout .checkout .shipping_address{clear:both}.woocommerce-checkout #payment{background:#ebe9eb;border-radius:5px}.woocommerce-checkout #payment ul.payment_methods{text-align:left;padding:1em;border-bottom:1px solid #d3ced2;margin:0;list-style:none}.woocommerce-checkout #payment ul.payment_methods:after,.woocommerce-checkout #payment ul.payment_methods:before{content:" ";display:table}.woocommerce-checkout #payment ul.payment_methods li{line-height:2;text-align:left;margin:0;font-weight:400}.woocommerce-checkout #payment ul.payment_methods li input{margin:0 1em 0 0}.woocommerce-checkout #payment ul.payment_methods li img{vertical-align:middle;margin:-2px 0 0 .5em;padding:0;position:relative;box-shadow:none}.woocommerce-checkout #payment ul.payment_methods li img+img{margin-left:2px}.woocommerce-checkout #payment div.form-row{padding:1em}.woocommerce-checkout #payment div.payment_box{position:relative;width:96%;padding:1em 2%;margin:1em 0;font-size:.92em;border-radius:2px;line-height:1.5;background-color:#dfdcde;color:#515151}.woocommerce-checkout #payment div.payment_box input.input-text,.woocommerce-checkout #payment div.payment_box textarea{border-color:#bbb3b9 #c7c1c6 #c7c1c6}.woocommerce-checkout #payment div.payment_box ::-webkit-input-placeholder{color:#bbb3b9}.woocommerce-checkout #payment div.payment_box :-moz-placeholder{color:#bbb3b9}.woocommerce-checkout #payment div.payment_box :-ms-input-placeholder{color:#bbb3b9}.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number{font-size:1.5em;padding:8px;background-repeat:no-repeat;background-position:right}.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.visa,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.visa,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.visa{background-image:url(../images/icons/credit-cards/visa.png)}.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.mastercard,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.mastercard,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.mastercard{background-image:url(../images/icons/credit-cards/mastercard.png)}.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.laser,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.laser,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.laser{background-image:url(../images/icons/credit-cards/laser.png)}.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.dinersclub,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.dinersclub,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.dinersclub{background-image:url(../images/icons/credit-cards/diners.png)}.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.maestro,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.maestro,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.maestro{background-image:url(../images/icons/credit-cards/maestro.png)}.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.jcb,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.jcb,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.jcb{background-image:url(../images/icons/credit-cards/jcb.png)}.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.amex,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.amex,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.amex{background-image:url(../images/icons/credit-cards/amex.png)}.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.discover,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.discover,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.discover{background-image:url(../images/icons/credit-cards/discover.png)}.woocommerce-checkout #payment div.payment_box span.help{font-size:.857em;color:#777;font-weight:400}.woocommerce-checkout #payment div.payment_box .form-row{margin:0 0 1em}.woocommerce-checkout #payment div.payment_box p:last-child{margin-bottom:0}.woocommerce-checkout #payment div.payment_box:after{content:"";display:block;border:8px solid #dfdcde;border-right-color:transparent;border-left-color:transparent;border-top-color:transparent;position:absolute;top:-3px;left:0;margin:-1em 0 0 2em}.woocommerce-checkout #payment .payment_method_paypal .about_paypal{float:right;line-height:52px;font-size:.83em}.woocommerce-checkout #payment .payment_method_paypal img{max-height:52px;vertical-align:middle}#content.twentyeleven .woocommerce-pagination a{font-size:1em;line-height:1}.single-product .twentythirteen #reply-title,.single-product .twentythirteen #respond #commentform,.single-product .twentythirteen .entry-summary{padding:0}.twentythirteen .woocommerce-breadcrumb{padding-top:40px}.twentyfourteen ul.products li.product{margin-top:0!important} \ No newline at end of file +@charset "UTF-8";.clear,.woocommerce .woocommerce-breadcrumb:after,.woocommerce .woocommerce-error:after,.woocommerce .woocommerce-info:after,.woocommerce .woocommerce-message:after{clear:both}.woocommerce div.product form.cart .reset_variations,.woocommerce form .form-row label.hidden{visibility:hidden}@-webkit-keyframes spin{100%{-webkit-transform:rotate(360deg)}}@-moz-keyframes spin{100%{-moz-transform:rotate(360deg)}}@keyframes spin{100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-ms-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}@font-face{font-family:star;src:url(../fonts/star.eot);src:url(../fonts/star.eot?#iefix) format("embedded-opentype"),url(../fonts/star.woff) format("woff"),url(../fonts/star.ttf) format("truetype"),url(../fonts/star.svg#star) format("svg");font-weight:400;font-style:normal}@font-face{font-family:WooCommerce;src:url(../fonts/WooCommerce.eot);src:url(../fonts/WooCommerce.eot?#iefix) format("embedded-opentype"),url(../fonts/WooCommerce.woff) format("woff"),url(../fonts/WooCommerce.ttf) format("truetype"),url(../fonts/WooCommerce.svg#WooCommerce) format("svg");font-weight:400;font-style:normal}p.demo_store{position:fixed;top:0;left:0;right:0;margin:0;width:100%;font-size:1em;padding:1em 0;text-align:center;background-color:#a46497;color:#fff;z-index:99998;box-shadow:0 1px 1em rgba(0,0,0,.2)}.admin-bar p.demo_store{top:32px}.woocommerce .blockUI.blockOverlay{position:relative}.woocommerce .blockUI.blockOverlay:before,.woocommerce .loader:before{height:1em;width:1em;position:absolute;top:50%;left:50%;margin-left:-.5em;margin-top:-.5em;display:block;content:"";-webkit-animation:spin 1s ease-in-out infinite;-moz-animation:spin 1s ease-in-out infinite;animation:spin 1s ease-in-out infinite;background:url(../images/icons/loader.svg) center center;background-size:cover;line-height:1;text-align:center;font-size:2em;color:rgba(0,0,0,.75)}.woocommerce a.remove{display:block;font-size:1.5em;height:1em;width:1em;text-align:center;line-height:1;border-radius:100%;color:red!important;text-decoration:none;font-weight:700;border:0}.woocommerce a.remove:hover{color:#fff!important;background:red}.woocommerce .woocommerce-error,.woocommerce .woocommerce-info,.woocommerce .woocommerce-message{padding:1em 2em 1em 3.5em!important;margin:0 0 2em!important;position:relative;background-color:#f7f6f7;color:#515151;border-top:3px solid #a46497;list-style:none!important;width:auto;word-wrap:break-word}.woocommerce .woocommerce-error:after,.woocommerce .woocommerce-error:before,.woocommerce .woocommerce-info:after,.woocommerce .woocommerce-info:before,.woocommerce .woocommerce-message:after,.woocommerce .woocommerce-message:before{content:" ";display:table}.woocommerce .woocommerce-error:before,.woocommerce .woocommerce-info:before,.woocommerce .woocommerce-message:before{font-family:WooCommerce;content:"\e028";display:inline-block;position:absolute;top:1em;left:1.5em}.woocommerce .woocommerce-error .button,.woocommerce .woocommerce-info .button,.woocommerce .woocommerce-message .button{float:right}.woocommerce .woocommerce-error li,.woocommerce .woocommerce-info li,.woocommerce .woocommerce-message li{list-style:none!important;padding-left:0!important;margin-left:0!important}.woocommerce .woocommerce-message{border-top-color:#8fae1b}.woocommerce .woocommerce-message:before{content:"\e015";color:#8fae1b}.woocommerce .woocommerce-info{border-top-color:#1e85be}.woocommerce .woocommerce-info:before{color:#1e85be}.woocommerce .woocommerce-error{border-top-color:#b81c23}.woocommerce .woocommerce-error:before{content:"\e016";color:#b81c23}.woocommerce small.note{display:block;color:#777;font-size:.857em;margin-top:10px}.woocommerce .woocommerce-breadcrumb{margin:0 0 1em;padding:0;font-size:.92em;color:#777}.woocommerce .woocommerce-breadcrumb:after,.woocommerce .woocommerce-breadcrumb:before{content:" ";display:table}.woocommerce .woocommerce-breadcrumb a{color:#777}.woocommerce .quantity .qty{width:3.631em;text-align:center}.woocommerce div.product{margin-bottom:0;position:relative}.woocommerce div.product .product_title{clear:none;margin-top:0;padding:0}.woocommerce #reviews #comments .add_review:after,.woocommerce .products ul:after,.woocommerce div.product form.cart:after,.woocommerce div.product p.cart:after,.woocommerce nav.woocommerce-pagination ul,.woocommerce ul.products:after{clear:both}.woocommerce div.product p.price,.woocommerce div.product span.price{color:#77a464;font-size:1.25em}.woocommerce div.product p.price ins,.woocommerce div.product span.price ins{background:inherit;font-weight:700}.woocommerce div.product p.price del,.woocommerce div.product span.price del{opacity:.5}.woocommerce div.product p.stock{font-size:.92em}.woocommerce div.product .stock{color:#77a464}.woocommerce div.product .out-of-stock{color:red}.woocommerce div.product .woocommerce-product-rating{margin-bottom:1.618em}.woocommerce div.product div.images,.woocommerce div.product div.summary{margin-bottom:2em}.woocommerce div.product div.images img{display:block;width:100%;height:auto;box-shadow:none}.woocommerce div.product div.images div.thumbnails{padding-top:1em}.woocommerce div.product div.social{text-align:right;margin:0 0 1em}.woocommerce div.product div.social span{margin:0 0 0 2px}.woocommerce div.product div.social span span{margin:0}.woocommerce div.product div.social span .stButton .chicklets{padding-left:16px;width:0}.woocommerce div.product div.social iframe{float:left;margin-top:3px}.woocommerce div.product .woocommerce-tabs ul.tabs{list-style:none;padding:0 0 0 1em;margin:0 0 1.618em;overflow:hidden;position:relative}.woocommerce div.product .woocommerce-tabs ul.tabs li{border:1px solid #d3ced2;background-color:#ebe9eb;display:inline-block;position:relative;z-index:0;border-radius:4px 4px 0 0;margin:0 -5px;padding:0 1em}.woocommerce div.product .woocommerce-tabs ul.tabs li a{display:inline-block;padding:.5em 0;font-weight:700;color:#515151;text-decoration:none}.woocommerce div.product form.cart:after,.woocommerce div.product form.cart:before,.woocommerce div.product p.cart:after,.woocommerce div.product p.cart:before{content:" ";display:table}.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover{text-decoration:none;color:#6b6b6b}.woocommerce div.product .woocommerce-tabs ul.tabs li.active{background:#fff;z-index:2;border-bottom-color:#fff}.woocommerce div.product .woocommerce-tabs ul.tabs li.active a{color:inherit;text-shadow:inherit}.woocommerce div.product .woocommerce-tabs ul.tabs li.active:before{box-shadow:2px 2px 0 #fff}.woocommerce div.product .woocommerce-tabs ul.tabs li.active:after{box-shadow:-2px 2px 0 #fff}.woocommerce div.product .woocommerce-tabs ul.tabs li:after,.woocommerce div.product .woocommerce-tabs ul.tabs li:before{border:1px solid #d3ced2;position:absolute;bottom:-1px;width:5px;height:5px;content:" "}.woocommerce div.product .woocommerce-tabs ul.tabs li:before{left:-6px;-webkit-border-bottom-right-radius:4px;-moz-border-bottom-right-radius:4px;border-bottom-right-radius:4px;border-width:0 1px 1px 0;box-shadow:2px 2px 0 #ebe9eb}.woocommerce div.product .woocommerce-tabs ul.tabs li:after{right:-6px;-webkit-border-bottom-left-radius:4px;-moz-border-bottom-left-radius:4px;border-bottom-left-radius:4px;border-width:0 0 1px 1px;box-shadow:-2px 2px 0 #ebe9eb}.woocommerce div.product .woocommerce-tabs ul.tabs:before{position:absolute;content:" ";width:100%;bottom:0;left:0;border-bottom:1px solid #d3ced2;z-index:1}.woocommerce div.product .woocommerce-tabs .panel{margin:0 0 2em;padding:0}.woocommerce div.product form.cart,.woocommerce div.product p.cart{margin-bottom:2em}.woocommerce div.product form.cart div.quantity{float:left;margin:0 4px 0 0}.woocommerce div.product form.cart table{border-width:0 0 1px}.woocommerce div.product form.cart table td{padding-left:0}.woocommerce div.product form.cart table div.quantity{float:none;margin:0}.woocommerce div.product form.cart table small.stock{display:block;float:none}.woocommerce div.product form.cart .variations{margin-bottom:1em;border:0}.woocommerce div.product form.cart .variations td,.woocommerce div.product form.cart .variations th{border:0}.woocommerce div.product form.cart .variations label{font-weight:700}.woocommerce div.product form.cart .variations select{width:100%;float:left}.woocommerce div.product form.cart .variations td.label{padding-right:1em}.woocommerce div.product form.cart .variations td{vertical-align:top}.woocommerce div.product form.cart .woocommerce-variation-description p{margin-bottom:1em}.woocommerce div.product form.cart .wc-no-matching-variations{display:none}.woocommerce div.product form.cart .button{vertical-align:middle;float:left}.woocommerce div.product form.cart .group_table td.label{padding-right:1em;padding-left:1em}.woocommerce div.product form.cart .group_table td{vertical-align:top;padding-bottom:.5em;border:0}.woocommerce span.onsale{min-height:3.236em;min-width:3.236em;padding:.202em;font-weight:700;position:absolute;text-align:center;line-height:3.236;top:-.5em;left:-.5em;margin:0;border-radius:100%;background-color:#77a464;color:#fff;font-size:.857em;-webkit-font-smoothing:antialiased}.woocommerce .products ul,.woocommerce ul.products{margin:0 0 1em;padding:0;list-style:none;clear:both}.woocommerce .products ul:after,.woocommerce .products ul:before,.woocommerce ul.products:after,.woocommerce ul.products:before{content:" ";display:table}.woocommerce .products ul li,.woocommerce ul.products li{list-style:none}.woocommerce ul.products li.product .onsale{top:0;right:0;left:auto;margin:-.5em -.5em 0 0}.woocommerce ul.products li.product h3{padding:.5em 0;margin:0;font-size:1em}.woocommerce ul.products li.product a{text-decoration:none}.woocommerce ul.products li.product a img{width:100%;height:auto;display:block;margin:0 0 1em;box-shadow:none}.woocommerce ul.products li.product strong{display:block}.woocommerce ul.products li.product .star-rating{font-size:.857em}.woocommerce ul.products li.product .button{margin-top:1em}.woocommerce ul.products li.product .price{color:#77a464;display:block;font-weight:400;margin-bottom:.5em;font-size:.857em}.woocommerce ul.products li.product .price del{color:inherit;opacity:.5;display:block}.woocommerce ul.products li.product .price ins{background:0 0;font-weight:700}.woocommerce ul.products li.product .price .from{font-size:.67em;margin:-2px 0 0;text-transform:uppercase;color:rgba(132,132,132,.5)}.woocommerce .woocommerce-ordering,.woocommerce .woocommerce-result-count{margin:0 0 1em}.woocommerce .woocommerce-ordering select{vertical-align:top}.woocommerce nav.woocommerce-pagination{text-align:center}.woocommerce nav.woocommerce-pagination ul{display:inline-block;white-space:nowrap;padding:0;border:1px solid #d3ced2;border-right:0;margin:1px}.woocommerce nav.woocommerce-pagination ul li{border-right:1px solid #d3ced2;padding:0;margin:0;float:left;display:inline;overflow:hidden}.woocommerce nav.woocommerce-pagination ul li a,.woocommerce nav.woocommerce-pagination ul li span{margin:0;text-decoration:none;line-height:1;font-size:1em;font-weight:400;padding:.5em;min-width:1em;display:block}.woocommerce nav.woocommerce-pagination ul li a:focus,.woocommerce nav.woocommerce-pagination ul li a:hover,.woocommerce nav.woocommerce-pagination ul li span.current{background:#ebe9eb;color:#8a7e88}.woocommerce #respond input#submit,.woocommerce a.button,.woocommerce button.button,.woocommerce input.button{font-size:100%;margin:0;line-height:1;cursor:pointer;position:relative;font-family:inherit;text-decoration:none;overflow:visible;padding:.618em 1em;font-weight:700;border-radius:3px;left:auto;color:#515151;background-color:#ebe9eb;border:0;white-space:nowrap;display:inline-block;background-image:none;box-shadow:none;-webkit-box-shadow:none;text-shadow:none}.woocommerce #respond input#submit.loading,.woocommerce a.button.loading,.woocommerce button.button.loading,.woocommerce input.button.loading{opacity:.25;padding-right:2.618em}.woocommerce #respond input#submit.loading:after,.woocommerce a.button.loading:after,.woocommerce button.button.loading:after,.woocommerce input.button.loading:after{font-family:WooCommerce;content:"\e01c";vertical-align:top;-webkit-font-smoothing:antialiased;font-weight:400;position:absolute;top:.618em;right:1em;-webkit-animation:spin 2s linear infinite;-moz-animation:spin 2s linear infinite;animation:spin 2s linear infinite}.woocommerce #respond input#submit.added:after,.woocommerce a.button.added:after,.woocommerce button.button.added:after,.woocommerce input.button.added:after{font-family:WooCommerce;content:"\e017";margin-left:.53em;vertical-align:bottom}.woocommerce #respond input#submit:hover,.woocommerce a.button:hover,.woocommerce button.button:hover,.woocommerce input.button:hover{background-color:#dad8da;text-decoration:none;background-image:none;color:#515151}.woocommerce #respond input#submit.alt,.woocommerce a.button.alt,.woocommerce button.button.alt,.woocommerce input.button.alt{background-color:#a46497;color:#fff;-webkit-font-smoothing:antialiased}.woocommerce #respond input#submit.alt:hover,.woocommerce a.button.alt:hover,.woocommerce button.button.alt:hover,.woocommerce input.button.alt:hover{background-color:#935386;color:#fff}.woocommerce #respond input#submit.alt.disabled,.woocommerce #respond input#submit.alt.disabled:hover,.woocommerce #respond input#submit.alt:disabled,.woocommerce #respond input#submit.alt:disabled:hover,.woocommerce #respond input#submit.alt:disabled[disabled],.woocommerce #respond input#submit.alt:disabled[disabled]:hover,.woocommerce a.button.alt.disabled,.woocommerce a.button.alt.disabled:hover,.woocommerce a.button.alt:disabled,.woocommerce a.button.alt:disabled:hover,.woocommerce a.button.alt:disabled[disabled],.woocommerce a.button.alt:disabled[disabled]:hover,.woocommerce button.button.alt.disabled,.woocommerce button.button.alt.disabled:hover,.woocommerce button.button.alt:disabled,.woocommerce button.button.alt:disabled:hover,.woocommerce button.button.alt:disabled[disabled],.woocommerce button.button.alt:disabled[disabled]:hover,.woocommerce input.button.alt.disabled,.woocommerce input.button.alt.disabled:hover,.woocommerce input.button.alt:disabled,.woocommerce input.button.alt:disabled:hover,.woocommerce input.button.alt:disabled[disabled],.woocommerce input.button.alt:disabled[disabled]:hover{background-color:#a46497;color:#fff}.woocommerce #respond input#submit.disabled,.woocommerce #respond input#submit:disabled,.woocommerce #respond input#submit:disabled[disabled],.woocommerce a.button.disabled,.woocommerce a.button:disabled,.woocommerce a.button:disabled[disabled],.woocommerce button.button.disabled,.woocommerce button.button:disabled,.woocommerce button.button:disabled[disabled],.woocommerce input.button.disabled,.woocommerce input.button:disabled,.woocommerce input.button:disabled[disabled]{color:inherit;cursor:not-allowed;opacity:.5}.woocommerce #respond input#submit.disabled:hover,.woocommerce #respond input#submit:disabled:hover,.woocommerce #respond input#submit:disabled[disabled]:hover,.woocommerce a.button.disabled:hover,.woocommerce a.button:disabled:hover,.woocommerce a.button:disabled[disabled]:hover,.woocommerce button.button.disabled:hover,.woocommerce button.button:disabled:hover,.woocommerce button.button:disabled[disabled]:hover,.woocommerce input.button.disabled:hover,.woocommerce input.button:disabled:hover,.woocommerce input.button:disabled[disabled]:hover{color:inherit;background-color:#ebe9eb}.woocommerce .cart .button,.woocommerce .cart input.button{float:none}.woocommerce a.added_to_cart{padding-top:.5em;white-space:nowrap;display:inline-block}.woocommerce #reviews #comments .add_review:after,.woocommerce #reviews #comments .add_review:before,.woocommerce #reviews #comments ol.commentlist li .comment-text:after,.woocommerce #reviews #comments ol.commentlist li .comment-text:before,.woocommerce #reviews #comments ol.commentlist:after,.woocommerce #reviews #comments ol.commentlist:before{content:" ";display:table}.woocommerce #reviews h2 small{float:right;color:#777;font-size:15px;margin:10px 0 0}.woocommerce #reviews h2 small a{text-decoration:none;color:#777}.woocommerce #reviews h3{margin:0}.woocommerce #reviews #respond{margin:0;border:0;padding:0}.woocommerce #reviews #comment{height:75px}.woocommerce #reviews #comments h2{clear:none}.woocommerce #review_form #respond:after,.woocommerce #reviews #comments ol.commentlist li .comment-text:after,.woocommerce #reviews #comments ol.commentlist:after,.woocommerce .woocommerce-product-rating:after,.woocommerce td.product-name dl.variation:after{clear:both}.woocommerce #reviews #comments ol.commentlist{margin:0;width:100%;background:0 0;list-style:none}.woocommerce #reviews #comments ol.commentlist li{padding:0;margin:0 0 20px;position:relative;background:0;border:0}.woocommerce #reviews #comments ol.commentlist li .meta{color:#777;font-size:.75em}.woocommerce #reviews #comments ol.commentlist li img.avatar{float:left;position:absolute;top:0;left:0;padding:3px;width:32px;height:auto;background:#ebe9eb;border:1px solid #e4e1e3;margin:0;box-shadow:none}.woocommerce #reviews #comments ol.commentlist li .comment-text{margin:0 0 0 50px;border:1px solid #e4e1e3;border-radius:4px;padding:1em 1em 0}.woocommerce #reviews #comments ol.commentlist li .comment-text p{margin:0 0 1em}.woocommerce #reviews #comments ol.commentlist li .comment-text p.meta{font-size:.83em}.woocommerce #reviews #comments ol.commentlist ul.children{list-style:none;margin:20px 0 0 50px}.woocommerce #reviews #comments ol.commentlist ul.children .star-rating{display:none}.woocommerce #reviews #comments ol.commentlist #respond{border:1px solid #e4e1e3;border-radius:4px;padding:1em 1em 0;margin:20px 0 0 50px}.woocommerce #reviews #comments .commentlist>li:before{content:""}.woocommerce .star-rating{float:right;overflow:hidden;position:relative;height:1em;line-height:1;font-size:1em;width:5.4em;font-family:star}.woocommerce .star-rating:before{content:"\73\73\73\73\73";color:#d3ced2;float:left;top:0;left:0;position:absolute}.woocommerce .star-rating span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}.woocommerce .star-rating span:before{content:"\53\53\53\53\53";top:0;position:absolute;left:0}.woocommerce .woocommerce-product-rating{line-height:2;display:block}.woocommerce .woocommerce-product-rating:after,.woocommerce .woocommerce-product-rating:before{content:" ";display:table}.woocommerce .woocommerce-product-rating .star-rating{margin:.5em 4px 0 0;float:left}.woocommerce .products .star-rating{display:block;margin:0 0 .5em;float:none}.woocommerce .hreview-aggregate .star-rating{margin:10px 0 0}.woocommerce #review_form #respond{position:static;margin:0;width:auto;padding:0;background:0 0;border:0}.woocommerce #review_form #respond:after,.woocommerce #review_form #respond:before{content:" ";display:table}.woocommerce #review_form #respond p{margin:0 0 10px}.woocommerce #review_form #respond .form-submit input{left:auto}.woocommerce #review_form #respond textarea{box-sizing:border-box;width:100%}.woocommerce p.stars{position:relative;font-size:1em}.woocommerce p.stars a{display:inline-block;font-weight:700;margin-right:1em;text-indent:-9999px;position:relative;border-bottom:0!important;outline:0}.woocommerce p.stars a:last-child{border-right:0}.woocommerce p.stars a.star-1,.woocommerce p.stars a.star-2,.woocommerce p.stars a.star-3,.woocommerce p.stars a.star-4,.woocommerce p.stars a.star-5{border-right:1px solid #ccc}.woocommerce p.stars a.star-1:after,.woocommerce p.stars a.star-2:after,.woocommerce p.stars a.star-3:after,.woocommerce p.stars a.star-4:after,.woocommerce p.stars a.star-5:after{font-family:WooCommerce;text-indent:0;position:absolute;top:0;left:0}.woocommerce p.stars a.star-1{width:2em}.woocommerce p.stars a.star-1:after{content:"\e021"}.woocommerce p.stars a.star-1.active:after,.woocommerce p.stars a.star-1:hover:after{content:""}.woocommerce p.stars a.star-2{width:3em}.woocommerce p.stars a.star-2:after{content:"\e021\e021"}.woocommerce p.stars a.star-2.active:after,.woocommerce p.stars a.star-2:hover:after{content:""}.woocommerce p.stars a.star-3{width:4em}.woocommerce p.stars a.star-3:after{content:"\e021\e021\e021"}.woocommerce p.stars a.star-3.active:after,.woocommerce p.stars a.star-3:hover:after{content:""}.woocommerce p.stars a.star-4{width:5em}.woocommerce p.stars a.star-4:after{content:"\e021\e021\e021\e021"}.woocommerce p.stars a.star-4.active:after,.woocommerce p.stars a.star-4:hover:after{content:""}.woocommerce p.stars a.star-5{width:6em;border:0}.woocommerce p.stars a.star-5:after{content:"\e021\e021\e021\e021\e021"}.woocommerce p.stars a.star-5.active:after,.woocommerce p.stars a.star-5:hover:after{content:""}.woocommerce table.shop_attributes{border:0;border-top:1px dotted rgba(0,0,0,.1);margin-bottom:1.618em;width:100%}.woocommerce table.shop_attributes td,.woocommerce table.shop_attributes th{margin:0;border-top:0;border-bottom:1px dotted rgba(0,0,0,.1);line-height:1.5}.woocommerce table.shop_attributes th{width:150px;font-weight:700;padding:8px}.woocommerce table.shop_attributes td{font-style:italic;padding:0}.woocommerce table.shop_attributes td p{margin:0;padding:8px 0}.woocommerce table.shop_attributes .alt td,.woocommerce table.shop_attributes .alt th{background:rgba(0,0,0,.025)}.woocommerce table.shop_table{border:1px solid rgba(0,0,0,.1);margin:0 -1px 24px 0;text-align:left;width:100%;border-collapse:separate;border-radius:5px}.woocommerce table.shop_table th{font-weight:700;padding:9px 12px}.woocommerce table.shop_table td{border-top:1px solid rgba(0,0,0,.1);padding:6px 12px;vertical-align:middle}.woocommerce table.shop_table td small{font-weight:400}.woocommerce table.shop_table tbody:first-child tr:first-child td,.woocommerce table.shop_table tbody:first-child tr:first-child th{border-top:0}.woocommerce table.shop_table tbody th,.woocommerce table.shop_table tfoot td,.woocommerce table.shop_table tfoot th{font-weight:700;border-top:1px solid rgba(0,0,0,.1)}.woocommerce table.my_account_orders{font-size:.85em}.woocommerce table.my_account_orders td,.woocommerce table.my_account_orders th{padding:4px 8px;vertical-align:middle}.woocommerce table.my_account_orders .button{white-space:nowrap}.woocommerce table.my_account_orders .order-actions{text-align:right}.woocommerce table.my_account_orders .order-actions .button{margin:.125em 0 .125em .25em}.woocommerce td.product-name dl.variation{margin:.25em 0}.woocommerce td.product-name dl.variation:after,.woocommerce td.product-name dl.variation:before{content:" ";display:table}.woocommerce td.product-name dl.variation dd,.woocommerce td.product-name dl.variation dt{display:inline-block;float:left;margin-bottom:1em}.woocommerce td.product-name dl.variation dt{font-weight:700;padding:0 0 .25em;margin:0 4px 0 0;clear:left}.woocommerce ul.cart_list li dl:after,.woocommerce ul.cart_list li:after,.woocommerce ul.product_list_widget li dl:after,.woocommerce ul.product_list_widget li:after{clear:both}.woocommerce td.product-name dl.variation dd{padding:0 0 .25em}.woocommerce td.product-name dl.variation dd p:last-child{margin-bottom:0}.woocommerce td.product-name p.backorder_notification{font-size:.83em}.woocommerce td.product-quantity{min-width:80px}.woocommerce ul.cart_list,.woocommerce ul.product_list_widget{list-style:none;padding:0;margin:0}.woocommerce ul.cart_list li,.woocommerce ul.product_list_widget li{padding:4px 0;margin:0;list-style:none}.woocommerce ul.cart_list li:after,.woocommerce ul.cart_list li:before,.woocommerce ul.product_list_widget li:after,.woocommerce ul.product_list_widget li:before{content:" ";display:table}.woocommerce ul.cart_list li a,.woocommerce ul.product_list_widget li a{display:block;font-weight:700}.woocommerce ul.cart_list li img,.woocommerce ul.product_list_widget li img{float:right;margin-left:4px;width:32px;height:auto;box-shadow:none}.woocommerce ul.cart_list li dl,.woocommerce ul.product_list_widget li dl{margin:0;padding-left:1em;border-left:2px solid rgba(0,0,0,.1)}.woocommerce ul.cart_list li dl:after,.woocommerce ul.cart_list li dl:before,.woocommerce ul.product_list_widget li dl:after,.woocommerce ul.product_list_widget li dl:before{content:" ";display:table}.woocommerce ul.cart_list li dl dd,.woocommerce ul.cart_list li dl dt,.woocommerce ul.product_list_widget li dl dd,.woocommerce ul.product_list_widget li dl dt{display:inline-block;float:left;margin-bottom:1em}.woocommerce ul.cart_list li dl dt,.woocommerce ul.product_list_widget li dl dt{font-weight:700;padding:0 0 .25em;margin:0 4px 0 0;clear:left}.woocommerce .order_details:after,.woocommerce .widget_layered_nav ul li:after,.woocommerce .widget_shopping_cart .buttons:after,.woocommerce-account .addresses .title:after,.woocommerce-cart .wc-proceed-to-checkout:after,.woocommerce.widget_shopping_cart .buttons:after{clear:both}.woocommerce ul.cart_list li dl dd,.woocommerce ul.product_list_widget li dl dd{padding:0 0 .25em}.woocommerce ul.cart_list li dl dd p:last-child,.woocommerce ul.product_list_widget li dl dd p:last-child{margin-bottom:0}.woocommerce ul.cart_list li .star-rating,.woocommerce ul.product_list_widget li .star-rating{float:none}.woocommerce .widget_shopping_cart .total,.woocommerce.widget_shopping_cart .total{border-top:3px double #ebe9eb;padding:4px 0 0}.woocommerce .widget_shopping_cart .total strong,.woocommerce.widget_shopping_cart .total strong{min-width:40px;display:inline-block}.woocommerce .widget_shopping_cart .cart_list li,.woocommerce.widget_shopping_cart .cart_list li{padding-left:2em;position:relative;padding-top:0}.woocommerce .widget_shopping_cart .cart_list li a.remove,.woocommerce.widget_shopping_cart .cart_list li a.remove{position:absolute;top:0;left:0}.woocommerce .widget_shopping_cart .buttons:after,.woocommerce .widget_shopping_cart .buttons:before,.woocommerce.widget_shopping_cart .buttons:after,.woocommerce.widget_shopping_cart .buttons:before{content:" ";display:table}.woocommerce form .form-row{padding:3px;margin:0 0 6px}.woocommerce form .form-row [placeholder]:focus::-webkit-input-placeholder{-webkit-transition:opacity .5s .5s ease;-moz-transition:opacity .5s .5s ease;transition:opacity .5s .5s ease;opacity:0}.woocommerce form .form-row label{line-height:2}.woocommerce form .form-row label.inline{display:inline}.woocommerce form .form-row select{cursor:pointer;margin:0}.woocommerce form .form-row .required{color:red;font-weight:700;border:0}.woocommerce form .form-row .input-checkbox{display:inline;margin:-2px 8px 0 0;text-align:center;vertical-align:middle}.woocommerce form .form-row input.input-text,.woocommerce form .form-row textarea{box-sizing:border-box;width:100%;margin:0;outline:0;line-height:1}.woocommerce form .form-row textarea{height:4em;line-height:1.5;display:block;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.woocommerce form .form-row .select2-container{width:100%;line-height:2em}.woocommerce form .form-row.woocommerce-invalid .select2-container,.woocommerce form .form-row.woocommerce-invalid input.input-text,.woocommerce form .form-row.woocommerce-invalid select{border-color:#a00}.woocommerce form .form-row.woocommerce-validated .select2-container,.woocommerce form .form-row.woocommerce-validated input.input-text,.woocommerce form .form-row.woocommerce-validated select{border-color:#69bf29}.woocommerce form .form-row ::-webkit-input-placeholder{line-height:normal}.woocommerce form .form-row :-moz-placeholder{line-height:normal}.woocommerce form .form-row :-ms-input-placeholder{line-height:normal}.woocommerce form.checkout_coupon,.woocommerce form.login,.woocommerce form.register{border:1px solid #d3ced2;padding:20px;margin:2em 0;text-align:left;border-radius:5px}.woocommerce ul#shipping_method{list-style:none;margin:0;padding:0}.woocommerce ul#shipping_method li{margin:0;padding:.25em 0 .25em 22px;text-indent:-22px;list-style:none}.woocommerce ul#shipping_method .amount{font-weight:700}.woocommerce p.woocommerce-shipping-contents{margin:0}.woocommerce .order_details{margin:0 0 1.5em;list-style:none}.woocommerce .order_details:after,.woocommerce .order_details:before{content:" ";display:table}.woocommerce .order_details li{float:left;margin-right:2em;text-transform:uppercase;font-size:.715em;line-height:1;border-right:1px dashed #d3ced2;padding-right:2em;margin-left:0;padding-left:0}.woocommerce .order_details li strong{display:block;font-size:1.4em;text-transform:none;line-height:1.5}.woocommerce .order_details li:last-of-type{border:none}.woocommerce .widget_layered_nav ul{margin:0;padding:0;border:0;list-style:none}.woocommerce .widget_layered_nav ul li{padding:0 0 1px;list-style:none}.woocommerce .widget_layered_nav ul li:after,.woocommerce .widget_layered_nav ul li:before{content:" ";display:table}.woocommerce .widget_layered_nav ul li.chosen a:before,.woocommerce .widget_layered_nav_filters ul li a:before{font-family:WooCommerce;speak:none;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;text-decoration:none;font-weight:400;line-height:1;content:"";color:#a00}.woocommerce .widget_layered_nav ul li a,.woocommerce .widget_layered_nav ul li span{padding:1px 0}.woocommerce .widget_layered_nav ul li.chosen a:before{margin-right:.618em}.woocommerce .widget_layered_nav_filters ul{margin:0;padding:0;border:0;list-style:none;overflow:hidden;zoom:1}.woocommerce .widget_layered_nav_filters ul li{float:left;padding:0 1px 1px 0;list-style:none}.woocommerce .widget_layered_nav_filters ul li a{text-decoration:none}.woocommerce .widget_layered_nav_filters ul li a:before{margin-right:.618em}.woocommerce .widget_price_filter .price_slider{margin-bottom:1em}.woocommerce .widget_price_filter .price_slider_amount{text-align:right;line-height:2.4;font-size:.8751em}.woocommerce .widget_price_filter .price_slider_amount .button{font-size:1.15em;float:left}.woocommerce .widget_price_filter .ui-slider{position:relative;text-align:left;margin-left:.5em;margin-right:.5em}.woocommerce .widget_price_filter .ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1em;height:1em;background-color:#a46497;border-radius:1em;cursor:ew-resize;outline:0;top:-.3em;margin-left:-.5em}.woocommerce .widget_price_filter .ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;border-radius:1em;background-color:#a46497}.woocommerce .widget_price_filter .price_slider_wrapper .ui-widget-content{border-radius:1em;background-color:#602053;border:0}.woocommerce .widget_price_filter .ui-slider-horizontal{height:.5em}.woocommerce .widget_price_filter .ui-slider-horizontal .ui-slider-range{top:0;height:100%}.woocommerce .widget_price_filter .ui-slider-horizontal .ui-slider-range-min{left:-1px}.woocommerce .widget_price_filter .ui-slider-horizontal .ui-slider-range-max{right:-1px}.woocommerce-account .addresses .title:after,.woocommerce-account .addresses .title:before{content:" ";display:table}.woocommerce-account .addresses .title h3{float:left}.woocommerce-account .addresses .title .edit,.woocommerce-account ul.digital-downloads li .count{float:right}.woocommerce-account ol.commentlist.notes li.note p.meta{font-weight:700;margin-bottom:0}.woocommerce-account ol.commentlist.notes li.note .description p:last-child{margin-bottom:0}.woocommerce-account ul.digital-downloads{margin-left:0;padding-left:0}.woocommerce-account ul.digital-downloads li{list-style:none;margin-left:0;padding-left:0}.woocommerce-account ul.digital-downloads li:before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-right:.618em;content:"";text-decoration:none}.woocommerce-cart table.cart .product-thumbnail{min-width:32px}.woocommerce-cart table.cart img{width:32px;box-shadow:none}.woocommerce-cart table.cart td,.woocommerce-cart table.cart th{vertical-align:middle}.woocommerce-cart table.cart td.actions .coupon .input-text{float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #d3ced2;padding:6px 6px 5px;margin:0 4px 0 0;outline:0;line-height:1}.woocommerce-cart table.cart input{margin:0;vertical-align:middle;line-height:1}.woocommerce-cart .wc-proceed-to-checkout{padding:1em 0}.woocommerce-cart .wc-proceed-to-checkout:after,.woocommerce-cart .wc-proceed-to-checkout:before{content:" ";display:table}.woocommerce-cart .wc-proceed-to-checkout a.checkout-button{display:block;text-align:center;margin-bottom:1em}.woocommerce-cart .cart-collaterals .shipping_calculator .button{width:100%;float:none;display:block}.woocommerce-cart .cart-collaterals .shipping_calculator .shipping-calculator-button:after{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-left:.618em;content:"";text-decoration:none}.woocommerce-cart .cart-collaterals .cart_totals p small{color:#777;font-size:.83em}.woocommerce-cart .cart-collaterals .cart_totals table{border-collapse:separate;margin:0 0 6px;padding:0;border-left:0}.woocommerce-cart .cart-collaterals .cart_totals table tr:first-child td,.woocommerce-cart .cart-collaterals .cart_totals table tr:first-child th{border-top:0}.woocommerce-cart .cart-collaterals .cart_totals table th{width:25%}.woocommerce-cart .cart-collaterals .cart_totals table td,.woocommerce-cart .cart-collaterals .cart_totals table th{vertical-align:top;border-left:0;border-right:0;padding:6px 0;line-height:2em}.woocommerce-cart .cart-collaterals .cart_totals table small{color:#777}.woocommerce-cart .cart-collaterals .cart_totals table select{width:100%}.woocommerce-cart .cart-collaterals .cart_totals .discount td{color:#77a464}.woocommerce-cart .cart-collaterals .cart_totals tr td,.woocommerce-cart .cart-collaterals .cart_totals tr th{border-top:1px solid #ebe9eb}.woocommerce-cart .cart-collaterals .cross-sells ul.products li.product{margin-top:0}.woocommerce-checkout .checkout .col-2 h3#ship-to-different-address{float:left;clear:none}.woocommerce-checkout .checkout .col-2 .form-row-first,.woocommerce-checkout .checkout .col-2 .notes{clear:left}.woocommerce-checkout .checkout .create-account small{font-size:11px;color:#777;font-weight:400}.woocommerce-checkout .checkout div.shipping-address{padding:0;clear:left;width:100%}.single-product .twentythirteen p.stars,.woocommerce-checkout #payment ul.payment_methods:after,.woocommerce-checkout .checkout .shipping_address{clear:both}.woocommerce-checkout #payment{background:#ebe9eb;border-radius:5px}.woocommerce-checkout #payment ul.payment_methods{text-align:left;padding:1em;border-bottom:1px solid #d3ced2;margin:0;list-style:none}.woocommerce-checkout #payment ul.payment_methods:after,.woocommerce-checkout #payment ul.payment_methods:before{content:" ";display:table}.woocommerce-checkout #payment ul.payment_methods li{line-height:2;text-align:left;margin:0;font-weight:400}.woocommerce-checkout #payment ul.payment_methods li input{margin:0 1em 0 0}.woocommerce-checkout #payment ul.payment_methods li img{vertical-align:middle;margin:-2px 0 0 .5em;padding:0;position:relative;box-shadow:none}.woocommerce-checkout #payment ul.payment_methods li img+img{margin-left:2px}.woocommerce-checkout #payment div.form-row{padding:1em}.woocommerce-checkout #payment div.payment_box{position:relative;width:96%;padding:1em 2%;margin:1em 0;font-size:.92em;border-radius:2px;line-height:1.5;background-color:#dfdcde;color:#515151}.woocommerce-checkout #payment div.payment_box input.input-text,.woocommerce-checkout #payment div.payment_box textarea{border-color:#bbb3b9 #c7c1c6 #c7c1c6}.woocommerce-checkout #payment div.payment_box ::-webkit-input-placeholder{color:#bbb3b9}.woocommerce-checkout #payment div.payment_box :-moz-placeholder{color:#bbb3b9}.woocommerce-checkout #payment div.payment_box :-ms-input-placeholder{color:#bbb3b9}.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number{font-size:1.5em;padding:8px;background-repeat:no-repeat;background-position:right}.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.visa,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.visa,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.visa{background-image:url(../images/icons/credit-cards/visa.png)}.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.mastercard,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.mastercard,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.mastercard{background-image:url(../images/icons/credit-cards/mastercard.png)}.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.laser,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.laser,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.laser{background-image:url(../images/icons/credit-cards/laser.png)}.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.dinersclub,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.dinersclub,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.dinersclub{background-image:url(../images/icons/credit-cards/diners.png)}.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.maestro,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.maestro,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.maestro{background-image:url(../images/icons/credit-cards/maestro.png)}.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.jcb,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.jcb,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.jcb{background-image:url(../images/icons/credit-cards/jcb.png)}.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.amex,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.amex,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.amex{background-image:url(../images/icons/credit-cards/amex.png)}.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-cvc.discover,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-expiry.discover,.woocommerce-checkout #payment div.payment_box .wc-credit-card-form-card-number.discover{background-image:url(../images/icons/credit-cards/discover.png)}.woocommerce-checkout #payment div.payment_box span.help{font-size:.857em;color:#777;font-weight:400}.woocommerce-checkout #payment div.payment_box .form-row{margin:0 0 1em}.woocommerce-checkout #payment div.payment_box p:last-child{margin-bottom:0}.woocommerce-checkout #payment div.payment_box:after{content:"";display:block;border:8px solid #dfdcde;border-right-color:transparent;border-left-color:transparent;border-top-color:transparent;position:absolute;top:-3px;left:0;margin:-1em 0 0 2em}.woocommerce-checkout #payment .payment_method_paypal .about_paypal{float:right;line-height:52px;font-size:.83em}.woocommerce-checkout #payment .payment_method_paypal img{max-height:52px;vertical-align:middle}#content.twentyeleven .woocommerce-pagination a{font-size:1em;line-height:1}.single-product .twentythirteen #reply-title,.single-product .twentythirteen #respond #commentform,.single-product .twentythirteen .entry-summary{padding:0}.twentythirteen .woocommerce-breadcrumb{padding-top:40px}.twentyfourteen ul.products li.product{margin-top:0!important} \ No newline at end of file diff --git a/assets/css/woocommerce.scss b/assets/css/woocommerce.scss index 89b7e67617d..e3d7727aac6 100644 --- a/assets/css/woocommerce.scss +++ b/assets/css/woocommerce.scss @@ -188,7 +188,6 @@ p.demo_store { del { opacity: 0.5; - display: block; } } @@ -204,7 +203,7 @@ p.demo_store { color: red; } - .woocommerce-product-rating{ + .woocommerce-product-rating { margin-bottom: 1.618em; } @@ -405,6 +404,20 @@ p.demo_store { } } + .woocommerce-variation-description { + p { + margin-bottom: 1em; + } + } + + .reset_variations { + visibility: hidden; + } + + .wc-no-matching-variations { + display: none; + } + .button { vertical-align: middle; float: left; diff --git a/assets/js/frontend/add-to-cart-variation.js b/assets/js/frontend/add-to-cart-variation.js index e23ed226a35..6162b0997d0 100644 --- a/assets/js/frontend/add-to-cart-variation.js +++ b/assets/js/frontend/add-to-cart-variation.js @@ -3,500 +3,470 @@ */ ;(function ( $, window, document, undefined ) { - $.fn.wc_variation_form = function () { - - $.fn.wc_variation_form.find_matching_variations = function( product_variations, settings ) { - var matching = []; - - for ( var i = 0; i < product_variations.length; i++ ) { - var variation = product_variations[i]; - var variation_id = variation.variation_id; - - if ( $.fn.wc_variation_form.variations_match( variation.attributes, settings ) ) { - matching.push( variation ); - } - } - - return matching; - }; - - $.fn.wc_variation_form.variations_match = function( attrs1, attrs2 ) { - var match = true; - - for ( var attr_name in attrs1 ) { - if ( attrs1.hasOwnProperty( attr_name ) ) { - var val1 = attrs1[ attr_name ]; - var val2 = attrs2[ attr_name ]; - - if ( val1 !== undefined && val2 !== undefined && val1.length !== 0 && val2.length !== 0 && val1 !== val2 ) { - match = false; - } - } - } - - return match; - }; - - $.fn.wc_variation_form.get_variation_description_html = function( form, selected_index ) { - var all_variations = form.data( 'product_variations' ), - var_description_html; - - if ( selected_index > 0 ) { - // minus an index to account for first non selected option - selected_index--; - - if ( all_variations[ selected_index ].hasOwnProperty( 'variation_description' ) ) { - var_description_html = '
' + all_variations[ selected_index ].variation_description + '
'; - - return var_description_html; - } - } - - return ''; - }; + $.fn.wc_variation_form = function() { + var $form = this; + var $product = $form.closest('.product'); + var $product_id = parseInt( $form.data( 'product_id' ) ); + var $product_variations = $form.data( 'product_variations' ); + var $use_ajax = $product_variations === false; + var $xhr = false; + var $reset_variations = $form.find( '.reset_variations' ); // Unbind any existing events - this.unbind( 'check_variations update_variation_values found_variation' ); - this.find( '.reset_variations' ).unbind( 'click' ); - this.find( '.variations select' ).unbind( 'change focusin' ); + $form.unbind( 'check_variations update_variation_values found_variation' ); + $form.find( '.reset_variations' ).unbind( 'click' ); + $form.find( '.variations select' ).unbind( 'change focusin' ); - // Bind events - $form = this + // Bind new events to form + $form - // On clicking the reset variation button - .on( 'click', '.reset_variations', function( event ) { + // On clicking the reset variation button + .on( 'click', '.reset_variations', function( event ) { + $form.find( '.variations select' ).val( '' ).change(); + $form.triggerHandler( 'reset_data' ); + return false; + } ) - $( this ).closest( '.variations_form' ).find( '.variations select' ).val( '' ).change(); + // Reset product data + .on( 'reset_data', function( event ) { + var to_reset = { + '.sku': 'o_sku', + '.product_weight': 'o_weight', + '.product_dimensions': 'o_dimensions' + }; + $.each( to_reset, function( selector, data_attribute ) { + var $el = $product.find( selector ); + if ( $el.attr( 'data-' + data_attribute ) ) { + $el.text( $el.attr( 'data-' + data_attribute ) ); + } + }); + $form.find( '.woocommerce-variation-description' ).remove(); + $form.triggerHandler( 'reset_image' ); + $form.find( '.single_variation_wrap' ).slideUp( 200 ).triggerHandler( 'hide_variation' ); + } ) - var $sku = $( this ).closest( '.product' ).find( '.sku' ), - $weight = $( this ).closest( '.product' ).find( '.product_weight' ), - $dimensions = $( this ).closest( '.product' ).find( '.product_dimensions' ); + // Reset product image + .on( 'reset_image', function( event ) { + var $product_img = $product.find( 'div.images img:eq(0)' ), + $product_link = $product.find( 'div.images a.zoom:eq(0)' ), + o_src = $product_img.attr( 'data-o_src' ), + o_title = $product_img.attr( 'data-o_title' ), + o_alt = $product_img.attr( 'data-o_title' ), + o_href = $product_link.attr( 'data-o_href' ); - if ( $sku.attr( 'data-o_sku' ) ) - $sku.text( $sku.attr( 'data-o_sku' ) ); + if ( o_src !== undefined ) { + $product_img.attr( 'src', o_src ); + } + if ( o_href !== undefined ) { + $product_link.attr( 'href', o_href ); + } + if ( o_title !== undefined ) { + $product_img.attr( 'title', o_title ); + $product_link.attr( 'title', o_title ); + } + if ( o_alt !== undefined ) { + $product_img.attr( 'alt', o_alt ); + } + } ) - if ( $weight.attr( 'data-o_weight' ) ) - $weight.text( $weight.attr( 'data-o_weight' ) ); + // On changing an attribute + .on( 'change', '.variations select', function( event ) { + $form.find( 'input[name="variation_id"], input.variation_id' ).val( '' ).change(); + $form.find( '.wc-no-matching-variations' ).remove(); - if ( $dimensions.attr( 'data-o_dimensions' ) ) - $dimensions.text( $dimensions.attr( 'data-o_dimensions' ) ); - - return false; - } ) - - // Upon changing an option - .on( 'change', '.variations select', function( event ) { - - var $variation_form = $( this ).closest( '.variations_form' ), - var_description = $.fn.wc_variation_form.get_variation_description_html( $variation_form, this.selectedIndex ); - - // remove variation description on change - $variation_form.find( '.variations' ).next( '.woocommerce-variation-description' ).remove(); - - // display variation description - if ( var_description ) { - $variation_form.find( '.variations' ).after( var_description ); + if ( $use_ajax ) { + if ( $xhr ) { + $xhr.abort(); } - if ( $variation_form.find( 'input.variation_id' ).length > 0 ) { - $variation_form.find( 'input.variation_id' ).val( '' ).change(); - } else { - $variation_form.find( 'input[name=variation_id]' ).val( '' ).change(); - } - - $variation_form - .trigger( 'woocommerce_variation_select_change' ) - .trigger( 'check_variations', [ '', false ] ); - - $( this ).blur(); - - if( $().uniform && $.isFunction( $.uniform.update ) ) { - $.uniform.update(); - } - - // Custom event for when variation selection has been changed - $variation_form.trigger( 'woocommerce_variation_has_changed' ); - - } ) - - // Upon gaining focus - .on( 'focusin touchstart', '.variations select', function( event ) { - - $variation_form = $( this ).closest( '.variations_form' ); - - // Get attribute name from data-attribute_name, or from input name if it doesn't exist - if ( typeof( $( this ).data( 'attribute_name' ) ) != 'undefined' ) - attribute_name = $( this ).data( 'attribute_name' ); - else - attribute_name = $( this ).attr( 'name' ); - - $variation_form - .trigger( 'woocommerce_variation_select_focusin' ) - .trigger( 'check_variations', [ attribute_name, true ] ); - - } ) - - // Check variations - .on( 'check_variations', function( event, exclude, focus ) { - var all_set = true, - any_set = false, - showing_variation = false, - current_settings = {}, - $variation_form = $( this ), - $reset_variations = $variation_form.find( '.reset_variations' ); - - $variation_form.find( '.variations select' ).each( function() { - - // Get attribute name from data-attribute_name, or from input name if it doesn't exist - if ( typeof( $( this ).data( 'attribute_name' ) ) != 'undefined' ) - attribute_name = $( this ).data( 'attribute_name' ); - else - attribute_name = $( this ).attr( 'name' ); + var all_attributes_chosen = true; + var some_attributes_chosen = false; + var data = {}; + $form.find( '.variations select' ).each( function() { + var attribute_name = $( this ).data( 'attribute_name' ) || $( this ).attr( 'name' ); if ( $( this ).val().length === 0 ) { - all_set = false; + all_attributes_chosen = false; } else { - any_set = true; - } - - if ( exclude && attribute_name === exclude ) { - - all_set = false; - current_settings[ attribute_name ] = ''; - - } else { - - // Encode entities - value = $( this ).val(); - - // Add to settings array - current_settings[ attribute_name ] = value; + some_attributes_chosen = true; } + data[ attribute_name ] = $( this ).val(); }); - var product_id = parseInt( $variation_form.data( 'product_id' ) ), - all_variations = $variation_form.data( 'product_variations' ); - - // Fallback to window property if not set - backwards compat - if ( ! all_variations ) - all_variations = window.product_variations.product_id; - if ( ! all_variations ) - all_variations = window.product_variations; - if ( ! all_variations ) - all_variations = window['product_variations_' + product_id ]; - - var matching_variations = $.fn.wc_variation_form.find_matching_variations( all_variations, current_settings ); - - if ( all_set ) { - - var variation = matching_variations.shift(); - - if ( variation ) { - - // Found - set ID - - // Get variation input by class, or by input name if class doesn't exist - if ( $variation_form.find( 'input.variation_id' ).length > 0 ) - $variation_input = $variation_form.find( 'input.variation_id' ); - else - $variation_input = $variation_form.find( 'input[name=variation_id]' ); - - // Set ID - $variation_input - .val( variation.variation_id ) - .change(); - - $variation_form.trigger( 'found_variation', [ variation ] ); - - } else { - - // Nothing found - reset fields - $variation_form.find( '.variations select' ).val( '' ); - - if ( ! focus ) - $variation_form.trigger( 'reset_image' ); - - alert( wc_add_to_cart_variation_params.i18n_no_matching_variations_text ); - - } + if ( all_attributes_chosen ) { + // Get a matchihng variation via ajax + data.product_id = $product_id; + $xhr = $.ajax( { + url: wc_cart_fragments_params.wc_ajax_url + 'get_variation/', + type: 'POST', + data: data, + success: function( variation ) { + if ( variation ) { + $form.find( 'input[name="variation_id"], input.variation_id' ) + .val( variation.variation_id ) + .change(); + $form.triggerHandler( 'found_variation', [ variation ] ); + } else { + $form.triggerHandler( 'reset_data' ); + $form.find( '.single_variation_wrap' ).after( '

' + wc_add_to_cart_variation_params.i18n_no_matching_variations_text + '

' ); + $form.find( '.wc-no-matching-variations' ).slideDown( 200 ); + } + } + } ); } else { - - $variation_form.trigger( 'update_variation_values', [ matching_variations ] ); - - if ( ! focus ) - $variation_form.trigger( 'reset_image' ); - - if ( ! exclude ) { - $variation_form.find( '.single_variation_wrap' ).slideUp( 200 ).trigger( 'hide_variation' ); - } - + $form.triggerHandler( 'reset_data' ); } - - if ( any_set ) { - - if ( $reset_variations.css( 'visibility' ) === 'hidden' ) + if ( some_attributes_chosen ) { + if ( $reset_variations.css( 'visibility' ) === 'hidden' ) { $reset_variations.css( 'visibility', 'visible' ).hide().fadeIn(); - + } } else { - $reset_variations.css( 'visibility', 'hidden' ); - $sku = $( this ).closest( '.product' ).find( '.sku' ); - $sku.text( $sku.attr( 'data-o_sku' ) ); + } + } else { + $form.triggerHandler( 'woocommerce_variation_select_change' ) + $form.triggerHandler( 'check_variations', [ '', false ] ); + $( this ).blur(); + } + // Custom event for when variation selection has been changed + $form.triggerHandler( 'woocommerce_variation_has_changed' ); + } ) + + // Upon gaining focus + .on( 'focusin touchstart', '.variations select', function( event ) { + if ( ! $use_ajax ) { + $form.triggerHandler( 'woocommerce_variation_select_focusin' ) + $form.triggerHandler( 'check_variations', [ $( this ).data( 'attribute_name' ) || $( this ).attr( 'name' ), true ] ); + } + } ) + + // Show single variation details (price, stock, image) + .on( 'found_variation', function( event, variation ) { + var $product_img = $product.find( 'div.images img:eq(0)' ), + $product_link = $product.find( 'div.images a.zoom:eq(0)' ), + o_src = $product_img.attr( 'data-o_src' ), + o_title = $product_img.attr( 'data-o_title' ), + o_alt = $product_img.attr( 'data-o_alt' ), + o_href = $product_link.attr( 'data-o_href' ), + variation_image = variation.image_src, + variation_link = variation.image_link, + variation_caption = variation.image_caption, + variation_title = variation.image_title, + variation_alt = variation.image_alt; + + $form.find( '.variations_button' ).show(); + $form.find( '.single_variation' ).html( variation.price_html + variation.availability_html ); + + if ( o_src === undefined ) { + o_src = ( ! $product_img.attr( 'src' ) ) ? '' : $product_img.attr( 'src' ); + $product_img.attr( 'data-o_src', o_src ); + } + + if ( o_href === undefined ) { + o_href = ( ! $product_link.attr( 'href' ) ) ? '' : $product_link.attr( 'href' ); + $product_link.attr( 'data-o_href', o_href ); + } + + if ( o_title === undefined ) { + o_title = ( ! $product_img.attr( 'title' ) ) ? '' : $product_img.attr( 'title' ); + $product_img.attr( 'data-o_title', o_title ); + } + + if ( o_alt === undefined ) { + o_alt = ( ! $product_img.attr( 'alt' ) ) ? '' : $product_img.attr( 'alt' ); + $product_img.attr( 'data-o_alt', o_alt ); + } + + if ( variation_image && variation_image.length > 1 ) { + $product_img + .attr( 'src', variation_image ) + .attr( 'alt', variation_title ) + .attr( 'title', variation_title ); + $product_link + .attr( 'href', variation_link ) + .attr( 'title', variation_caption ); + } else { + $product_img + .attr( 'src', o_src ) + .attr( 'alt', o_alt ) + .attr( 'title', o_title ); + $product_link + .attr( 'href', o_href ) + .attr( 'title', o_title ); + } + + var $single_variation_wrap = $form.find( '.single_variation_wrap' ), + $sku = $product.find( '.product_meta' ).find( '.sku' ), + $weight = $product.find( '.product_weight' ), + $dimensions = $product.find( '.product_dimensions' ); + + if ( ! $sku.attr( 'data-o_sku' ) ) { + $sku.attr( 'data-o_sku', $sku.text() ); + } + + if ( ! $weight.attr( 'data-o_weight' ) ) { + $weight.attr( 'data-o_weight', $weight.text() ); + } + + if ( ! $dimensions.attr( 'data-o_dimensions' ) ) { + $dimensions.attr( 'data-o_dimensions', $dimensions.text() ); + } + + if ( variation.sku ) { + $sku.text( variation.sku ); + } else { + $sku.text( $sku.attr( 'data-o_sku' ) ); + } + + if ( variation.weight ) { + $weight.text( variation.weight ); + } else { + $weight.text( $weight.attr( 'data-o_weight' ) ); + } + + if ( variation.dimensions ) { + $dimensions.text( variation.dimensions ); + } else { + $dimensions.text( $dimensions.attr( 'data-o_dimensions' ) ); + } + + $single_variation_wrap.find( '.quantity' ).show(); + + if ( ! variation.is_purchasable || ! variation.is_in_stock || ! variation.variation_is_visible ) { + $form.find( '.variations_button' ).hide(); + } + + if ( ! variation.variation_is_visible ) { + $form.find( '.single_variation' ).html( '

' + wc_add_to_cart_variation_params.i18n_unavailable_text + '

' ); + } + + if ( variation.min_qty !== '' ) { + $single_variation_wrap.find( '.quantity input.qty' ).attr( 'min', variation.min_qty ).val( variation.min_qty ); + } else { + $single_variation_wrap.find( '.quantity input.qty' ).removeAttr( 'min' ); + } + + if ( variation.max_qty !== '' ) { + $single_variation_wrap.find( '.quantity input.qty' ).attr( 'max', variation.max_qty ); + } else { + $single_variation_wrap.find( '.quantity input.qty' ).removeAttr( 'max' ); + } + + if ( variation.is_sold_individually === 'yes' ) { + $single_variation_wrap.find( '.quantity input.qty' ).val( '1' ); + $single_variation_wrap.find( '.quantity' ).hide(); + } + + // display variation description + $form.find( '.woocommerce-variation-description' ).remove(); + + if ( variation.variation_description ) { + $form.find( '.single_variation_wrap' ).prepend( '
' + variation.variation_description + '
' ); + } + + $single_variation_wrap.slideDown( 200 ).triggerHandler( 'show_variation', [ variation ] ); + }) + + // Check variations + .on( 'check_variations', function( event, exclude, focus ) { + if ( $use_ajax ) { + return; + } + + var all_attributes_chosen = true, + some_attributes_chosen = false, + showing_variation = false, + current_settings = {}, + $form = $( this ), + $reset_variations = $form.find( '.reset_variations' ); + + $form.find( '.variations select' ).each( function() { + var attribute_name = $( this ).data( 'attribute_name' ) || $( this ).attr( 'name' ); + + if ( $( this ).val().length === 0 ) { + all_attributes_chosen = false; + } else { + some_attributes_chosen = true; } - } ) + if ( exclude && attribute_name === exclude ) { + all_attributes_chosen = false; + current_settings[ attribute_name ] = ''; + } else { + // Add to settings array + current_settings[ attribute_name ] = $( this ).val(); + } + }); - // Reset product image - .on( 'reset_image', function( event ) { + var matching_variations = wc_variation_form_matcher.find_matching_variations( $product_variations, current_settings ); - var $product = $(this).closest( '.product' ), - $product_img = $product.find( 'div.images img:eq(0)' ), - $product_link = $product.find( 'div.images a.zoom:eq(0)' ), - o_src = $product_img.attr( 'data-o_src' ), - o_title = $product_img.attr( 'data-o_title' ), - o_alt = $product_img.attr( 'data-o_title' ), - o_href = $product_link.attr( 'data-o_href' ); + if ( all_attributes_chosen ) { - if ( o_src !== undefined ) { - $product_img - .attr( 'src', o_src ); + var variation = matching_variations.shift(); + + if ( variation ) { + $form.find( 'input[name="variation_id"], input.variation_id' ) + .val( variation.variation_id ) + .change(); + $form.triggerHandler( 'found_variation', [ variation ] ); + } else { + // Nothing found - reset fields + $form.find( '.variations select' ).val( '' ); + + if ( ! focus ) { + $form.triggerHandler( 'reset_data' ); + } + + alert( wc_add_to_cart_variation_params.i18n_no_matching_variations_text ); } - if ( o_href !== undefined ) { - $product_link - .attr( 'href', o_href ); + } else { + + $form.triggerHandler( 'update_variation_values', [ matching_variations ] ); + + if ( ! focus ) { + $form.triggerHandler( 'reset_data' ); } - if ( o_title !== undefined ) { - $product_img - .attr( 'title', o_title ); - $product_link - .attr( 'title', o_title ); + if ( ! exclude ) { + $form.find( '.single_variation_wrap' ).slideUp( 200 ).triggerHandler( 'hide_variation' ); + } + } + if ( some_attributes_chosen ) { + if ( $reset_variations.css( 'visibility' ) === 'hidden' ) { + $reset_variations.css( 'visibility', 'visible' ).hide().fadeIn(); + } + } else { + $reset_variations.css( 'visibility', 'hidden' ); + } + } ) + + // Disable option fields that are unavaiable for current set of attributes + .on( 'update_variation_values', function( event, variations ) { + if ( $use_ajax ) { + return; + } + // Loop through selects and disable/enable options based on selections + $form.find( '.variations select' ).each( function( index, el ) { + + current_attr_select = $( el ); + + // Reset options + if ( ! current_attr_select.data( 'attribute_options' ) ) { + current_attr_select.data( 'attribute_options', current_attr_select.find( 'option:gt(0)' ).get() ); } - if ( o_alt !== undefined ) { - $product_img - .attr( 'alt', o_alt ); + current_attr_select.find( 'option:gt(0)' ).remove(); + current_attr_select.append( current_attr_select.data( 'attribute_options' ) ); + current_attr_select.find( 'option:gt(0)' ).removeClass( 'attached' ); + current_attr_select.find( 'option:gt(0)' ).removeClass( 'enabled' ); + current_attr_select.find( 'option:gt(0)' ).removeAttr( 'disabled' ); + + // Get name from data-attribute_name, or from input name if it doesn't exist + if ( typeof( current_attr_select.data( 'attribute_name' ) ) != 'undefined' ) { + current_attr_name = current_attr_select.data( 'attribute_name' ); + } else { + current_attr_name = current_attr_select.attr( 'name' ); } - } ) - // Disable option fields that are unavaiable for current set of attributes - .on( 'update_variation_values', function( event, variations ) { + // Loop through variations + for ( var num in variations ) { - $variation_form = $( this ).closest( '.variations_form' ); + if ( typeof( variations[ num ] ) != 'undefined' ) { - // Loop through selects and disable/enable options based on selections - $variation_form.find( '.variations select' ).each( function( index, el ) { + var attributes = variations[ num ].attributes; - current_attr_select = $( el ); + for ( var attr_name in attributes ) { + if ( attributes.hasOwnProperty( attr_name ) ) { + var attr_val = attributes[ attr_name ]; - // Reset options - if ( ! current_attr_select.data( 'attribute_options' ) ) - current_attr_select.data( 'attribute_options', current_attr_select.find( 'option:gt(0)' ).get() ); + if ( attr_name == current_attr_name ) { - current_attr_select.find( 'option:gt(0)' ).remove(); - current_attr_select.append( current_attr_select.data( 'attribute_options' ) ); - current_attr_select.find( 'option:gt(0)' ).removeClass( 'attached' ); + if ( variations[ num ].variation_is_active ) + variation_active = 'enabled'; + else + variation_active = ''; - current_attr_select.find( 'option:gt(0)' ).removeClass( 'enabled' ); - current_attr_select.find( 'option:gt(0)' ).removeAttr( 'disabled' ); + if ( attr_val ) { - // Get name from data-attribute_name, or from input name if it doesn't exist - if ( typeof( current_attr_select.data( 'attribute_name' ) ) != 'undefined' ) - current_attr_name = current_attr_select.data( 'attribute_name' ); - else - current_attr_name = current_attr_select.attr( 'name' ); + // Decode entities + attr_val = $( '
' ).html( attr_val ).text(); - // Loop through variations - for ( var num in variations ) { + // Add slashes + attr_val = attr_val.replace( /'/g, "\\'" ); + attr_val = attr_val.replace( /"/g, "\\\"" ); - if ( typeof( variations[ num ] ) != 'undefined' ) { + // Compare the meerkat + current_attr_select.find( 'option[value="' + attr_val + '"]' ).addClass( 'attached ' + variation_active ); - var attributes = variations[ num ].attributes; + } else { - for ( var attr_name in attributes ) { - if ( attributes.hasOwnProperty( attr_name ) ) { - var attr_val = attributes[ attr_name ]; + current_attr_select.find( 'option:gt(0)' ).addClass( 'attached ' + variation_active ); - if ( attr_name == current_attr_name ) { - - if ( variations[ num ].variation_is_active ) - variation_active = 'enabled'; - else - variation_active = ''; - - if ( attr_val ) { - - // Decode entities - attr_val = $( '
' ).html( attr_val ).text(); - - // Add slashes - attr_val = attr_val.replace( /'/g, "\\'" ); - attr_val = attr_val.replace( /"/g, "\\\"" ); - - // Compare the meerkat - current_attr_select.find( 'option[value="' + attr_val + '"]' ).addClass( 'attached ' + variation_active ); - - } else { - - current_attr_select.find( 'option:gt(0)' ).addClass( 'attached ' + variation_active ); - - } } } } } } - - // Detach unattached - current_attr_select.find( 'option:gt(0):not(.attached)' ).remove(); - - // Grey out disabled - current_attr_select.find( 'option:gt(0):not(.enabled)' ).attr( 'disabled', 'disabled' ); - - }); - - // Custom event for when variations have been updated - $variation_form.trigger( 'woocommerce_update_variation_values' ); - - } ) - - // Show single variation details (price, stock, image) - .on( 'found_variation', function( event, variation ) { - var $variation_form = $( this ), - $product = $( this ).closest( '.product' ), - $product_img = $product.find( 'div.images img:eq(0)' ), - $product_link = $product.find( 'div.images a.zoom:eq(0)' ), - o_src = $product_img.attr( 'data-o_src' ), - o_title = $product_img.attr( 'data-o_title' ), - o_alt = $product_img.attr( 'data-o_alt' ), - o_href = $product_link.attr( 'data-o_href' ), - variation_image = variation.image_src, - variation_link = variation.image_link, - variation_caption = variation.image_caption, - variation_title = variation.image_title, - variation_alt = variation.image_alt; - - $variation_form.find( '.variations_button' ).show(); - $variation_form.find( '.single_variation' ).html( variation.price_html + variation.availability_html ); - - if ( o_src === undefined ) { - o_src = ( ! $product_img.attr( 'src' ) ) ? '' : $product_img.attr( 'src' ); - $product_img.attr( 'data-o_src', o_src ); } - if ( o_href === undefined ) { - o_href = ( ! $product_link.attr( 'href' ) ) ? '' : $product_link.attr( 'href' ); - $product_link.attr( 'data-o_href', o_href ); - } + // Detach unattached + current_attr_select.find( 'option:gt(0):not(.attached)' ).remove(); - if ( o_title === undefined ) { - o_title = ( ! $product_img.attr( 'title' ) ) ? '' : $product_img.attr( 'title' ); - $product_img.attr( 'data-o_title', o_title ); - } - - if ( o_alt === undefined ) { - o_alt = ( ! $product_img.attr( 'alt' ) ) ? '' : $product_img.attr( 'alt' ); - $product_img.attr( 'data-o_alt', o_alt ); - } - - if ( variation_image && variation_image.length > 1 ) { - $product_img - .attr( 'src', variation_image ) - .attr( 'alt', variation_title ) - .attr( 'title', variation_title ); - $product_link - .attr( 'href', variation_link ) - .attr( 'title', variation_caption ); - } else { - $product_img - .attr( 'src', o_src ) - .attr( 'alt', o_alt ) - .attr( 'title', o_title ); - $product_link - .attr( 'href', o_href ) - .attr( 'title', o_title ); - } - - var $single_variation_wrap = $variation_form.find( '.single_variation_wrap' ), - $sku = $product.find( '.product_meta' ).find( '.sku' ), - $weight = $product.find( '.product_weight' ), - $dimensions = $product.find( '.product_dimensions' ); - - if ( ! $sku.attr( 'data-o_sku' ) ) - $sku.attr( 'data-o_sku', $sku.text() ); - - if ( ! $weight.attr( 'data-o_weight' ) ) - $weight.attr( 'data-o_weight', $weight.text() ); - - if ( ! $dimensions.attr( 'data-o_dimensions' ) ) - $dimensions.attr( 'data-o_dimensions', $dimensions.text() ); - - if ( variation.sku ) { - $sku.text( variation.sku ); - } else { - $sku.text( $sku.attr( 'data-o_sku' ) ); - } - - if ( variation.weight ) { - $weight.text( variation.weight ); - } else { - $weight.text( $weight.attr( 'data-o_weight' ) ); - } - - if ( variation.dimensions ) { - $dimensions.text( variation.dimensions ); - } else { - $dimensions.text( $dimensions.attr( 'data-o_dimensions' ) ); - } - - $single_variation_wrap.find( '.quantity' ).show(); - - if ( ! variation.is_purchasable || ! variation.is_in_stock || ! variation.variation_is_visible ) { - $variation_form.find( '.variations_button' ).hide(); - } - - if ( ! variation.variation_is_visible ) { - $variation_form.find( '.single_variation' ).html( '

' + wc_add_to_cart_variation_params.i18n_unavailable_text + '

' ); - } - - if ( variation.min_qty !== '' ) - $single_variation_wrap.find( '.quantity input.qty' ).attr( 'min', variation.min_qty ).val( variation.min_qty ); - else - $single_variation_wrap.find( '.quantity input.qty' ).removeAttr( 'min' ); - - if ( variation.max_qty !== '' ) - $single_variation_wrap.find( '.quantity input.qty' ).attr( 'max', variation.max_qty ); - else - $single_variation_wrap.find( '.quantity input.qty' ).removeAttr( 'max' ); - - if ( variation.is_sold_individually === 'yes' ) { - $single_variation_wrap.find( '.quantity input.qty' ).val( '1' ); - $single_variation_wrap.find( '.quantity' ).hide(); - } - - $single_variation_wrap.slideDown( 200 ).trigger( 'show_variation', [ variation ] ); + // Grey out disabled + current_attr_select.find( 'option:gt(0):not(.enabled)' ).attr( 'disabled', 'disabled' ); }); - $form.trigger( 'wc_variation_form' ); + // Custom event for when variations have been updated + $form.triggerHandler( 'woocommerce_update_variation_values' ); + }); + + $form.triggerHandler( 'wc_variation_form' ); return $form; }; + /** + * Matches inline variation objects to chosen attributes + * @type {Object} + */ + var wc_variation_form_matcher = { + find_matching_variations: function( product_variations, settings ) { + var matching = []; + for ( var i = 0; i < product_variations.length; i++ ) { + var variation = product_variations[i]; + var variation_id = variation.variation_id; + + if ( wc_variation_form_matcher.variations_match( variation.attributes, settings ) ) { + matching.push( variation ); + } + } + return matching; + }, + variations_match: function( attrs1, attrs2 ) { + var match = true; + for ( var attr_name in attrs1 ) { + if ( attrs1.hasOwnProperty( attr_name ) ) { + var val1 = attrs1[ attr_name ]; + var val2 = attrs2[ attr_name ]; + if ( val1 !== undefined && val2 !== undefined && val1.length !== 0 && val2.length !== 0 && val1 !== val2 ) { + match = false; + } + } + } + return match; + } + }; + $( function() { - - // wc_add_to_cart_variation_params is required to continue, ensure the object exists - if ( typeof wc_add_to_cart_variation_params === 'undefined' ) - return false; - - $( '.variations_form' ).wc_variation_form(); - $( '.variations_form .variations select' ).change(); + if ( typeof wc_add_to_cart_variation_params !== 'undefined' ) { + $( '.variations_form' ).wc_variation_form().find('.variations select:eq(0)').change(); + } }); -})( jQuery, window, document ); +})( jQuery, window, document ); \ No newline at end of file diff --git a/assets/js/frontend/add-to-cart-variation.min.js b/assets/js/frontend/add-to-cart-variation.min.js index d0f8c83173a..946fbf2e3b2 100644 --- a/assets/js/frontend/add-to-cart-variation.min.js +++ b/assets/js/frontend/add-to-cart-variation.min.js @@ -1,4 +1,4 @@ /*! * Variations Plugin */ -!function(a,b,c,d){a.fn.wc_variation_form=function(){return a.fn.wc_variation_form.find_matching_variations=function(b,c){for(var d=[],e=0;e0&&(b--,d[b].hasOwnProperty("variation_description"))?c='
'+d[b].variation_description+"
":""},this.unbind("check_variations update_variation_values found_variation"),this.find(".reset_variations").unbind("click"),this.find(".variations select").unbind("change focusin"),$form=this.on("click",".reset_variations",function(){a(this).closest(".variations_form").find(".variations select").val("").change();var b=a(this).closest(".product").find(".sku"),c=a(this).closest(".product").find(".product_weight"),d=a(this).closest(".product").find(".product_dimensions");return b.attr("data-o_sku")&&b.text(b.attr("data-o_sku")),c.attr("data-o_weight")&&c.text(c.attr("data-o_weight")),d.attr("data-o_dimensions")&&d.text(d.attr("data-o_dimensions")),!1}).on("change",".variations select",function(){var b=a(this).closest(".variations_form"),c=a.fn.wc_variation_form.get_variation_description_html(b,this.selectedIndex);b.find(".variations").next(".woocommerce-variation-description").remove(),c&&b.find(".variations").after(c),b.find("input.variation_id").length>0?b.find("input.variation_id").val("").change():b.find("input[name=variation_id]").val("").change(),b.trigger("woocommerce_variation_select_change").trigger("check_variations",["",!1]),a(this).blur(),a().uniform&&a.isFunction(a.uniform.update)&&a.uniform.update(),b.trigger("woocommerce_variation_has_changed")}).on("focusin touchstart",".variations select",function(){$variation_form=a(this).closest(".variations_form"),attribute_name="undefined"!=typeof a(this).data("attribute_name")?a(this).data("attribute_name"):a(this).attr("name"),$variation_form.trigger("woocommerce_variation_select_focusin").trigger("check_variations",[attribute_name,!0])}).on("check_variations",function(c,d,e){var f=!0,g=!1,h={},i=a(this),j=i.find(".reset_variations");i.find(".variations select").each(function(){attribute_name="undefined"!=typeof a(this).data("attribute_name")?a(this).data("attribute_name"):a(this).attr("name"),0===a(this).val().length?f=!1:g=!0,d&&attribute_name===d?(f=!1,h[attribute_name]=""):(value=a(this).val(),h[attribute_name]=value)});var k=parseInt(i.data("product_id")),l=i.data("product_variations");l||(l=b.product_variations.product_id),l||(l=b.product_variations),l||(l=b["product_variations_"+k]);var m=a.fn.wc_variation_form.find_matching_variations(l,h);if(f){var n=m.shift();n?($variation_input=i.find(i.find("input.variation_id").length>0?"input.variation_id":"input[name=variation_id]"),$variation_input.val(n.variation_id).change(),i.trigger("found_variation",[n])):(i.find(".variations select").val(""),e||i.trigger("reset_image"),alert(wc_add_to_cart_variation_params.i18n_no_matching_variations_text))}else i.trigger("update_variation_values",[m]),e||i.trigger("reset_image"),d||i.find(".single_variation_wrap").slideUp(200).trigger("hide_variation");g?"hidden"===j.css("visibility")&&j.css("visibility","visible").hide().fadeIn():(j.css("visibility","hidden"),$sku=a(this).closest(".product").find(".sku"),$sku.text($sku.attr("data-o_sku")))}).on("reset_image",function(){var b=a(this).closest(".product"),c=b.find("div.images img:eq(0)"),e=b.find("div.images a.zoom:eq(0)"),f=c.attr("data-o_src"),g=c.attr("data-o_title"),h=c.attr("data-o_title"),i=e.attr("data-o_href");f!==d&&c.attr("src",f),i!==d&&e.attr("href",i),g!==d&&(c.attr("title",g),e.attr("title",g)),h!==d&&c.attr("alt",h)}).on("update_variation_values",function(b,c){$variation_form=a(this).closest(".variations_form"),$variation_form.find(".variations select").each(function(b,d){current_attr_select=a(d),current_attr_select.data("attribute_options")||current_attr_select.data("attribute_options",current_attr_select.find("option:gt(0)").get()),current_attr_select.find("option:gt(0)").remove(),current_attr_select.append(current_attr_select.data("attribute_options")),current_attr_select.find("option:gt(0)").removeClass("attached"),current_attr_select.find("option:gt(0)").removeClass("enabled"),current_attr_select.find("option:gt(0)").removeAttr("disabled"),current_attr_name="undefined"!=typeof current_attr_select.data("attribute_name")?current_attr_select.data("attribute_name"):current_attr_select.attr("name");for(var e in c)if("undefined"!=typeof c[e]){var f=c[e].attributes;for(var g in f)if(f.hasOwnProperty(g)){var h=f[g];g==current_attr_name&&(variation_active=c[e].variation_is_active?"enabled":"",h?(h=a("
").html(h).text(),h=h.replace(/'/g,"\\'"),h=h.replace(/"/g,'\\"'),current_attr_select.find('option[value="'+h+'"]').addClass("attached "+variation_active)):current_attr_select.find("option:gt(0)").addClass("attached "+variation_active))}}current_attr_select.find("option:gt(0):not(.attached)").remove(),current_attr_select.find("option:gt(0):not(.enabled)").attr("disabled","disabled")}),$variation_form.trigger("woocommerce_update_variation_values")}).on("found_variation",function(b,c){{var e=a(this),f=a(this).closest(".product"),g=f.find("div.images img:eq(0)"),h=f.find("div.images a.zoom:eq(0)"),i=g.attr("data-o_src"),j=g.attr("data-o_title"),k=g.attr("data-o_alt"),l=h.attr("data-o_href"),m=c.image_src,n=c.image_link,o=c.image_caption,p=c.image_title;c.image_alt}e.find(".variations_button").show(),e.find(".single_variation").html(c.price_html+c.availability_html),i===d&&(i=g.attr("src")?g.attr("src"):"",g.attr("data-o_src",i)),l===d&&(l=h.attr("href")?h.attr("href"):"",h.attr("data-o_href",l)),j===d&&(j=g.attr("title")?g.attr("title"):"",g.attr("data-o_title",j)),k===d&&(k=g.attr("alt")?g.attr("alt"):"",g.attr("data-o_alt",k)),m&&m.length>1?(g.attr("src",m).attr("alt",p).attr("title",p),h.attr("href",n).attr("title",o)):(g.attr("src",i).attr("alt",k).attr("title",j),h.attr("href",l).attr("title",j));var q=e.find(".single_variation_wrap"),r=f.find(".product_meta").find(".sku"),s=f.find(".product_weight"),t=f.find(".product_dimensions");r.attr("data-o_sku")||r.attr("data-o_sku",r.text()),s.attr("data-o_weight")||s.attr("data-o_weight",s.text()),t.attr("data-o_dimensions")||t.attr("data-o_dimensions",t.text()),r.text(c.sku?c.sku:r.attr("data-o_sku")),s.text(c.weight?c.weight:s.attr("data-o_weight")),t.text(c.dimensions?c.dimensions:t.attr("data-o_dimensions")),q.find(".quantity").show(),c.is_purchasable&&c.is_in_stock&&c.variation_is_visible||e.find(".variations_button").hide(),c.variation_is_visible||e.find(".single_variation").html("

"+wc_add_to_cart_variation_params.i18n_unavailable_text+"

"),""!==c.min_qty?q.find(".quantity input.qty").attr("min",c.min_qty).val(c.min_qty):q.find(".quantity input.qty").removeAttr("min"),""!==c.max_qty?q.find(".quantity input.qty").attr("max",c.max_qty):q.find(".quantity input.qty").removeAttr("max"),"yes"===c.is_sold_individually&&(q.find(".quantity input.qty").val("1"),q.find(".quantity").hide()),q.slideDown(200).trigger("show_variation",[c])}),$form.trigger("wc_variation_form"),$form},a(function(){return"undefined"==typeof wc_add_to_cart_variation_params?!1:(a(".variations_form").wc_variation_form(),void a(".variations_form .variations select").change())})}(jQuery,window,document); \ No newline at end of file +!function(a,b,c,d){a.fn.wc_variation_form=function(){var b=this,c=b.closest(".product"),f=parseInt(b.data("product_id")),g=b.data("product_variations"),h=g===!1,i=!1,j=b.find(".reset_variations");return b.unbind("check_variations update_variation_values found_variation"),b.find(".reset_variations").unbind("click"),b.find(".variations select").unbind("change focusin"),b.on("click",".reset_variations",function(){return b.find(".variations select").val("").change(),b.triggerHandler("reset_data"),!1}).on("reset_data",function(){var d={".sku":"o_sku",".product_weight":"o_weight",".product_dimensions":"o_dimensions"};a.each(d,function(a,b){var d=c.find(a);d.attr("data-"+b)&&d.text(d.attr("data-"+b))}),b.find(".woocommerce-variation-description").remove(),b.triggerHandler("reset_image"),b.find(".single_variation_wrap").slideUp(200).triggerHandler("hide_variation")}).on("reset_image",function(){var a=c.find("div.images img:eq(0)"),b=c.find("div.images a.zoom:eq(0)"),e=a.attr("data-o_src"),f=a.attr("data-o_title"),g=a.attr("data-o_title"),h=b.attr("data-o_href");e!==d&&a.attr("src",e),h!==d&&b.attr("href",h),f!==d&&(a.attr("title",f),b.attr("title",f)),g!==d&&a.attr("alt",g)}).on("change",".variations select",function(){if(b.find('input[name="variation_id"], input.variation_id').val("").change(),b.find(".wc-no-matching-variations").remove(),h){i&&i.abort();var c=!0,d=!1,e={};b.find(".variations select").each(function(){var b=a(this).data("attribute_name")||a(this).attr("name");0===a(this).val().length?c=!1:d=!0,e[b]=a(this).val()}),c?(e.product_id=f,i=a.ajax({url:wc_cart_fragments_params.wc_ajax_url+"get_variation/",type:"POST",data:e,success:function(a){a?(b.find('input[name="variation_id"], input.variation_id').val(a.variation_id).change(),b.triggerHandler("found_variation",[a])):(b.triggerHandler("reset_data"),b.find(".single_variation_wrap").after('

'+wc_add_to_cart_variation_params.i18n_no_matching_variations_text+"

"),b.find(".wc-no-matching-variations").slideDown(200))}})):b.triggerHandler("reset_data"),d?"hidden"===j.css("visibility")&&j.css("visibility","visible").hide().fadeIn():j.css("visibility","hidden")}else b.triggerHandler("woocommerce_variation_select_change"),b.triggerHandler("check_variations",["",!1]),a(this).blur();b.triggerHandler("woocommerce_variation_has_changed")}).on("focusin touchstart",".variations select",function(){h||(b.triggerHandler("woocommerce_variation_select_focusin"),b.triggerHandler("check_variations",[a(this).data("attribute_name")||a(this).attr("name"),!0]))}).on("found_variation",function(a,e){{var f=c.find("div.images img:eq(0)"),g=c.find("div.images a.zoom:eq(0)"),h=f.attr("data-o_src"),i=f.attr("data-o_title"),j=f.attr("data-o_alt"),k=g.attr("data-o_href"),l=e.image_src,m=e.image_link,n=e.image_caption,o=e.image_title;e.image_alt}b.find(".variations_button").show(),b.find(".single_variation").html(e.price_html+e.availability_html),h===d&&(h=f.attr("src")?f.attr("src"):"",f.attr("data-o_src",h)),k===d&&(k=g.attr("href")?g.attr("href"):"",g.attr("data-o_href",k)),i===d&&(i=f.attr("title")?f.attr("title"):"",f.attr("data-o_title",i)),j===d&&(j=f.attr("alt")?f.attr("alt"):"",f.attr("data-o_alt",j)),l&&l.length>1?(f.attr("src",l).attr("alt",o).attr("title",o),g.attr("href",m).attr("title",n)):(f.attr("src",h).attr("alt",j).attr("title",i),g.attr("href",k).attr("title",i));var p=b.find(".single_variation_wrap"),q=c.find(".product_meta").find(".sku"),r=c.find(".product_weight"),s=c.find(".product_dimensions");q.attr("data-o_sku")||q.attr("data-o_sku",q.text()),r.attr("data-o_weight")||r.attr("data-o_weight",r.text()),s.attr("data-o_dimensions")||s.attr("data-o_dimensions",s.text()),q.text(e.sku?e.sku:q.attr("data-o_sku")),r.text(e.weight?e.weight:r.attr("data-o_weight")),s.text(e.dimensions?e.dimensions:s.attr("data-o_dimensions")),p.find(".quantity").show(),e.is_purchasable&&e.is_in_stock&&e.variation_is_visible||b.find(".variations_button").hide(),e.variation_is_visible||b.find(".single_variation").html("

"+wc_add_to_cart_variation_params.i18n_unavailable_text+"

"),""!==e.min_qty?p.find(".quantity input.qty").attr("min",e.min_qty).val(e.min_qty):p.find(".quantity input.qty").removeAttr("min"),""!==e.max_qty?p.find(".quantity input.qty").attr("max",e.max_qty):p.find(".quantity input.qty").removeAttr("max"),"yes"===e.is_sold_individually&&(p.find(".quantity input.qty").val("1"),p.find(".quantity").hide()),b.find(".woocommerce-variation-description").remove(),e.variation_description&&b.find(".single_variation_wrap").prepend('
'+e.variation_description+"
"),p.slideDown(200).triggerHandler("show_variation",[e])}).on("check_variations",function(b,c,d){if(!h){var f=!0,i=!1,j={},k=a(this),l=k.find(".reset_variations");k.find(".variations select").each(function(){var b=a(this).data("attribute_name")||a(this).attr("name");0===a(this).val().length?f=!1:i=!0,c&&b===c?(f=!1,j[b]=""):j[b]=a(this).val()});var m=e.find_matching_variations(g,j);if(f){var n=m.shift();n?(k.find('input[name="variation_id"], input.variation_id').val(n.variation_id).change(),k.triggerHandler("found_variation",[n])):(k.find(".variations select").val(""),d||k.triggerHandler("reset_data"),alert(wc_add_to_cart_variation_params.i18n_no_matching_variations_text))}else k.triggerHandler("update_variation_values",[m]),d||k.triggerHandler("reset_data"),c||k.find(".single_variation_wrap").slideUp(200).triggerHandler("hide_variation");i?"hidden"===l.css("visibility")&&l.css("visibility","visible").hide().fadeIn():l.css("visibility","hidden")}}).on("update_variation_values",function(c,d){h||(b.find(".variations select").each(function(b,c){current_attr_select=a(c),current_attr_select.data("attribute_options")||current_attr_select.data("attribute_options",current_attr_select.find("option:gt(0)").get()),current_attr_select.find("option:gt(0)").remove(),current_attr_select.append(current_attr_select.data("attribute_options")),current_attr_select.find("option:gt(0)").removeClass("attached"),current_attr_select.find("option:gt(0)").removeClass("enabled"),current_attr_select.find("option:gt(0)").removeAttr("disabled"),current_attr_name="undefined"!=typeof current_attr_select.data("attribute_name")?current_attr_select.data("attribute_name"):current_attr_select.attr("name");for(var e in d)if("undefined"!=typeof d[e]){var f=d[e].attributes;for(var g in f)if(f.hasOwnProperty(g)){var h=f[g];g==current_attr_name&&(variation_active=d[e].variation_is_active?"enabled":"",h?(h=a("
").html(h).text(),h=h.replace(/'/g,"\\'"),h=h.replace(/"/g,'\\"'),current_attr_select.find('option[value="'+h+'"]').addClass("attached "+variation_active)):current_attr_select.find("option:gt(0)").addClass("attached "+variation_active))}}current_attr_select.find("option:gt(0):not(.attached)").remove(),current_attr_select.find("option:gt(0):not(.enabled)").attr("disabled","disabled")}),b.triggerHandler("woocommerce_update_variation_values"))}),b.triggerHandler("wc_variation_form"),b};var e={find_matching_variations:function(a,b){for(var c=[],d=0;d'+wc_add_to_cart_params.i18n_view_cart+""),fragments&&a.each(fragments,function(b,c){a(b).replaceWith(c)}),a(".widget_shopping_cart, .updating").stop(!0).css("opacity","1").unblock(),a(".shop_table.cart").load(d+" .shop_table.cart:eq(0) > *",function(){a(".shop_table.cart").stop(!0).css("opacity","1").unblock(),a(document.body).trigger("cart_page_refreshed")}),a(".cart_totals").load(d+" .cart_totals:eq(0) > *",function(){a(".cart_totals").stop(!0).css("opacity","1").unblock()}),a(document.body).trigger("added_to_cart",[fragments,cart_hash,b]),void 0)}}),!1}return!0})}); \ No newline at end of file +jQuery(function(a){return"undefined"==typeof wc_add_to_cart_params?!1:void a(document).on("click",".add_to_cart_button",function(){var b=a(this);if(b.is(".product_type_simple")){if(!b.attr("data-product_id"))return!0;b.removeClass("added"),b.addClass("loading");var c={};return a.each(b.data(),function(a,b){c[a]=b}),a(document.body).trigger("adding_to_cart",[b,c]),a.post(wc_add_to_cart_params.wc_ajax_url+"add_to_cart/",c,function(c){if(c){var d=window.location.toString();return d=d.replace("add-to-cart","added-to-cart"),c.error&&c.product_url?void(window.location=c.product_url):"yes"===wc_add_to_cart_params.cart_redirect_after_add?void(window.location=wc_add_to_cart_params.cart_url):(b.removeClass("loading"),fragments=c.fragments,cart_hash=c.cart_hash,fragments&&a.each(fragments,function(b){a(b).addClass("updating")}),a(".shop_table.cart, .updating, .cart_totals").fadeTo("400","0.6").block({message:null,overlayCSS:{opacity:.6}}),b.addClass("added"),wc_add_to_cart_params.is_cart||0!==b.parent().find(".added_to_cart").size()||b.after(' '+wc_add_to_cart_params.i18n_view_cart+""),fragments&&a.each(fragments,function(b,c){a(b).replaceWith(c)}),a(".widget_shopping_cart, .updating").stop(!0).css("opacity","1").unblock(),a(".shop_table.cart").load(d+" .shop_table.cart:eq(0) > *",function(){a(".shop_table.cart").stop(!0).css("opacity","1").unblock(),a(document.body).trigger("cart_page_refreshed")}),a(".cart_totals").load(d+" .cart_totals:eq(0) > *",function(){a(".cart_totals").stop(!0).css("opacity","1").unblock()}),a(document.body).trigger("added_to_cart",[fragments,cart_hash,b]),void 0)}}),!1}return!0})}); \ No newline at end of file diff --git a/assets/js/frontend/cart-fragments.js b/assets/js/frontend/cart-fragments.js index 66afe1df821..ca41f9cf888 100644 --- a/assets/js/frontend/cart-fragments.js +++ b/assets/js/frontend/cart-fragments.js @@ -18,7 +18,7 @@ jQuery( function( $ ) { } var $fragment_refresh = { - url: wc_cart_fragments_params.wc_ajax_url + 'get_refreshed_fragments', + url: wc_cart_fragments_params.wc_ajax_url + 'get_refreshed_fragments/', type: 'POST', success: function( data ) { if ( data && data.fragments ) { diff --git a/assets/js/frontend/cart-fragments.min.js b/assets/js/frontend/cart-fragments.min.js index ba41e094b17..0316319ad29 100644 --- a/assets/js/frontend/cart-fragments.min.js +++ b/assets/js/frontend/cart-fragments.min.js @@ -1 +1 @@ -jQuery(function(a){if("undefined"==typeof wc_cart_fragments_params)return!1;var b;try{b="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("wc","test"),window.sessionStorage.removeItem("wc")}catch(c){b=!1}var d={url:wc_cart_fragments_params.wc_ajax_url+"get_refreshed_fragments",type:"POST",success:function(c){c&&c.fragments&&(a.each(c.fragments,function(b,c){a(b).replaceWith(c)}),b&&(sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(c.fragments)),sessionStorage.setItem("wc_cart_hash",c.cart_hash)),a(document.body).trigger("wc_fragments_refreshed"))}};if(b){a(document.body).bind("added_to_cart",function(a,b,c){sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(b)),sessionStorage.setItem("wc_cart_hash",c)});try{var e=a.parseJSON(sessionStorage.getItem(wc_cart_fragments_params.fragment_name)),f=sessionStorage.getItem("wc_cart_hash"),g=a.cookie("woocommerce_cart_hash");if((null===f||void 0===f||""===f)&&(f=""),(null===g||void 0===g||""===g)&&(g=""),!e||!e["div.widget_shopping_cart_content"]||f!==g)throw"No fragment";a.each(e,function(b,c){a(b).replaceWith(c)}),a(document.body).trigger("wc_fragments_loaded")}catch(c){a.ajax(d)}}else a.ajax(d);a.cookie("woocommerce_items_in_cart")>0?a(".hide_cart_widget_if_empty").closest(".widget_shopping_cart").show():a(".hide_cart_widget_if_empty").closest(".widget_shopping_cart").hide(),a(document.body).bind("adding_to_cart",function(){a(".hide_cart_widget_if_empty").closest(".widget_shopping_cart").show()})}); \ No newline at end of file +jQuery(function(a){if("undefined"==typeof wc_cart_fragments_params)return!1;var b;try{b="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("wc","test"),window.sessionStorage.removeItem("wc")}catch(c){b=!1}var d={url:wc_cart_fragments_params.wc_ajax_url+"get_refreshed_fragments/",type:"POST",success:function(c){c&&c.fragments&&(a.each(c.fragments,function(b,c){a(b).replaceWith(c)}),b&&(sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(c.fragments)),sessionStorage.setItem("wc_cart_hash",c.cart_hash)),a(document.body).trigger("wc_fragments_refreshed"))}};if(b){a(document.body).bind("added_to_cart",function(a,b,c){sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(b)),sessionStorage.setItem("wc_cart_hash",c)});try{var e=a.parseJSON(sessionStorage.getItem(wc_cart_fragments_params.fragment_name)),f=sessionStorage.getItem("wc_cart_hash"),g=a.cookie("woocommerce_cart_hash");if((null===f||void 0===f||""===f)&&(f=""),(null===g||void 0===g||""===g)&&(g=""),!e||!e["div.widget_shopping_cart_content"]||f!==g)throw"No fragment";a.each(e,function(b,c){a(b).replaceWith(c)}),a(document.body).trigger("wc_fragments_loaded")}catch(c){a.ajax(d)}}else a.ajax(d);a.cookie("woocommerce_items_in_cart")>0?a(".hide_cart_widget_if_empty").closest(".widget_shopping_cart").show():a(".hide_cart_widget_if_empty").closest(".widget_shopping_cart").hide(),a(document.body).bind("adding_to_cart",function(){a(".hide_cart_widget_if_empty").closest(".widget_shopping_cart").show()})}); \ No newline at end of file diff --git a/assets/js/frontend/cart.js b/assets/js/frontend/cart.js index 2512c3921c9..668f2fd1cf5 100644 --- a/assets/js/frontend/cart.js +++ b/assets/js/frontend/cart.js @@ -30,7 +30,7 @@ jQuery( function( $ ) { shipping_method: shipping_methods }; - $.post( wc_cart_params.wc_ajax_url + 'update_shipping_method', data, function( response ) { + $.post( wc_cart_params.wc_ajax_url + 'update_shipping_method/', data, function( response ) { $( 'div.cart_totals' ).replaceWith( response ); $( document.body ).trigger( 'updated_shipping_method' ); }); diff --git a/assets/js/frontend/cart.min.js b/assets/js/frontend/cart.min.js index 4208190a280..39279253e36 100644 --- a/assets/js/frontend/cart.min.js +++ b/assets/js/frontend/cart.min.js @@ -1 +1 @@ -jQuery(function(a){return"undefined"==typeof wc_cart_params?!1:(a(document).on("click",".shipping-calculator-button",function(){return a(".shipping-calculator-form").slideToggle("slow"),!1}).on("change","select.shipping_method, input[name^=shipping_method]",function(){var b=[];a("select.shipping_method, input[name^=shipping_method][type=radio]:checked, input[name^=shipping_method][type=hidden]").each(function(){b[a(this).data("index")]=a(this).val()}),a("div.cart_totals").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var c={security:wc_cart_params.update_shipping_method_nonce,shipping_method:b};a.post(wc_cart_params.wc_ajax_url+"update_shipping_method",c,function(b){a("div.cart_totals").replaceWith(b),a(document.body).trigger("updated_shipping_method")})}),void a(".shipping-calculator-form").hide())}); \ No newline at end of file +jQuery(function(a){return"undefined"==typeof wc_cart_params?!1:(a(document).on("click",".shipping-calculator-button",function(){return a(".shipping-calculator-form").slideToggle("slow"),!1}).on("change","select.shipping_method, input[name^=shipping_method]",function(){var b=[];a("select.shipping_method, input[name^=shipping_method][type=radio]:checked, input[name^=shipping_method][type=hidden]").each(function(){b[a(this).data("index")]=a(this).val()}),a("div.cart_totals").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var c={security:wc_cart_params.update_shipping_method_nonce,shipping_method:b};a.post(wc_cart_params.wc_ajax_url+"update_shipping_method/",c,function(b){a("div.cart_totals").replaceWith(b),a(document.body).trigger("updated_shipping_method")})}),void a(".shipping-calculator-form").hide())}); \ No newline at end of file diff --git a/assets/js/frontend/checkout.js b/assets/js/frontend/checkout.js index 64d1a2abda0..0f2f4fb1bc4 100644 --- a/assets/js/frontend/checkout.js +++ b/assets/js/frontend/checkout.js @@ -241,7 +241,7 @@ jQuery( function( $ ) { wc_checkout_form.xhr = $.ajax({ type: 'POST', - url: wc_checkout_params.wc_ajax_url + 'update_order_review', + url: wc_checkout_params.wc_ajax_url + 'update_order_review/', data: data, success: function( data ) { // Always update the fragments @@ -408,7 +408,7 @@ jQuery( function( $ ) { $.ajax({ type: 'POST', - url: wc_checkout_params.wc_ajax_url + 'apply_coupon', + url: wc_checkout_params.wc_ajax_url + 'apply_coupon/', data: data, success: function( code ) { $( '.woocommerce-error, .woocommerce-message' ).remove(); @@ -447,7 +447,7 @@ jQuery( function( $ ) { $.ajax({ type: 'POST', - url: wc_checkout_params.wc_ajax_url + 'remove_coupon', + url: wc_checkout_params.wc_ajax_url + 'remove_coupon/', data: data, success: function( code ) { $( '.woocommerce-error, .woocommerce-message' ).remove(); diff --git a/assets/js/frontend/checkout.min.js b/assets/js/frontend/checkout.min.js index 81b9ff30a0a..c84970a8562 100644 --- a/assets/js/frontend/checkout.min.js +++ b/assets/js/frontend/checkout.min.js @@ -1 +1 @@ -jQuery(function(a){if("undefined"==typeof wc_checkout_params)return!1;a.blockUI.defaults.overlayCSS.cursor="default";var b={updateTimer:!1,dirtyInput:!1,xhr:!1,$order_review:a("#order_review"),$checkout_form:a("form.checkout"),init:function(){a(document.body).bind("update_checkout",this.reset_update_checkout_timer),a(document.body).bind("update_checkout",this.update_checkout),a(document.body).bind("init_checkout",this.init_checkout),this.$order_review.on("click","input[name=payment_method]",this.payment_method_selected),this.$checkout_form.on("submit",this.submit),this.$checkout_form.on("blur input change",".input-text, select",this.validate_field),this.$checkout_form.on("input change","select.shipping_method, input[name^=shipping_method], #ship-to-different-address input, .update_totals_on_change select, .update_totals_on_change input[type=radio]",this.trigger_update_checkout),this.$checkout_form.on("change",".address-field input.input-text, .update_totals_on_change input.input-text",this.maybe_input_changed),this.$checkout_form.on("input change",".address-field select",this.input_changed),this.$checkout_form.on("input keydown",".address-field input.input-text, .update_totals_on_change input.input-text",this.queue_update_checkout),this.$checkout_form.on("change","#ship-to-different-address input",this.ship_to_different_address),this.$order_review.find("input[name=payment_method]:checked").trigger("click"),this.$checkout_form.find("#ship-to-different-address input").change(),"1"===wc_checkout_params.is_checkout&&a(document.body).trigger("init_checkout"),"yes"===wc_checkout_params.option_guest_checkout&&a("input#createaccount").change(this.toggle_create_account).change()},toggle_create_account:function(){a("div.create-account").hide(),a(this).is(":checked")&&a("div.create-account").slideDown()},init_checkout:function(){a("#billing_country, #shipping_country, .country_to_state").change(),a(document.body).trigger("update_checkout")},maybe_input_changed:function(a){b.dirtyInput&&b.input_changed(a)},input_changed:function(a){b.dirtyInput=a.target,b.maybe_update_checkout()},queue_update_checkout:function(a){var c=a.keyCode||a.which||0;return 9===c?!0:(b.dirtyInput=this,b.reset_update_checkout_timer(),void(b.updateTimer=setTimeout(b.maybe_update_checkout,"1000")))},trigger_update_checkout:function(){b.reset_update_checkout_timer(),b.dirtyInput=!1,a(document.body).trigger("update_checkout")},maybe_update_checkout:function(){var c=!0;if(a(b.dirtyInput).size()){var d=a(b.dirtyInput).closest("div").find(".address-field.validate-required");d.size()&&d.each(function(){""===a(this).find("input.input-text").val()&&(c=!1)})}c&&b.trigger_update_checkout()},ship_to_different_address:function(){a("div.shipping_address").hide(),a(this).is(":checked")&&a("div.shipping_address").slideDown()},payment_method_selected:function(){if(a(".payment_methods input.input-radio").length>1){var b=a("div.payment_box."+a(this).attr("ID"));a(this).is(":checked")&&!b.is(":visible")&&(a("div.payment_box").filter(":visible").slideUp(250),a(this).is(":checked")&&a("div.payment_box."+a(this).attr("ID")).slideDown(250))}else a("div.payment_box").show();a("#place_order").val(a(this).data("order_button_text")?a(this).data("order_button_text"):a("#place_order").data("value"))},reset_update_checkout_timer:function(){clearTimeout(b.updateTimer)},validate_field:function(){var b=a(this),c=b.closest(".form-row"),d=!0;if(c.is(".validate-required")&&""===b.val()&&(c.removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-required-field"),d=!1),c.is(".validate-email")&&b.val()){var e=new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);e.test(b.val())||(c.removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-email"),d=!1)}d&&c.removeClass("woocommerce-invalid woocommerce-invalid-required-field").addClass("woocommerce-validated")},update_checkout:function(){b.reset_update_checkout_timer(),b.updateTimer=setTimeout(b.update_checkout_action,"5")},update_checkout_action:function(){if(b.xhr&&b.xhr.abort(),0!==a("form.checkout").size()){var c=[];a("select.shipping_method, input[name^=shipping_method][type=radio]:checked, input[name^=shipping_method][type=hidden]").each(function(){c[a(this).data("index")]=a(this).val()});var d,e,f,g,h,i,j=a("#order_review input[name=payment_method]:checked").val(),k=a("#billing_country").val(),l=a("#billing_state").val(),m=a("input#billing_postcode").val(),n=a("#billing_city").val(),o=a("input#billing_address_1").val(),p=a("input#billing_address_2").val();a("#ship-to-different-address input").is(":checked")?(d=a("#shipping_country").val(),e=a("#shipping_state").val(),f=a("input#shipping_postcode").val(),g=a("#shipping_city").val(),h=a("input#shipping_address_1").val(),i=a("input#shipping_address_2").val()):(d=k,e=l,f=m,g=n,h=o,i=p),a(".woocommerce-checkout-payment, .woocommerce-checkout-review-order-table").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var q={security:wc_checkout_params.update_order_review_nonce,shipping_method:c,payment_method:j,country:k,state:l,postcode:m,city:n,address:o,address_2:p,s_country:d,s_state:e,s_postcode:f,s_city:g,s_address:h,s_address_2:i,post_data:a("form.checkout").serialize()};b.xhr=a.ajax({type:"POST",url:wc_checkout_params.wc_ajax_url+"update_order_review",data:q,success:function(b){if(b&&b.fragments&&a.each(b.fragments,function(b,c){a(b).replaceWith(c),a(b).unblock()}),"failure"==b.result){var c=a("form.checkout");if("true"===b.reload)return void window.location.reload();a(".woocommerce-error, .woocommerce-message").remove(),c.prepend(b.messages?b.messages:b),c.find(".input-text, select").blur(),a("html, body").animate({scrollTop:a("form.checkout").offset().top-100},1e3)}0===a(".woocommerce-checkout").find("input[name=payment_method]:checked").size()&&a(".woocommerce-checkout").find("input[name=payment_method]:eq(0)").attr("checked","checked"),a(".woocommerce-checkout").find("input[name=payment_method]:checked").eq(0).trigger("click"),a(document.body).trigger("updated_checkout")}})}},submit:function(){b.reset_update_checkout_timer();var c=a(this);if(c.is(".processing"))return!1;if(c.triggerHandler("checkout_place_order")!==!1&&c.triggerHandler("checkout_place_order_"+a("#order_review input[name=payment_method]:checked").val())!==!1){c.addClass("processing");var d=c.data();1!=d["blockUI.isBlocked"]&&c.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),a.ajax({type:"POST",url:wc_checkout_params.checkout_url,data:c.serialize(),dataType:"json",success:function(c){try{if("success"!==c.result)throw"failure"===c.result?"Result failure":"Invalid response";window.location=-1!=c.redirect.indexOf("https://")||-1!=c.redirect.indexOf("http://")?c.redirect:decodeURI(c.redirect)}catch(d){if("true"===c.reload)return void window.location.reload();"true"===c.refresh&&a(document.body).trigger("update_checkout"),b.submit_error(c.messages?c.messages:'
'+wc_checkout_params.i18n_checkout_error+"
")}},error:function(a,c,d){b.submit_error('
'+d+"
")}})}return!1},submit_error:function(c){a(".woocommerce-error, .woocommerce-message").remove(),b.$checkout_form.prepend(c),b.$checkout_form.removeClass("processing").unblock(),b.$checkout_form.find(".input-text, select").blur(),a("html, body").animate({scrollTop:a("form.checkout").offset().top-100},1e3),a(document.body).trigger("checkout_error")}},c={init:function(){a(document.body).on("click","a.showcoupon",this.show_coupon_form),a(document.body).on("click",".woocommerce-remove-coupon",this.remove_coupon),a("form.checkout_coupon").hide().submit(this.submit)},show_coupon_form:function(){return a(".checkout_coupon").slideToggle(400,function(){a(".checkout_coupon").find(":input:eq(0)").focus()}),!1},submit:function(){var b=a(this);if(b.is(".processing"))return!1;b.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var c={security:wc_checkout_params.apply_coupon_nonce,coupon_code:b.find("input[name=coupon_code]").val()};return a.ajax({type:"POST",url:wc_checkout_params.wc_ajax_url+"apply_coupon",data:c,success:function(c){a(".woocommerce-error, .woocommerce-message").remove(),b.removeClass("processing").unblock(),c&&(b.before(c),b.slideUp(),a(document.body).trigger("update_checkout"))},dataType:"html"}),!1},remove_coupon:function(b){b.preventDefault();var c=a(this).parents(".woocommerce-checkout-review-order"),d=a(this).data("coupon");c.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var e={security:wc_checkout_params.remove_coupon_nonce,coupon:d};a.ajax({type:"POST",url:wc_checkout_params.wc_ajax_url+"remove_coupon",data:e,success:function(b){a(".woocommerce-error, .woocommerce-message").remove(),c.removeClass("processing").unblock(),b&&(a("form.woocommerce-checkout").before(b),a(document.body).trigger("update_checkout"),a("form.checkout_coupon").find('input[name="coupon_code"]').val(""))},error:function(a){wc_checkout_params.debug_mode&&console.log(a.responseText)},dataType:"html"})}},d={init:function(){a(document.body).on("click","a.showlogin",this.show_login_form)},show_login_form:function(){return a("form.login").slideToggle(),!1}};b.init(),c.init(),d.init()}); \ No newline at end of file +jQuery(function(a){if("undefined"==typeof wc_checkout_params)return!1;a.blockUI.defaults.overlayCSS.cursor="default";var b={updateTimer:!1,dirtyInput:!1,xhr:!1,$order_review:a("#order_review"),$checkout_form:a("form.checkout"),init:function(){a(document.body).bind("update_checkout",this.reset_update_checkout_timer),a(document.body).bind("update_checkout",this.update_checkout),a(document.body).bind("init_checkout",this.init_checkout),this.$order_review.on("click","input[name=payment_method]",this.payment_method_selected),this.$checkout_form.on("submit",this.submit),this.$checkout_form.on("blur input change",".input-text, select",this.validate_field),this.$checkout_form.on("input change","select.shipping_method, input[name^=shipping_method], #ship-to-different-address input, .update_totals_on_change select, .update_totals_on_change input[type=radio]",this.trigger_update_checkout),this.$checkout_form.on("change",".address-field input.input-text, .update_totals_on_change input.input-text",this.maybe_input_changed),this.$checkout_form.on("input change",".address-field select",this.input_changed),this.$checkout_form.on("input keydown",".address-field input.input-text, .update_totals_on_change input.input-text",this.queue_update_checkout),this.$checkout_form.on("change","#ship-to-different-address input",this.ship_to_different_address),this.$order_review.find("input[name=payment_method]:checked").trigger("click"),this.$checkout_form.find("#ship-to-different-address input").change(),"1"===wc_checkout_params.is_checkout&&a(document.body).trigger("init_checkout"),"yes"===wc_checkout_params.option_guest_checkout&&a("input#createaccount").change(this.toggle_create_account).change()},toggle_create_account:function(){a("div.create-account").hide(),a(this).is(":checked")&&a("div.create-account").slideDown()},init_checkout:function(){a("#billing_country, #shipping_country, .country_to_state").change(),a(document.body).trigger("update_checkout")},maybe_input_changed:function(a){b.dirtyInput&&b.input_changed(a)},input_changed:function(a){b.dirtyInput=a.target,b.maybe_update_checkout()},queue_update_checkout:function(a){var c=a.keyCode||a.which||0;return 9===c?!0:(b.dirtyInput=this,b.reset_update_checkout_timer(),void(b.updateTimer=setTimeout(b.maybe_update_checkout,"1000")))},trigger_update_checkout:function(){b.reset_update_checkout_timer(),b.dirtyInput=!1,a(document.body).trigger("update_checkout")},maybe_update_checkout:function(){var c=!0;if(a(b.dirtyInput).size()){var d=a(b.dirtyInput).closest("div").find(".address-field.validate-required");d.size()&&d.each(function(){""===a(this).find("input.input-text").val()&&(c=!1)})}c&&b.trigger_update_checkout()},ship_to_different_address:function(){a("div.shipping_address").hide(),a(this).is(":checked")&&a("div.shipping_address").slideDown()},payment_method_selected:function(){if(a(".payment_methods input.input-radio").length>1){var b=a("div.payment_box."+a(this).attr("ID"));a(this).is(":checked")&&!b.is(":visible")&&(a("div.payment_box").filter(":visible").slideUp(250),a(this).is(":checked")&&a("div.payment_box."+a(this).attr("ID")).slideDown(250))}else a("div.payment_box").show();a("#place_order").val(a(this).data("order_button_text")?a(this).data("order_button_text"):a("#place_order").data("value"))},reset_update_checkout_timer:function(){clearTimeout(b.updateTimer)},validate_field:function(){var b=a(this),c=b.closest(".form-row"),d=!0;if(c.is(".validate-required")&&""===b.val()&&(c.removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-required-field"),d=!1),c.is(".validate-email")&&b.val()){var e=new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);e.test(b.val())||(c.removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-email"),d=!1)}d&&c.removeClass("woocommerce-invalid woocommerce-invalid-required-field").addClass("woocommerce-validated")},update_checkout:function(){b.reset_update_checkout_timer(),b.updateTimer=setTimeout(b.update_checkout_action,"5")},update_checkout_action:function(){if(b.xhr&&b.xhr.abort(),0!==a("form.checkout").size()){var c=[];a("select.shipping_method, input[name^=shipping_method][type=radio]:checked, input[name^=shipping_method][type=hidden]").each(function(){c[a(this).data("index")]=a(this).val()});var d,e,f,g,h,i,j=a("#order_review input[name=payment_method]:checked").val(),k=a("#billing_country").val(),l=a("#billing_state").val(),m=a("input#billing_postcode").val(),n=a("#billing_city").val(),o=a("input#billing_address_1").val(),p=a("input#billing_address_2").val();a("#ship-to-different-address input").is(":checked")?(d=a("#shipping_country").val(),e=a("#shipping_state").val(),f=a("input#shipping_postcode").val(),g=a("#shipping_city").val(),h=a("input#shipping_address_1").val(),i=a("input#shipping_address_2").val()):(d=k,e=l,f=m,g=n,h=o,i=p),a(".woocommerce-checkout-payment, .woocommerce-checkout-review-order-table").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var q={security:wc_checkout_params.update_order_review_nonce,shipping_method:c,payment_method:j,country:k,state:l,postcode:m,city:n,address:o,address_2:p,s_country:d,s_state:e,s_postcode:f,s_city:g,s_address:h,s_address_2:i,post_data:a("form.checkout").serialize()};b.xhr=a.ajax({type:"POST",url:wc_checkout_params.wc_ajax_url+"update_order_review/",data:q,success:function(b){if(b&&b.fragments&&a.each(b.fragments,function(b,c){a(b).replaceWith(c),a(b).unblock()}),"failure"==b.result){var c=a("form.checkout");if("true"===b.reload)return void window.location.reload();a(".woocommerce-error, .woocommerce-message").remove(),c.prepend(b.messages?b.messages:b),c.find(".input-text, select").blur(),a("html, body").animate({scrollTop:a("form.checkout").offset().top-100},1e3)}0===a(".woocommerce-checkout").find("input[name=payment_method]:checked").size()&&a(".woocommerce-checkout").find("input[name=payment_method]:eq(0)").attr("checked","checked"),a(".woocommerce-checkout").find("input[name=payment_method]:checked").eq(0).trigger("click"),a(document.body).trigger("updated_checkout")}})}},submit:function(){b.reset_update_checkout_timer();var c=a(this);if(c.is(".processing"))return!1;if(c.triggerHandler("checkout_place_order")!==!1&&c.triggerHandler("checkout_place_order_"+a("#order_review input[name=payment_method]:checked").val())!==!1){c.addClass("processing");var d=c.data();1!=d["blockUI.isBlocked"]&&c.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),a.ajax({type:"POST",url:wc_checkout_params.checkout_url,data:c.serialize(),dataType:"json",success:function(c){try{if("success"!==c.result)throw"failure"===c.result?"Result failure":"Invalid response";window.location=-1!=c.redirect.indexOf("https://")||-1!=c.redirect.indexOf("http://")?c.redirect:decodeURI(c.redirect)}catch(d){if("true"===c.reload)return void window.location.reload();"true"===c.refresh&&a(document.body).trigger("update_checkout"),b.submit_error(c.messages?c.messages:'
'+wc_checkout_params.i18n_checkout_error+"
")}},error:function(a,c,d){b.submit_error('
'+d+"
")}})}return!1},submit_error:function(c){a(".woocommerce-error, .woocommerce-message").remove(),b.$checkout_form.prepend(c),b.$checkout_form.removeClass("processing").unblock(),b.$checkout_form.find(".input-text, select").blur(),a("html, body").animate({scrollTop:a("form.checkout").offset().top-100},1e3),a(document.body).trigger("checkout_error")}},c={init:function(){a(document.body).on("click","a.showcoupon",this.show_coupon_form),a(document.body).on("click",".woocommerce-remove-coupon",this.remove_coupon),a("form.checkout_coupon").hide().submit(this.submit)},show_coupon_form:function(){return a(".checkout_coupon").slideToggle(400,function(){a(".checkout_coupon").find(":input:eq(0)").focus()}),!1},submit:function(){var b=a(this);if(b.is(".processing"))return!1;b.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var c={security:wc_checkout_params.apply_coupon_nonce,coupon_code:b.find("input[name=coupon_code]").val()};return a.ajax({type:"POST",url:wc_checkout_params.wc_ajax_url+"apply_coupon/",data:c,success:function(c){a(".woocommerce-error, .woocommerce-message").remove(),b.removeClass("processing").unblock(),c&&(b.before(c),b.slideUp(),a(document.body).trigger("update_checkout"))},dataType:"html"}),!1},remove_coupon:function(b){b.preventDefault();var c=a(this).parents(".woocommerce-checkout-review-order"),d=a(this).data("coupon");c.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var e={security:wc_checkout_params.remove_coupon_nonce,coupon:d};a.ajax({type:"POST",url:wc_checkout_params.wc_ajax_url+"remove_coupon/",data:e,success:function(b){a(".woocommerce-error, .woocommerce-message").remove(),c.removeClass("processing").unblock(),b&&(a("form.woocommerce-checkout").before(b),a(document.body).trigger("update_checkout"),a("form.checkout_coupon").find('input[name="coupon_code"]').val(""))},error:function(a){wc_checkout_params.debug_mode&&console.log(a.responseText)},dataType:"html"})}},d={init:function(){a(document.body).on("click","a.showlogin",this.show_login_form)},show_login_form:function(){return a("form.login").slideToggle(),!1}};b.init(),c.init(),d.init()}); \ No newline at end of file diff --git a/assets/js/frontend/geolocation.js b/assets/js/frontend/geolocation.js index f0a262df26a..0f94bce129c 100644 --- a/assets/js/frontend/geolocation.js +++ b/assets/js/frontend/geolocation.js @@ -30,7 +30,7 @@ jQuery( function( $ ) { } var $geolocate_customer = { - url: wc_geolocation_params.wc_ajax_url + 'get_customer_location', + url: wc_geolocation_params.wc_ajax_url + 'get_customer_location/', type: 'GET', success: function( response ) { if ( response.success && response.data.hash && response.data.hash !== wc_geolocation_params.hash ) { diff --git a/assets/js/frontend/geolocation.min.js b/assets/js/frontend/geolocation.min.js index f7937a5c3a9..00d4cb91966 100644 --- a/assets/js/frontend/geolocation.min.js +++ b/assets/js/frontend/geolocation.min.js @@ -1 +1 @@ -jQuery(function(a){var b=window.location.toString(),c=function(){wc_geolocation_params.hash&&a("a[href^='"+wc_geolocation_params.home_url+"']:not(a[href*='v=']), a[href^='/']:not(a[href*='v='])").each(function(){var b=a(this),c=b.attr("href");c.indexOf("?")>0?b.attr("href",c+"&v="+wc_geolocation_params.hash):b.attr("href",c+"?v="+wc_geolocation_params.hash)})},d=function(a){b=b.indexOf("?v=")>0||b.indexOf("&v=")>0?b.replace(/v=[^&]+/,"v="+a):b.indexOf("?")>0?b+"&v="+a:b+"?v="+a,window.location=b},e={url:wc_geolocation_params.wc_ajax_url+"get_customer_location",type:"GET",success:function(a){a.success&&a.data.hash&&a.data.hash!==wc_geolocation_params.hash&&d(a.data.hash)}};"1"!==wc_geolocation_params.is_checkout&&a.ajax(e),a(document.body).on("added_to_cart",function(){c()}),c()}); \ No newline at end of file +jQuery(function(a){var b=window.location.toString(),c=function(){wc_geolocation_params.hash&&a("a[href^='"+wc_geolocation_params.home_url+"']:not(a[href*='v=']), a[href^='/']:not(a[href*='v='])").each(function(){var b=a(this),c=b.attr("href");c.indexOf("?")>0?b.attr("href",c+"&v="+wc_geolocation_params.hash):b.attr("href",c+"?v="+wc_geolocation_params.hash)})},d=function(a){b=b.indexOf("?v=")>0||b.indexOf("&v=")>0?b.replace(/v=[^&]+/,"v="+a):b.indexOf("?")>0?b+"&v="+a:b+"?v="+a,window.location=b},e={url:wc_geolocation_params.wc_ajax_url+"get_customer_location/",type:"GET",success:function(a){a.success&&a.data.hash&&a.data.hash!==wc_geolocation_params.hash&&d(a.data.hash)}};"1"!==wc_geolocation_params.is_checkout&&a.ajax(e),a(document.body).on("added_to_cart",function(){c()}),c()}); \ No newline at end of file diff --git a/includes/class-wc-ajax.php b/includes/class-wc-ajax.php index af283680ea4..e75d61d9e02 100644 --- a/includes/class-wc-ajax.php +++ b/includes/class-wc-ajax.php @@ -84,6 +84,7 @@ class WC_AJAX { 'update_order_review' => true, 'add_to_cart' => true, 'checkout' => true, + 'get_variation' => true, 'feature_product' => false, 'mark_order_status' => false, 'add_attribute' => false, @@ -433,6 +434,29 @@ class WC_AJAX { die(0); } + /** + * Get a matching variation based on posted attributes + */ + public static function get_variation() { + ob_start(); + + if ( empty( $_POST['product_id'] ) || ! ( $variable_product = wc_get_product( absint( $_POST['product_id'] ), array( 'product_type' => 'variable' ) ) ) ) { + die(); + } + + $variation_id = $variable_product->get_matching_variation( $_POST ); + + if ( $variation_id ) { + $variation = $variable_product->get_available_variation( $variation_id ); + } else { + $variation = false; + } + + wp_send_json( $variation ); + + die(); + } + /** * Feature a product from admin */ diff --git a/includes/class-wc-product-variable.php b/includes/class-wc-product-variable.php index 49f530442a3..204c6f0e355 100644 --- a/includes/class-wc-product-variable.php +++ b/includes/class-wc-product-variable.php @@ -413,24 +413,62 @@ class WC_Product_Variable extends WC_Product { * @return array */ public function get_variation_default_attributes() { - $default = isset( $this->default_attributes ) ? $this->default_attributes : ''; - return apply_filters( 'woocommerce_product_default_attributes', (array) maybe_unserialize( $default ), $this ); } + /** + * Match a variation to a given set of attributes using a WP_Query + * @since 2.4.0 + * @param $match_attributes + * @return int Variation ID which matched, 0 is no match was found + */ + public function get_matching_variation( $match_attributes = array() ) { + $query_args = array( + 'post_parent' => $this->id, + 'post_type' => 'product_variation', + 'orderby' => 'menu_order', + 'order' => 'ASC', + 'fields' => 'ids', + 'post_status' => 'publish', + 'numberposts' => 1, + 'meta_query' => array() + ); + + foreach ( $this->get_attributes() as $attribute ) { + if ( ! $attribute['is_variation'] ) { + continue; + } + + $attribute_field_name = 'attribute_' . sanitize_title( $attribute['name'] ); + + if ( empty( $match_attributes[ $attribute_field_name ] ) ) { + return 0; + } + + $query_args['meta_query'][] = array( + 'key' => $attribute_field_name, + 'value' => wc_clean( $match_attributes[ $attribute_field_name ] ) + ); + } + + $matches = get_posts( $query_args ); + + if ( $matches && ! is_wp_error( $matches ) ) { + return current( $matches ); + } else { + return 0; + } + } + /** * Get an array of available variations for the current product. - * - * @access public * @return array */ public function get_available_variations() { - $available_variations = array(); foreach ( $this->get_children() as $child_id ) { - $variation = $this->get_child( $child_id ); // Hide out of stock variations if 'Hide out of stock items from the catalog' is checked @@ -443,57 +481,66 @@ class WC_Product_Variable extends WC_Product { continue; } - $variation_attributes = $variation->get_variation_attributes(); - $availability = $variation->get_availability(); - $availability_html = empty( $availability['availability'] ) ? '' : '

' . wp_kses_post( $availability['availability'] ) . '

'; - $availability_html = apply_filters( 'woocommerce_stock_html', $availability_html, $availability['availability'], $variation ); - - if ( has_post_thumbnail( $variation->get_variation_id() ) ) { - $attachment_id = get_post_thumbnail_id( $variation->get_variation_id() ); - - $attachment = wp_get_attachment_image_src( $attachment_id, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ) ); - $image = $attachment ? current( $attachment ) : ''; - - $attachment = wp_get_attachment_image_src( $attachment_id, 'full' ); - $image_link = $attachment ? current( $attachment ) : ''; - - $image_title = get_the_title( $attachment_id ); - $image_alt = get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ); - } else { - $image = $image_link = $image_title = $image_alt = ''; - } - - $available_variations[] = apply_filters( 'woocommerce_available_variation', array( - 'variation_id' => $child_id, - 'variation_is_visible' => $variation->variation_is_visible(), - 'variation_is_active' => $variation->variation_is_active(), - 'is_purchasable' => $variation->is_purchasable(), - 'display_price' => $variation->get_display_price(), - 'display_regular_price' => $variation->get_display_price( $variation->get_regular_price() ), - 'attributes' => $variation_attributes, - 'image_src' => $image, - 'image_link' => $image_link, - 'image_title' => $image_title, - 'image_alt' => $image_alt, - 'price_html' => $variation->get_price() === "" || $this->get_variation_price( 'min' ) !== $this->get_variation_price( 'max' ) ? '' . $variation->get_price_html() . '' : '', - 'availability_html' => $availability_html, - 'sku' => $variation->get_sku(), - 'weight' => $variation->get_weight() . ' ' . esc_attr( get_option('woocommerce_weight_unit' ) ), - 'dimensions' => $variation->get_dimensions(), - 'min_qty' => 1, - 'max_qty' => $variation->backorders_allowed() ? '' : $variation->get_stock_quantity(), - 'backorders_allowed' => $variation->backorders_allowed(), - 'is_in_stock' => $variation->is_in_stock(), - 'is_downloadable' => $variation->is_downloadable() , - 'is_virtual' => $variation->is_virtual(), - 'is_sold_individually' => $variation->is_sold_individually() ? 'yes' : 'no', - 'variation_description' => $variation->get_variation_description(), - ), $this, $variation ); + $available_variations[] = $this->get_available_variation( $variation ); } return $available_variations; } + /** + * Returns an array of date for a variation. Used in the add to cart form. + * @since 2.4.0 + * @param $variation Variation product object or ID + * @return array + */ + public function get_available_variation( $variation ) { + if ( is_numeric( $variation ) ) { + $variation = $this->get_child( $variation ); + } + + if ( has_post_thumbnail( $variation->get_variation_id() ) ) { + $attachment_id = get_post_thumbnail_id( $variation->get_variation_id() ); + $attachment = wp_get_attachment_image_src( $attachment_id, 'full' ); + $image = $attachment ? current( $attachment ) : ''; + $image_link = $attachment ? current( $attachment ) : ''; + $image_title = get_the_title( $attachment_id ); + $image_alt = get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ); + } else { + $image = $image_link = $image_title = $image_alt = ''; + } + + $availability = $variation->get_availability(); + $availability_html = empty( $availability['availability'] ) ? '' : '

' . wp_kses_post( $availability['availability'] ) . '

'; + $availability_html = apply_filters( 'woocommerce_stock_html', $availability_html, $availability['availability'], $variation ); + + return apply_filters( 'woocommerce_available_variation', array( + 'variation_id' => $variation->variation_id, + 'variation_is_visible' => $variation->variation_is_visible(), + 'variation_is_active' => $variation->variation_is_active(), + 'is_purchasable' => $variation->is_purchasable(), + 'display_price' => $variation->get_display_price(), + 'display_regular_price' => $variation->get_display_price( $variation->get_regular_price() ), + 'attributes' => $variation->get_variation_attributes(), + 'image_src' => $image, + 'image_link' => $image_link, + 'image_title' => $image_title, + 'image_alt' => $image_alt, + 'price_html' => $variation->get_price() === "" || $this->get_variation_price( 'min' ) !== $this->get_variation_price( 'max' ) ? '' . $variation->get_price_html() . '' : '', + 'availability_html' => $availability_html, + 'sku' => $variation->get_sku(), + 'weight' => $variation->get_weight() . ' ' . esc_attr( get_option('woocommerce_weight_unit' ) ), + 'dimensions' => $variation->get_dimensions(), + 'min_qty' => 1, + 'max_qty' => $variation->backorders_allowed() ? '' : $variation->get_stock_quantity(), + 'backorders_allowed' => $variation->backorders_allowed(), + 'is_in_stock' => $variation->is_in_stock(), + 'is_downloadable' => $variation->is_downloadable() , + 'is_virtual' => $variation->is_virtual(), + 'is_sold_individually' => $variation->is_sold_individually() ? 'yes' : 'no', + 'variation_description' => $variation->get_variation_description(), + ), $this, $variation ); + } + /** * Sync variable product prices with the children lowest/highest prices. */ diff --git a/includes/class-wc-product-variation.php b/includes/class-wc-product-variation.php index 44730156763..ed31724712e 100644 --- a/includes/class-wc-product-variation.php +++ b/includes/class-wc-product-variation.php @@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) { */ class WC_Product_Variation extends WC_Product { - /** @public int ID of the variable product. */ + /** @public int ID of the variation itself. */ public $variation_id; /** @public object Parent Variable product object. */ diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index 73779245986..a7c364825d0 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -881,10 +881,10 @@ if ( ! function_exists( 'woocommerce_variable_add_to_cart' ) ) { // Load the template wc_get_template( 'single-product/add-to-cart/variable.php', array( - 'available_variations' => $product->get_available_variations(), - 'attributes' => $product->get_variation_attributes(), - 'selected_attributes' => $product->get_variation_default_attributes() - ) ); + 'available_variations' => sizeof( $product->get_children() ) <= apply_filters( 'woocommerce_max_variations', 20 ) ? $product->get_available_variations() : false, + 'attributes' => $product->get_variation_attributes(), + 'selected_attributes' => $product->get_variation_default_attributes() + ) ); } } if ( ! function_exists( 'woocommerce_external_add_to_cart' ) ) { diff --git a/templates/single-product/add-to-cart/variable.php b/templates/single-product/add-to-cart/variable.php index 0febaa8a4fe..a49f8cc928e 100644 --- a/templates/single-product/add-to-cart/variable.php +++ b/templates/single-product/add-to-cart/variable.php @@ -20,7 +20,7 @@ global $product, $post; - + $options ) : $loop++; ?>