Variation Swatches for WooCommerce - Version 2.1.2

Version Description

  • Remove inline styles when disable plugin styling is active
  • Remove unnecessary data when getting the product variation
  • Fix the configure link position
  • Update swatch position on mobile
  • Revert the background color swatch
  • Get the out of stock variation image
  • Fix security issues
  • Fix ajax loaded product swatches
Download this release

Release Info

Developer themealien
Plugin Icon 128x128 Variation Swatches for WooCommerce
Version 2.1.2
Comparing to
See all releases

Code changes from version 2.1.1 to 2.1.2

assets/css/admin.css CHANGED
@@ -560,6 +560,7 @@ button.accor-tab-btn.active-at-btn {
560
 
561
  .variation-html-wrapper {
562
  display: flex;
 
563
  }
564
 
565
  .variation-checkbox-container {
@@ -1218,8 +1219,8 @@ p.vmch-text a:focus {
1218
  border: 1px solid #5d6367;
1219
  }
1220
 
1221
- .configure-items-link {
1222
- float: left;
1223
  }
1224
 
1225
  #woocommerce-coupon-data ul.wc-tabs li.variation-swatches_options a::before,
560
 
561
  .variation-html-wrapper {
562
  display: flex;
563
+ flex-wrap: wrap;
564
  }
565
 
566
  .variation-checkbox-container {
1219
  border: 1px solid #5d6367;
1220
  }
1221
 
1222
+ .configure-items-link:not(.hidden) {
1223
+ display: block;
1224
  }
1225
 
1226
  #woocommerce-coupon-data ul.wc-tabs li.variation-swatches_options a::before,
assets/css/admin.css.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["admin.scss"],"names":[],"mappings":";AACE;EACE;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;;AAIJ;EACE;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;AAEA;EACE;;AAIA;EACE;;AAGF;EACE;;;AAKN;AAEA;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;;AAEA;EACE;EACA;EACA;;;AAIJ;EACE;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EASE;;AARA;EACE;EACA;EACA;EACA;EACA;;;AAQR;EACE;IACE;IACA;;;EAGF;IACE;IACA;IACA;;;EAGF;IACE;IACA;IACA;;;EAGF;IACE;;;AAIJ;EACE;IACE;;;AAIJ;EACE;IACE;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;AAAA;AAAA;AAIA;EACE;EACA;EACA;;;AAIA;EACE;EACA;EACA;;AAGF;EACE;EACA;;AAGF;EACE;;;AAKF;EACE;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAIJ;EACE;EACA;EACA;;AAGF;EACE;EACA;;AAIA;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;;AAKN;EACE;IACE;IACA;IACA;IACA;;;AAIJ;EAEI;IACE;IACA;IACA;IACA;;EAGF;IACE;IACA;IACA;IACA;;EAEA;IACE;;;AAMR;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;;;AAIA;EACE;;AAGF;EACE;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAIA;EACE;;AAGF;EACE;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;;AAEA;AAAA;EAEE;;AAGF;AAAA;EAEE;;AAGF;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAKN;EACE;EACA;;AAEA;EACE;;AAGF;EACE;;;AAKN;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;AAEA;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAKF;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;;AAIJ;EACE;;AAEA;EACE;;;AAKN;AAEA;AAEA;AAEA;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;;AAIJ;EACE;;AAEA;EACE;;;AAIJ;EACE;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;;;AAIJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;;AAEA;EACE;;;AAIJ;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAEA;EACE;;AAKN;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAIJ;EACE;;;AAIJ;EACE;;AAEA;EACE;EACA;;AAGF;EACE;;;AAIJ;EACE;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAOE;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAKF;EACE;;AAKF;EACE;;;AAMR;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAIA;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;;AAMN;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;IACE;;;AAKF;EACE;;AAGF;EACE;;;AAIJ;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAIA;EACE;;AAEA;EACE;EACA;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAIJ;EACE;IACE;;;AAIJ;EACE;IACE;IACA;;;EAGF;IACE;;;AAIJ;EACE;IACE;;EAEA;IACE;IACA;;;EAIJ;IACE;;;EAGF;IACE;;;EAGF;IACE;;;AAIJ;EACE;;;AAIA;EACE;EACA;;AAGF;EACE;;;AAIJ;EACE;IACE;IACA;;;AAIJ;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;AAGE;EACE;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;;AAEA;EACE;;AAIJ;EACE;EACA;;AAGF;EACE;;AAGF;EACE;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;;AAEA;EACE;;AAKF;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAGF;EACE;EACA;EACA;;AAIJ;EACE;EACA;EACA;;AAIA;EACE;EACA;EACA;;;AAKN;EAEI;IACE;IACA;IACA;IACA;;EAGF;IACE;IACA;IACA;IACA;;;AAMJ;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAIJ;EACE;;;AAIJ;EACE;;;AAGF;EACE;EACA;;AAEA;EACE;EACA;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGE;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;;AAIA;EACE;;;AAQV;EACE;EACA;;AAGE;EACE;;AAEA;EACE;;AAIJ;EACE;;AAGF;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAMF;EACE;;AAMN;EAzCF;IA0CI;;;AAGF;EA7CF;IA8CI;IACA;;;AAGF;EAlDF;IAmDI;IACA;;;;AAQE;EACE;;AAIJ;EACE;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;;AAGF;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;;AAIA;EACE;EACA;;AAGF;EACE;;AAON;EAnDF;IAoDI;IACA;IACA;;;AAEF;EAxDF;IAyDI;IACA;;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAKE;EACE;EACA;EACA;;;AAKN;EACE;;;AAGF;AAAA;AAAA;EAGE;;;AAGF;AAAA;EAEE;;AAGE;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAKN;EACE;IACE;;EAEF;IACE;;;AAIJ;EACE;IACE;;EAEF;IACE;;;AAIJ;EAEE;IACE;IACA;IACA;;;AAIJ;EACE;IACE;;;EAGF;IACE;IACA;;;EAIA;IACE;IACA;;EAGF;IACE;;;AAKN;AAEA;EACE;IACE;;EAEF;IACE;;;AAIJ;EACE;IACE;;EAEF;IACE","file":"admin.css"}
1
+ {"version":3,"sourceRoot":"","sources":["admin.scss"],"names":[],"mappings":";AACE;EACE;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;;AAIJ;EACE;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;AAEA;EACE;;AAIA;EACE;;AAGF;EACE;;;AAKN;AAEA;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;;AAEA;EACE;EACA;EACA;;;AAIJ;EACE;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EASE;;AARA;EACE;EACA;EACA;EACA;EACA;;;AAQR;EACE;IACE;IACA;;;EAGF;IACE;IACA;IACA;;;EAGF;IACE;IACA;IACA;;;EAGF;IACE;;;AAIJ;EACE;IACE;;;AAIJ;EACE;IACE;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;AAAA;AAAA;AAIA;EACE;EACA;EACA;;;AAIA;EACE;EACA;EACA;;AAGF;EACE;EACA;;AAGF;EACE;;;AAKF;EACE;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAIJ;EACE;EACA;EACA;;AAGF;EACE;EACA;;AAIA;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;;AAKN;EACE;IACE;IACA;IACA;IACA;;;AAIJ;EAEI;IACE;IACA;IACA;IACA;;EAGF;IACE;IACA;IACA;IACA;;EAEA;IACE;;;AAMR;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;;;AAIA;EACE;;AAGF;EACE;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAIA;EACE;;AAGF;EACE;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;;AAEA;AAAA;EAEE;;AAGF;AAAA;EAEE;;AAGF;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAKN;EACE;EACA;;AAEA;EACE;;AAGF;EACE;;;AAKN;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;AAEA;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAKF;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;;AAIJ;EACE;;AAEA;EACE;;;AAKN;AAEA;AAEA;AAEA;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;;AAIJ;EACE;;AAEA;EACE;;;AAIJ;EACE;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;;;AAIJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;;AAEA;EACE;;;AAIJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAEA;EACE;;AAKN;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAIJ;EACE;;;AAIJ;EACE;;AAEA;EACE;EACA;;AAGF;EACE;;;AAIJ;EACE;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAOE;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAKF;EACE;;AAKF;EACE;;;AAMR;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAIA;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;;AAMN;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;IACE;;;AAKF;EACE;;AAGF;EACE;;;AAIJ;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAIA;EACE;;AAEA;EACE;EACA;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAIJ;EACE;IACE;;;AAIJ;EACE;IACE;IACA;;;EAGF;IACE;;;AAIJ;EACE;IACE;;EAEA;IACE;IACA;;;EAIJ;IACE;;;EAGF;IACE;;;EAGF;IACE;;;AAIJ;EACE;;;AAIA;EACE;EACA;;AAGF;EACE;;;AAIJ;EACE;IACE;IACA;;;AAIJ;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;AAGE;EACE;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;;AAEA;EACE;;AAIJ;EACE;EACA;;AAGF;EACE;;AAGF;EACE;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;;AAEA;EACE;;AAKF;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAGF;EACE;EACA;EACA;;AAIJ;EACE;EACA;EACA;;AAIA;EACE;EACA;EACA;;;AAKN;EAEI;IACE;IACA;IACA;IACA;;EAGF;IACE;IACA;IACA;IACA;;;AAMJ;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAIJ;EACE;;;AAIJ;EACE;;;AAGF;EACE;EACA;;AAEA;EACE;EACA;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGE;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;;AAIA;EACE;;;AAQV;EACE;EACA;;AAGE;EACE;;AAEA;EACE;;AAIJ;EACE;;AAGF;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAMF;EACE;;AAMN;EAzCF;IA0CI;;;AAGF;EA7CF;IA8CI;IACA;;;AAGF;EAlDF;IAmDI;IACA;;;;AAQE;EACE;;AAIJ;EACE;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;;AAGF;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;;AAIA;EACE;EACA;;AAGF;EACE;;AAON;EAnDF;IAoDI;IACA;IACA;;;AAEF;EAxDF;IAyDI;IACA;;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAKE;EACE;EACA;EACA;;;AAKN;EACE;;;AAGF;AAAA;AAAA;EAGE;;;AAGF;AAAA;EAEE;;AAGE;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAKN;EACE;IACE;;EAEF;IACE;;;AAIJ;EACE;IACE;;EAEF;IACE;;;AAIJ;EAEE;IACE;IACA;IACA;;;AAIJ;EACE;IACE;;;EAGF;IACE;IACA;;;EAIA;IACE;IACA;;EAGF;IACE;;;AAKN;AAEA;EACE;IACE;;EAEF;IACE;;;AAIJ;EACE;IACE;;EAEF;IACE","file":"admin.css"}
assets/css/admin.scss CHANGED
@@ -637,6 +637,7 @@ button.accor-tab-btn {
637
 
638
  .variation-html-wrapper {
639
  display: flex;
 
640
  }
641
 
642
  .variation-checkbox-container {
@@ -1428,8 +1429,8 @@ p.vmch-text a {
1428
  }
1429
  }
1430
 
1431
- .configure-items-link {
1432
- float: left;
1433
  }
1434
 
1435
  #woocommerce-coupon-data ul.wc-tabs li.variation-swatches_options a::before,
637
 
638
  .variation-html-wrapper {
639
  display: flex;
640
+ flex-wrap: wrap;
641
  }
642
 
643
  .variation-checkbox-container {
1429
  }
1430
  }
1431
 
1432
+ .configure-items-link:not(.hidden) {
1433
+ display: block;
1434
  }
1435
 
1436
  #woocommerce-coupon-data ul.wc-tabs li.variation-swatches_options a::before,
assets/css/frontend.css CHANGED
@@ -379,7 +379,7 @@
379
  .woocommerce div.product form.cart.variations_form .tawcvs-swatches.oss-hide .swatch.disabled,
380
  .woocommerce.archive form.cart.variations_form .tawcvs-swatches.oss-hide .swatch.disabled,
381
  .woocommerce.single-product form.cart.variations_form .tawcvs-swatches.oss-hide .swatch.disabled {
382
- display: none;
383
  }
384
 
385
  .swatch-align-left .variations {
@@ -417,6 +417,11 @@
417
  .woocommerce.theme-sober div.product form.cart.variations_form .variations .variable {
418
  width: 90%;
419
  }
 
 
 
 
 
420
  .woocommerce.theme-sober div.product form.cart.variations_form .line-hover {
421
  cursor: default;
422
  }
379
  .woocommerce div.product form.cart.variations_form .tawcvs-swatches.oss-hide .swatch.disabled,
380
  .woocommerce.archive form.cart.variations_form .tawcvs-swatches.oss-hide .swatch.disabled,
381
  .woocommerce.single-product form.cart.variations_form .tawcvs-swatches.oss-hide .swatch.disabled {
382
+ display: none !important;
383
  }
384
 
385
  .swatch-align-left .variations {
417
  .woocommerce.theme-sober div.product form.cart.variations_form .variations .variable {
418
  width: 90%;
419
  }
420
+ @media (max-width: 768px) {
421
+ .woocommerce.theme-sober div.product form.cart.variations_form .variations .variable {
422
+ width: 100%;
423
+ }
424
+ }
425
  .woocommerce.theme-sober div.product form.cart.variations_form .line-hover {
426
  cursor: default;
427
  }
assets/css/frontend.css.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["frontend.scss"],"names":[],"mappings":"AAAA;EACE;EACA;;;AAQI;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;EACE;;AAIJ;AAAA;AAAA;EACE;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EAEE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAEE;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAIE;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAKN;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAIJ;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAIJ;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAIJ;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAIJ;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAIJ;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAKN;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAIJ;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;EACE;EACA;EACA;;AAIA;AAAA;AAAA;EACE;EACA;;AAEA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAeA;AAAA;AAAA;EACE;;AAKF;AAAA;AAAA;EACE;;AAON;AAAA;AAAA;EACE;;;AAOV;EACE;;AAEA;EACE;;;AAIJ;EACE;;AAEA;EACE;;;AAKF;EACE;;;AAIJ;EACE;;AAEA;EACE;;;AAIJ;EACE;;;AAGF;AAAA;AAAA;AAIE;EACE;;AAGF;EACE;;AAKA;EAME;;AALA;EACE;EACA","file":"frontend.css"}
1
+ {"version":3,"sourceRoot":"","sources":["frontend.scss"],"names":[],"mappings":"AAAA;EACE;EACA;;;AAQI;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;EACE;;AAIJ;AAAA;AAAA;EACE;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EAEE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAEE;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAIE;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAKN;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAIJ;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAIJ;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAIJ;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAIJ;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAIJ;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAKN;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAIJ;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;EACE;EACA;EACA;;AAIA;AAAA;AAAA;EACE;EACA;;AAEA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAeA;AAAA;AAAA;EACE;;AAKF;AAAA;AAAA;EACE;;AAON;AAAA;AAAA;EACE;;;AAOV;EACE;;AAEA;EACE;;;AAIJ;EACE;;AAEA;EACE;;;AAKF;EACE;;;AAIJ;EACE;;AAEA;EACE;;;AAIJ;EACE;;;AAGF;AAAA;AAAA;AAIE;EACE;;AAGF;EACE;IACE;;;AAIJ;EACE;;AAKA;EAME;;AALA;EACE;EACA","file":"frontend.css"}
assets/css/frontend.scss CHANGED
@@ -284,7 +284,7 @@
284
 
285
  &.oss-hide {
286
  .swatch.disabled {
287
- display: none;
288
  }
289
  }
290
  }
@@ -333,6 +333,12 @@
333
  width: 90%;
334
  }
335
 
 
 
 
 
 
 
336
  .line-hover {
337
  cursor: default;
338
  }
284
 
285
  &.oss-hide {
286
  .swatch.disabled {
287
+ display: none !important;
288
  }
289
  }
290
  }
333
  width: 90%;
334
  }
335
 
336
+ @media (max-width: 768px) {
337
+ .variations .variable {
338
+ width: 100%;
339
+ }
340
+ }
341
+
342
  .line-hover {
343
  cursor: default;
344
  }
assets/js/admin.js CHANGED
@@ -157,6 +157,7 @@ jQuery(document).ready(function ($) {
157
  e.preventDefault();
158
 
159
  const data = JSON.parse(getAllValues());
 
160
  let savingNoticeEle = $('.wcvs-saving-notice');
161
 
162
  $('.wcvs-notice').hide();
@@ -320,6 +321,7 @@ jQuery(document).ready(function ($) {
320
  }
321
 
322
  ajaxData.typeToUpdate = typeToUpdate;
 
323
 
324
  $(this).closest(".ajax-to-update").toggleClass("saving");
325
 
@@ -383,6 +385,7 @@ jQuery(document).ready(function ($) {
383
 
384
  //We need to get the response after update the plugin setting
385
  ajaxData.sendResponse = 1;
 
386
 
387
  //Run the Ajax to update plugin setting
388
  wp.ajax.send("update_attribute_type_setting", {
157
  e.preventDefault();
158
 
159
  const data = JSON.parse(getAllValues());
160
+ data['__nonce'] = $('[name="__nonce"]').val();
161
  let savingNoticeEle = $('.wcvs-saving-notice');
162
 
163
  $('.wcvs-notice').hide();
321
  }
322
 
323
  ajaxData.typeToUpdate = typeToUpdate;
324
+ ajaxData.__nonce = $('[name="__nonce"]').val();
325
 
326
  $(this).closest(".ajax-to-update").toggleClass("saving");
327
 
385
 
386
  //We need to get the response after update the plugin setting
387
  ajaxData.sendResponse = 1;
388
+ ajaxData.__nonce = $('[name="__nonce"]').val();
389
 
390
  //Run the Ajax to update plugin setting
391
  wp.ajax.send("update_attribute_type_setting", {
assets/js/frontend.js CHANGED
@@ -81,7 +81,11 @@
81
  $swatch.removeClass('disabled');
82
  } else {
83
  $swatch.addClass('disabled');
84
-
 
 
 
 
85
  if ($selected.length && value === $selected.val()) {
86
  $swatch.removeClass('selected');
87
  }
@@ -167,4 +171,14 @@
167
  $(document.body).trigger('tawcvs_initialized');
168
  toggle_hidden_variation_btn();
169
  });
 
 
 
 
 
 
 
 
 
 
170
  })(jQuery);
81
  $swatch.removeClass('disabled');
82
  } else {
83
  $swatch.addClass('disabled');
84
+
85
+ if ($swatch.closest('.tawcvs-swatches').hasClass('oss-hide')) {
86
+ $swatch.closest('.swatch-item-wrapper').hide();
87
+ }
88
+
89
  if ($selected.length && value === $selected.val()) {
90
  $swatch.removeClass('selected');
91
  }
171
  $(document.body).trigger('tawcvs_initialized');
172
  toggle_hidden_variation_btn();
173
  });
174
+
175
+ $(document).ajaxComplete(function () {
176
+ var $variations_form = $('.variations_form:not(.swatches-support)');
177
+ if ($variations_form.length > 0) {
178
+ $variations_form.each(function() {
179
+ $(this).wc_variation_form();
180
+ });
181
+ $variations_form.tawcvs_variation_swatches_form();
182
+ }
183
+ });
184
  })(jQuery);
includes/class-admin.php CHANGED
@@ -513,6 +513,9 @@ class TA_WC_Variation_Swatches_Admin {
513
  * It also can be called from the Ajax callback to save attribute type
514
  */
515
  public function update_attribute_type_setting() {
 
 
 
516
 
517
  //Get the latest plugin option
518
  $latest_option = $this->get_latest_plugin_option();
@@ -535,6 +538,10 @@ class TA_WC_Variation_Swatches_Admin {
535
  * Ajax callback to update the Product Attribute type
536
  */
537
  public function update_product_attr_type() {
 
 
 
 
538
  global $wpdb;
539
 
540
  $attribute_name = isset( $_POST['attribute'] ) ? sanitize_text_field( $_POST['attribute'] ) : '';
513
  * It also can be called from the Ajax callback to save attribute type
514
  */
515
  public function update_attribute_type_setting() {
516
+ if ( ! wp_verify_nonce( $_POST['__nonce'], 'tawcvs_admin_settings') || ! current_user_can( 'manage_woocommerce' ) ) {
517
+ wp_send_json_error( array( 'message' => 'Failed to update', 'success' => false ), 200 );
518
+ }
519
 
520
  //Get the latest plugin option
521
  $latest_option = $this->get_latest_plugin_option();
538
  * Ajax callback to update the Product Attribute type
539
  */
540
  public function update_product_attr_type() {
541
+ if ( ! wp_verify_nonce( $_POST['__nonce'], 'tawcvs_admin_settings') || ! current_user_can( 'manage_woocommerce' ) ) {
542
+ wp_send_json_error( array( 'message' => 'Failed to update', 'success' => false ), 200 );
543
+ }
544
+
545
  global $wpdb;
546
 
547
  $attribute_name = isset( $_POST['attribute'] ) ? sanitize_text_field( $_POST['attribute'] ) : '';
includes/class-frontend.php CHANGED
@@ -177,6 +177,7 @@ class TA_WC_Variation_Swatches_Frontend {
177
  if ( ! empty( $options ) && taxonomy_exists( $attribute_tax_name ) ) {
178
  // Get terms if this is a taxonomy - ordered. We need the names too.
179
  $terms = $this->get_product_variation_term( $product, $defined_limit, $attribute_tax_name, $options );
 
180
  foreach ( $terms as $term ) {
181
 
182
  //Check if we have the product variable for this attribute
@@ -383,46 +384,48 @@ class TA_WC_Variation_Swatches_Frontend {
383
 
384
 
385
  public function apply_custom_design_styles() {
386
- $page = is_product() ? 'productDesign' : 'shopDesign';
387
- ?>
388
- <style>
389
- .woocommerce div.product form.cart.variations_form .tawcvs-swatches,
390
- .woocommerce.single-product form.cart.variations_form .tawcvs-swatches,
391
- .woocommerce.archive form.cart.variations_form .tawcvs-swatches {
392
- margin-top: <?php echo isset($this->{$page}['wrm-top']) ? $this->{$page}['wrm-top'] : '0'; echo isset($this->{$page}['wrm-type']) ? $this->{$page}['wrm-type'] : 'px' ?>;
393
- margin-right: <?php echo isset($this->{$page}['wrm-right']) ? $this->{$page}['wrm-right'] : '15'; echo isset($this->{$page}['wrm-type']) ? $this->{$page}['wrm-type'] : 'px' ?>;
394
- margin-bottom: <?php echo isset($this->{$page}['wrm-bottom']) ? $this->{$page}['wrm-bottom'] : '15'; echo isset($this->{$page}['wrm-type']) ? $this->{$page}['wrm-type'] : 'px' ?>;
395
- margin-left: <?php echo isset($this->{$page}['wrm-left']) ? $this->{$page}['wrm-left'] : '0'; echo isset($this->{$page}['wrm-type']) ? $this->{$page}['wrm-type'] : 'px' ?>;
396
- padding-top: <?php echo isset($this->{$page}['wrp-top']) ? $this->{$page}['wrp-top'] : '0'; echo isset($this->{$page}['wrp-type']) ? $this->{$page}['wrp-type'] : 'px' ?>;
397
- padding-right: <?php echo isset($this->{$page}['wrp-right']) ? $this->{$page}['wrp-right'] : '0'; echo isset($this->{$page}['wrp-type']) ? $this->{$page}['wrp-type'] : 'px' ?>;
398
- padding-bottom: <?php echo isset($this->{$page}['wrp-bottom']) ? $this->{$page}['wrp-bottom'] : '0'; echo isset($this->{$page}['wrp-type']) ? $this->{$page}['wrp-type'] : 'px' ?>;
399
- padding-left: <?php echo isset($this->{$page}['wrp-left']) ? $this->{$page}['wrp-left'] : '0'; echo isset($this->{$page}['wrp-type']) ? $this->{$page}['wrp-type'] : 'px' ?>;
400
- }
401
-
402
- .woocommerce div.product form.cart.variations_form .tawcvs-swatches .swatch-item-wrapper,
403
- .woocommerce.single-product form.cart.variations_form .tawcvs-swatches .swatch-item-wrapper,
404
- .woocommerce.archive form.cart.variations_form .tawcvs-swatches .swatch-item-wrapper {
405
- <?php if($this->{$page}['item-font']):?> font-size: <?php echo isset($this->{$page}['text-font-size']) ? $this->{$page}['text-font-size'] : '12'; echo isset($this->{$page}['item-font-size-type']) ? $this->{$page}['item-font-size-type'] : 'px'; ?>;
406
- <?php endif;?> margin-top: <?php echo isset($this->{$page}['mar-top']) ? $this->{$page}['mar-top'] : '0'; echo isset($this->{$page}['mar-type']) ? $this->{$page}['mar-type'] : 'px' ?> !important;
407
- margin-right: <?php echo isset($this->{$page}['mar-right']) ? $this->{$page}['mar-right'] : '15'; echo isset($this->{$page}['mar-type']) ? $this->{$page}['mar-type'] : 'px' ?> !important;
408
- margin-bottom: <?php echo isset($this->{$page}['mar-bottom']) ? $this->{$page}['mar-bottom'] : '15'; echo isset($this->{$page}['mar-type']) ? $this->{$page}['mar-type'] : 'px' ?> !important;
409
- margin-left: <?php echo isset($this->{$page}['mar-left']) ? $this->{$page}['mar-left'] : '0'; echo isset($this->{$page}['mar-type']) ? $this->{$page}['mar-type'] : 'px' ?> !important;
410
- padding-top: <?php echo isset($this->{$page}['pad-top']) ? $this->{$page}['pad-top'] : '0'; echo isset($this->{$page}['pad-type']) ? $this->{$page}['pad-type'] : 'px' ?> !important;
411
- padding-right: <?php echo isset($this->{$page}['pad-right']) ? $this->{$page}['pad-right'] : '0'; echo isset($this->{$page}['pad-type']) ? $this->{$page}['pad-type'] : 'px' ?> !important;
412
- padding-bottom: <?php echo isset($this->{$page}['pad-bottom']) ? $this->{$page}['pad-bottom'] : '0'; echo isset($this->{$page}['pad-type']) ? $this->{$page}['pad-type'] : 'px' ?> !important;
413
- padding-left: <?php echo isset($this->{$page}['pad-left']) ? $this->{$page}['pad-left'] : '0'; echo isset($this->{$page}['pad-type']) ? $this->{$page}['pad-type'] : 'px' ?> !important;
414
- }
415
-
416
- /*tooltip*/
417
- .woocommerce div.product form.cart.variations_form .tawcvs-swatches .swatch .swatch__tooltip,
418
- .woocommerce.single-product form.cart.variations_form .tawcvs-swatches .swatch .swatch__tooltip,
419
- .woocommerce.archive form.cart.variations_form .tawcvs-swatches .swatch .swatch__tooltip {
420
- <?php if(isset($this->toolTipDesign['item-font']) && $this->toolTipDesign['item-font']):?> font-size: <?php echo isset($this->toolTipDesign['text-font-size']) ? $this->toolTipDesign['text-font-size'] : '14'; echo isset($this->toolTipDesign['item-font-size-type']) ? $this->toolTipDesign['item-font-size-type'] : 'px'; ?>;
421
- <?php endif;?> width: <?php echo isset($this->toolTipDesign['width']) ? $this->toolTipDesign['width'] . 'px' : 'auto' ?>;
422
- max-width: <?php echo isset($this->toolTipDesign['max-width']) ? $this->toolTipDesign['max-width'] .'px' : '100%' ?>;
423
- line-height: <?php echo isset($this->toolTipDesign['line-height']) ?: 'unset'; ?>;
424
- }
425
- </style>
426
- <?php
 
 
427
  }
428
  }
177
  if ( ! empty( $options ) && taxonomy_exists( $attribute_tax_name ) ) {
178
  // Get terms if this is a taxonomy - ordered. We need the names too.
179
  $terms = $this->get_product_variation_term( $product, $defined_limit, $attribute_tax_name, $options );
180
+
181
  foreach ( $terms as $term ) {
182
 
183
  //Check if we have the product variable for this attribute
384
 
385
 
386
  public function apply_custom_design_styles() {
387
+ if ( isset( $this->generalSettings['disable-plugin-stylesheet'] ) && ! $this->generalSettings['disable-plugin-stylesheet'] ) {
388
+ $page = is_product() ? 'productDesign' : 'shopDesign';
389
+ ?>
390
+ <style>
391
+ .woocommerce div.product form.cart.variations_form .tawcvs-swatches,
392
+ .woocommerce.single-product form.cart.variations_form .tawcvs-swatches,
393
+ .woocommerce.archive form.cart.variations_form .tawcvs-swatches {
394
+ margin-top: <?php echo isset($this->{$page}['wrm-top']) ? $this->{$page}['wrm-top'] : '0'; echo isset($this->{$page}['wrm-type']) ? $this->{$page}['wrm-type'] : 'px' ?>;
395
+ margin-right: <?php echo isset($this->{$page}['wrm-right']) ? $this->{$page}['wrm-right'] : '15'; echo isset($this->{$page}['wrm-type']) ? $this->{$page}['wrm-type'] : 'px' ?>;
396
+ margin-bottom: <?php echo isset($this->{$page}['wrm-bottom']) ? $this->{$page}['wrm-bottom'] : '15'; echo isset($this->{$page}['wrm-type']) ? $this->{$page}['wrm-type'] : 'px' ?>;
397
+ margin-left: <?php echo isset($this->{$page}['wrm-left']) ? $this->{$page}['wrm-left'] : '0'; echo isset($this->{$page}['wrm-type']) ? $this->{$page}['wrm-type'] : 'px' ?>;
398
+ padding-top: <?php echo isset($this->{$page}['wrp-top']) ? $this->{$page}['wrp-top'] : '0'; echo isset($this->{$page}['wrp-type']) ? $this->{$page}['wrp-type'] : 'px' ?>;
399
+ padding-right: <?php echo isset($this->{$page}['wrp-right']) ? $this->{$page}['wrp-right'] : '0'; echo isset($this->{$page}['wrp-type']) ? $this->{$page}['wrp-type'] : 'px' ?>;
400
+ padding-bottom: <?php echo isset($this->{$page}['wrp-bottom']) ? $this->{$page}['wrp-bottom'] : '0'; echo isset($this->{$page}['wrp-type']) ? $this->{$page}['wrp-type'] : 'px' ?>;
401
+ padding-left: <?php echo isset($this->{$page}['wrp-left']) ? $this->{$page}['wrp-left'] : '0'; echo isset($this->{$page}['wrp-type']) ? $this->{$page}['wrp-type'] : 'px' ?>;
402
+ }
403
+
404
+ .woocommerce div.product form.cart.variations_form .tawcvs-swatches .swatch-item-wrapper,
405
+ .woocommerce.single-product form.cart.variations_form .tawcvs-swatches .swatch-item-wrapper,
406
+ .woocommerce.archive form.cart.variations_form .tawcvs-swatches .swatch-item-wrapper {
407
+ <?php if($this->{$page}['item-font']):?> font-size: <?php echo isset($this->{$page}['text-font-size']) ? $this->{$page}['text-font-size'] : '12'; echo isset($this->{$page}['item-font-size-type']) ? $this->{$page}['item-font-size-type'] : 'px'; ?>;
408
+ <?php endif;?> margin-top: <?php echo isset($this->{$page}['mar-top']) ? $this->{$page}['mar-top'] : '0'; echo isset($this->{$page}['mar-type']) ? $this->{$page}['mar-type'] : 'px' ?> !important;
409
+ margin-right: <?php echo isset($this->{$page}['mar-right']) ? $this->{$page}['mar-right'] : '15'; echo isset($this->{$page}['mar-type']) ? $this->{$page}['mar-type'] : 'px' ?> !important;
410
+ margin-bottom: <?php echo isset($this->{$page}['mar-bottom']) ? $this->{$page}['mar-bottom'] : '15'; echo isset($this->{$page}['mar-type']) ? $this->{$page}['mar-type'] : 'px' ?> !important;
411
+ margin-left: <?php echo isset($this->{$page}['mar-left']) ? $this->{$page}['mar-left'] : '0'; echo isset($this->{$page}['mar-type']) ? $this->{$page}['mar-type'] : 'px' ?> !important;
412
+ padding-top: <?php echo isset($this->{$page}['pad-top']) ? $this->{$page}['pad-top'] : '0'; echo isset($this->{$page}['pad-type']) ? $this->{$page}['pad-type'] : 'px' ?> !important;
413
+ padding-right: <?php echo isset($this->{$page}['pad-right']) ? $this->{$page}['pad-right'] : '0'; echo isset($this->{$page}['pad-type']) ? $this->{$page}['pad-type'] : 'px' ?> !important;
414
+ padding-bottom: <?php echo isset($this->{$page}['pad-bottom']) ? $this->{$page}['pad-bottom'] : '0'; echo isset($this->{$page}['pad-type']) ? $this->{$page}['pad-type'] : 'px' ?> !important;
415
+ padding-left: <?php echo isset($this->{$page}['pad-left']) ? $this->{$page}['pad-left'] : '0'; echo isset($this->{$page}['pad-type']) ? $this->{$page}['pad-type'] : 'px' ?> !important;
416
+ }
417
+
418
+ /*tooltip*/
419
+ .woocommerce div.product form.cart.variations_form .tawcvs-swatches .swatch .swatch__tooltip,
420
+ .woocommerce.single-product form.cart.variations_form .tawcvs-swatches .swatch .swatch__tooltip,
421
+ .woocommerce.archive form.cart.variations_form .tawcvs-swatches .swatch .swatch__tooltip {
422
+ <?php if(isset($this->toolTipDesign['item-font']) && $this->toolTipDesign['item-font']):?> font-size: <?php echo isset($this->toolTipDesign['text-font-size']) ? $this->toolTipDesign['text-font-size'] : '14'; echo isset($this->toolTipDesign['item-font-size-type']) ? $this->toolTipDesign['item-font-size-type'] : 'px'; ?>;
423
+ <?php endif;?> width: <?php echo isset($this->toolTipDesign['width']) ? $this->toolTipDesign['width'] . 'px' : 'auto' ?>;
424
+ max-width: <?php echo isset($this->toolTipDesign['max-width']) ? $this->toolTipDesign['max-width'] .'px' : '100%' ?>;
425
+ line-height: <?php echo isset($this->toolTipDesign['line-height']) ?: 'unset'; ?>;
426
+ }
427
+ </style>
428
+ <?php
429
+ }
430
  }
431
  }
includes/class-menu-page.php CHANGED
@@ -85,8 +85,9 @@ class VSWC_Settings_Page {
85
 
86
  public function tawcvs_save_settings() {
87
  unset( $_POST['action'] );
88
- $this->save_post_data_to_db();
89
- wp_send_json_success( [ 'msg' => 'saved' ], 200 );
 
90
  }
91
 
92
  /**
@@ -97,9 +98,10 @@ class VSWC_Settings_Page {
97
  public function handle_save_actions() {
98
  if ( isset( $_POST['woosuite_saving_variation_settings'] ) ) {
99
  unset( $_POST['woosuite_saving_variation_settings'] );
100
- $this->save_post_data_to_db();
101
- $this->syncing_up_color_image_swatches();
102
- $_POST['woosuite_saved_variation_settings'] = true;
 
103
  }
104
  }
105
 
@@ -107,7 +109,11 @@ class VSWC_Settings_Page {
107
  * Helper function to save _POST data to db
108
  */
109
  private function save_post_data_to_db() {
110
- update_option( $this->option_name, $this->sanitize_post_data( $_POST ) );
 
 
 
 
111
  }
112
 
113
  /**
85
 
86
  public function tawcvs_save_settings() {
87
  unset( $_POST['action'] );
88
+ if ( $this->save_post_data_to_db() ) {
89
+ wp_send_json_success( [ 'msg' => 'saved' ], 200 );
90
+ }
91
  }
92
 
93
  /**
98
  public function handle_save_actions() {
99
  if ( isset( $_POST['woosuite_saving_variation_settings'] ) ) {
100
  unset( $_POST['woosuite_saving_variation_settings'] );
101
+ if ( $this->save_post_data_to_db() ) {
102
+ $this->syncing_up_color_image_swatches();
103
+ $_POST['woosuite_saved_variation_settings'] = true;
104
+ }
105
  }
106
  }
107
 
109
  * Helper function to save _POST data to db
110
  */
111
  private function save_post_data_to_db() {
112
+ if ( wp_verify_nonce( $_POST['__nonce'], 'tawcvs_admin_settings') && current_user_can( 'manage_woocommerce' ) ) {
113
+ unset( $_POST['__nonce'] );
114
+ update_option( $this->option_name, $this->sanitize_post_data( $_POST ) );
115
+ return TRUE;
116
+ }
117
  }
118
 
119
  /**
includes/class-variation-swatches.php CHANGED
@@ -113,7 +113,12 @@ final class TA_WC_Variation_Swatches {
113
  $attr = $taxonomy;
114
  }
115
 
116
- $result = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "woocommerce_attribute_taxonomies WHERE attribute_name = %s", $attr ) );
 
 
 
 
 
117
 
118
  return apply_filters( 'tawcvs_tax_attributes', $result );
119
  }
@@ -163,7 +168,13 @@ final class TA_WC_Variation_Swatches {
163
  }
164
  }
165
 
166
- public static function get_product_attributes_as_checkbox( $section_id, $tab_id, $field_name, $show_configure_link = false, $type_to_update = '' ) {
 
 
 
 
 
 
167
  ob_start();
168
  $current_options = get_option( 'woosuite_variation_swatches_option' ) ?: array();
169
  if ( ! empty( $tab_id ) ) {
@@ -212,7 +223,8 @@ final class TA_WC_Variation_Swatches {
212
  return array();
213
  }
214
  $collected_variations = array();
215
- $variations = $product->get_available_variations();
 
216
  if ( ! empty( $variations ) ) {
217
  foreach ( $variations as $variation ) {
218
  $attribute_item_obj_slug = $variation['attributes'][ 'attribute_' . $attribute_tax_name ];
@@ -226,6 +238,51 @@ final class TA_WC_Variation_Swatches {
226
  return $collected_variations;
227
  }
228
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  /**
230
  * Detect if we have the Woosuite Core plugin activated
231
  *
113
  $attr = $taxonomy;
114
  }
115
 
116
+ $result = $wpdb->get_row(
117
+ $wpdb->prepare(
118
+ "SELECT * FROM " . $wpdb->prefix . "woocommerce_attribute_taxonomies WHERE attribute_name = %s",
119
+ $attr
120
+ )
121
+ );
122
 
123
  return apply_filters( 'tawcvs_tax_attributes', $result );
124
  }
168
  }
169
  }
170
 
171
+ public static function get_product_attributes_as_checkbox(
172
+ $section_id,
173
+ $tab_id,
174
+ $field_name,
175
+ $show_configure_link = false,
176
+ $type_to_update = ''
177
+ ) {
178
  ob_start();
179
  $current_options = get_option( 'woosuite_variation_swatches_option' ) ?: array();
180
  if ( ! empty( $tab_id ) ) {
223
  return array();
224
  }
225
  $collected_variations = array();
226
+ $variations = self::get_available_variations( $product );
227
+
228
  if ( ! empty( $variations ) ) {
229
  foreach ( $variations as $variation ) {
230
  $attribute_item_obj_slug = $variation['attributes'][ 'attribute_' . $attribute_tax_name ];
238
  return $collected_variations;
239
  }
240
 
241
+ /**
242
+ * Get an array of available variations for the current product.
243
+ *
244
+ * @param $product
245
+ *
246
+ * @return array[]|WC_Product_Variation[]
247
+ */
248
+ public static function get_available_variations( $product ) {
249
+ if ( ! $product instanceof WC_Product_Variable ) {
250
+ return array();
251
+ }
252
+ $variation_ids = $product->get_children();
253
+ if ( empty( $variation_ids ) ) {
254
+ return array();
255
+ }
256
+ $available_variations = array();
257
+
258
+ if ( is_callable( '_prime_post_caches' ) ) {
259
+ _prime_post_caches( $variation_ids );
260
+ }
261
+
262
+ foreach ( $variation_ids as $variation_id ) {
263
+
264
+ $variation = wc_get_product( $variation_id );
265
+
266
+ // Hide out of stock variations if 'Hide out of stock items from the catalog' is checked.
267
+ if ( ! $variation || ! $variation->exists() ) {
268
+ continue;
269
+ }
270
+
271
+ // Filter 'woocommerce_hide_invisible_variations' to optionally hide invisible variations (disabled variations and variations with empty price).
272
+ if ( apply_filters( 'woocommerce_hide_invisible_variations', true, $product->get_id(),
273
+ $variation ) && ! $variation->variation_is_visible() ) {
274
+ continue;
275
+ }
276
+
277
+ $available_variations[] = array(
278
+ 'attributes' => $variation->get_variation_attributes(),
279
+ 'variation_id' => $variation_id
280
+ );
281
+ }
282
+
283
+ return array_values( array_filter( $available_variations ) );
284
+ }
285
+
286
  /**
287
  * Detect if we have the Woosuite Core plugin activated
288
  *
readme.txt CHANGED
@@ -2,10 +2,10 @@
2
  Contributors: variationswatches, themealien, zgani, mehbubrashid, minhnguyen25
3
  Tags: variation swatches, woocommerce, product attribute, product color, product size, variable products
4
  Requires at least: 4.5
5
- Tested up to: 5.8
6
- Stable tag: 2.1.1
7
  WC requires at least: 3.2.0
8
- WC tested up to: 5.6.0
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -103,6 +103,16 @@ Yes, it will work with any theme, but may require some styling to make it match
103
  7. Add new attribute color when edit a product
104
 
105
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
106
  = 2.1.1 =
107
  * Fix issue for color enable switch toggle
108
  * Update JS AJAX to update the plugin setting even no attribute is selected
2
  Contributors: variationswatches, themealien, zgani, mehbubrashid, minhnguyen25
3
  Tags: variation swatches, woocommerce, product attribute, product color, product size, variable products
4
  Requires at least: 4.5
5
+ Tested up to: 5.8.2
6
+ Stable tag: 2.1.2
7
  WC requires at least: 3.2.0
8
+ WC tested up to: 5.9.0
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
103
  7. Add new attribute color when edit a product
104
 
105
  == Changelog ==
106
+ = 2.1.2 =
107
+ * Remove inline styles when disable plugin styling is active
108
+ * Remove unnecessary data when getting the product variation
109
+ * Fix the configure link position
110
+ * Update swatch position on mobile
111
+ * Revert the background color swatch
112
+ * Get the out of stock variation image
113
+ * Fix security issues
114
+ * Fix ajax loaded product swatches
115
+
116
  = 2.1.1 =
117
  * Fix issue for color enable switch toggle
118
  * Update JS AJAX to update the plugin setting even no attribute is selected
templates/admin/partials/panel-footer.php CHANGED
@@ -40,10 +40,10 @@
40
  <div class="thd-title">
41
  <?php _e( 'Do you need a custom plugin or edit to your site?', 'wcvs' ); ?></div>
42
 
43
- <div class="thd-description"><?php _e( 'We have created top-class plugins for WooCommerce powering over 80,000 online stores, we can customize our plugins or create you something custom.', 'wcvs' ); ?></div>
44
 
45
  <div class="thd-button-wrap">
46
- <a href="https://woosuite.com/services?utm_source=user-dashboard&utm_medium=link" class="thd-button button"
47
  target="_blank"><?php _e( 'Start a Project' ); ?></a>
48
  </div>
49
  </div>
40
  <div class="thd-title">
41
  <?php _e( 'Do you need a custom plugin or edit to your site?', 'wcvs' ); ?></div>
42
 
43
+ <div class="thd-description"><?php _e( 'Bring your project to life with the help of our trusted agency partners. They are equipped to handle both large and small customization jobs.', 'wcvs' ); ?></div>
44
 
45
  <div class="thd-button-wrap">
46
+ <a href="https://woosuite.com/developers/?utm_source=user-dashboard&utm_medium=link" class="thd-button button"
47
  target="_blank"><?php _e( 'Start a Project' ); ?></a>
48
  </div>
49
  </div>
templates/admin/setting-panel.php CHANGED
@@ -46,6 +46,7 @@
46
  <div class="variation-accordion-wrap woosuite-master-form">
47
  <form method="POST" action="" enctype="multipart/form-data">
48
  <input type="hidden" name="woosuite_saving_variation_settings" value="ok">
 
49
  <?php do_action( 'woosuite_variation_swatches_settings_fields_html' ); ?>
50
  </form>
51
  </div>
46
  <div class="variation-accordion-wrap woosuite-master-form">
47
  <form method="POST" action="" enctype="multipart/form-data">
48
  <input type="hidden" name="woosuite_saving_variation_settings" value="ok">
49
+ <input type="hidden" name="__nonce" value="<?php echo wp_create_nonce( 'tawcvs_admin_settings' ); ?>" />
50
  <?php do_action( 'woosuite_variation_swatches_settings_fields_html' ); ?>
51
  </form>
52
  </div>
templates/admin/welcome-popup.php CHANGED
@@ -6,10 +6,10 @@
6
  </div>
7
  <div class="popup-content">
8
  <div class="popup-inner-content">
9
- <p><strong>Congratulations on updating to v2.1.1!</strong></p>
10
  <p>We’ve been quiet on this end for several days as we’ve been hard at work making our plugin even better for you…</p>
11
  <p>Based on your feedback, we have added a bunch of new features and enhancements with a lot more to go.</p>
12
- <p><a href="https://woosuite.com/news/variation-swatches-v2-1-1-update/" target="_blank" rel="noopener noreferrer nofollow"> Click here to learn more. </a></p>
13
  <p>If you experience any issues, please get in touch with support so we can make it right: <a href="https://woosuite.com/support/" target="_blank" rel="noopener noreferrer nofollow">Support</a></p>
14
  </div>
15
  </div>
6
  </div>
7
  <div class="popup-content">
8
  <div class="popup-inner-content">
9
+ <p><strong>Congratulations on updating to v2.1.2!</strong></p>
10
  <p>We’ve been quiet on this end for several days as we’ve been hard at work making our plugin even better for you…</p>
11
  <p>Based on your feedback, we have added a bunch of new features and enhancements with a lot more to go.</p>
12
+ <p><a href="https://woosuite.com/news/variation-swatches-v2-1-2-update/" target="_blank" rel="noopener noreferrer nofollow"> Click here to learn more. </a></p>
13
  <p>If you experience any issues, please get in touch with support so we can make it right: <a href="https://woosuite.com/support/" target="_blank" rel="noopener noreferrer nofollow">Support</a></p>
14
  </div>
15
  </div>
variation-swatches-for-woocommerce.php CHANGED
@@ -3,15 +3,15 @@
3
  * Plugin Name: Variation Swatches for WooCommerce
4
  * Plugin URI: https://woosuite.com/plugins/woocommerce-variation-swatches/
5
  * Description: Creates variation swatches for WooCommerce, converts your variation dropdown into color, label, or photo swatches with ease, The original Variation Swatches for WooCommerce.
6
- * Version: 2.1.1
7
  * Author: Woosuite
8
  * Author URI: https://woosuite.com/
9
  * Requires at least: 4.5
10
- * Tested up to: 5.8.1
11
  * Text Domain: wcvs
12
  * Domain Path: /languages
13
  * WC requires at least: 3.0.0
14
- * WC tested up to: 5.7.1
15
  *
16
  * License: GPLv2 or later
17
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -27,7 +27,7 @@ if ( ! defined( 'TAWC_VS_PLUGIN_FILE' ) ) {
27
  }
28
 
29
  if ( ! defined( 'WCVS_PLUGIN_VERSION' ) ) {
30
- define( 'WCVS_PLUGIN_VERSION', '2.1.1' );
31
  }
32
 
33
  if ( ! defined( 'WCVS_PLUGIN_URL' ) ) {
3
  * Plugin Name: Variation Swatches for WooCommerce
4
  * Plugin URI: https://woosuite.com/plugins/woocommerce-variation-swatches/
5
  * Description: Creates variation swatches for WooCommerce, converts your variation dropdown into color, label, or photo swatches with ease, The original Variation Swatches for WooCommerce.
6
+ * Version: 2.1.2
7
  * Author: Woosuite
8
  * Author URI: https://woosuite.com/
9
  * Requires at least: 4.5
10
+ * Tested up to: 5.8.2
11
  * Text Domain: wcvs
12
  * Domain Path: /languages
13
  * WC requires at least: 3.0.0
14
+ * WC tested up to: 5.9.0
15
  *
16
  * License: GPLv2 or later
17
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
27
  }
28
 
29
  if ( ! defined( 'WCVS_PLUGIN_VERSION' ) ) {
30
+ define( 'WCVS_PLUGIN_VERSION', '2.1.2' );
31
  }
32
 
33
  if ( ! defined( 'WCVS_PLUGIN_URL' ) ) {