Changeset 2419463
- Timestamp:
- 11/16/2020 03:35:18 PM (5 years ago)
- Location:
- product-gtin-ean-upc-isbn-for-woocommerce
- Files:
-
- 18 added
- 5 edited
-
tags/1.1.1 (added)
-
tags/1.1.1/LICENSE.txt (added)
-
tags/1.1.1/assets (added)
-
tags/1.1.1/assets/js (added)
-
tags/1.1.1/assets/js/product-gtin-wc-frontend.js (added)
-
tags/1.1.1/assets/js/product-gtin-wc-frontend.min.js (added)
-
tags/1.1.1/includes (added)
-
tags/1.1.1/includes/admin (added)
-
tags/1.1.1/includes/admin/settings (added)
-
tags/1.1.1/includes/admin/settings/settings-wpm-product-gtin-wc.php (added)
-
tags/1.1.1/includes/class.product-gtin-wc-admin.php (added)
-
tags/1.1.1/includes/class.product-gtin-wc-frontend.php (added)
-
tags/1.1.1/includes/class.product-gtin-wc.php (added)
-
tags/1.1.1/index.php (added)
-
tags/1.1.1/languages (added)
-
tags/1.1.1/languages/product-gtin-ean-upc-isbn-for-woocommerce.pot (added)
-
tags/1.1.1/product-gtin-ean-upc-isbn-for-woocommerce.php (added)
-
tags/1.1.1/readme.txt (added)
-
trunk/assets/js/product-gtin-wc-frontend.js (modified) (1 diff)
-
trunk/assets/js/product-gtin-wc-frontend.min.js (modified) (1 diff)
-
trunk/includes/class.product-gtin-wc-frontend.php (modified) (1 diff)
-
trunk/product-gtin-ean-upc-isbn-for-woocommerce.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
product-gtin-ean-upc-isbn-for-woocommerce/trunk/assets/js/product-gtin-wc-frontend.js
r1922551 r2419463 2 2 'use strict'; 3 3 4 var $body = $('body'), 5 $form = $('.variations_form'), 6 $code = $form.closest('.summary').find('.wpm_pgw_code'), 7 $reset = $code.length > 0 ? $code.text() : '', 8 $hide = 'yes' == wpm_product_gtin.hide_is_empty ? true : false, 9 $parent_code = $code.parent(); 4 var $body = $("body"), 5 $form = $(".variations_form"), 6 $product_id = $form.data("product_id"), 7 $code = ''; 10 8 9 if (typeof $product_id !== "undefined") { 10 $code = $body.find( 11 ".wpm_pgw_code[data-product-id=" + $product_id + "]" 12 ); 13 } else { 14 $code = $form.closest(".summary").find(".wpm_pgw_code"); 15 } 16 17 18 var $reset = $code.length > 0 ? $code.text() : "", 19 $hide = "yes" == wpm_product_gtin.hide_is_empty ? true : false, 20 $parent_code = $code.parent(); 21 11 22 $.fn.wpm_gtin_variations = function() { 12 23 13 24 $form.on( 'found_variation', function( event, variation ){ 25 14 26 if ( variation.wpm_pgw_code ) { 15 27 $code.text( variation.wpm_pgw_code ); -
product-gtin-ean-upc-isbn-for-woocommerce/trunk/assets/js/product-gtin-wc-frontend.min.js
r1922551 r2419463 1 !function(t){"use strict";var n=t("body"),e=t(".variations_form"),o=e. closest(".summary").find(".wpm_pgw_code"),i=0<o.length?o.text():"",_="yes"==wpm_product_gtin.hide_is_empty,s=o.parent();t.fn.wpm_gtin_variations=function(){e.on("found_variation",function(t,n){n.wpm_pgw_code?(o.text(n.wpm_pgw_code),s.show()):o.wpm_reset_content()}),e.on("reset_data",function(){t.fn.wpm_reset_content()})},t.fn.wpm_reset_content=function(){i!==o.text()&&o.text(i),_&&""==i&&s.hide()},n.hasClass("single-product")&&(_&&""==i&&s.hide(),t.fn.wpm_gtin_variations())}(jQuery);1 !function(t){"use strict";var n=t("body"),e=t(".variations_form"),o=e.data("product_id"),i="",_=0<(i=void 0!==o?n.find(".wpm_pgw_code[data-product-id="+o+"]"):e.closest(".summary").find(".wpm_pgw_code")).length?i.text():"",d="yes"==wpm_product_gtin.hide_is_empty,p=i.parent();t.fn.wpm_gtin_variations=function(){e.on("found_variation",function(t,n){n.wpm_pgw_code?(i.text(n.wpm_pgw_code),p.show()):i.wpm_reset_content()}),e.on("reset_data",function(){t.fn.wpm_reset_content()})},t.fn.wpm_reset_content=function(){_!==i.text()&&i.text(_),d&&""==_&&p.hide()},n.hasClass("single-product")&&(d&&""==_&&p.hide(),t.fn.wpm_gtin_variations())}(jQuery); -
product-gtin-ean-upc-isbn-for-woocommerce/trunk/includes/class.product-gtin-wc-frontend.php
r2222256 r2419463 219 219 if ( ! empty( $gtin ) || empty( $gtin ) && 'no' == $hide_empty || ( is_single() && $product->is_type( 'variable' ) ) ) { 220 220 $gtin = ( empty( $gtin ) && 'no' == $hide_empty ) ? esc_html__( 'N/A', 'product-gtin-ean-upc-isbn-for-woocommerce' ) : $gtin; 221 $code = sprintf( '<%1$s class="%3$s">%2$s <%4$s class="%5$s wpm_pgw_code" >%6$s</%4$s></%1$s>', $atts['wrapper'], $atts['label'], esc_attr( $atts['class_wrapper'] ), $atts['wrapper_code'], esc_attr( $atts['class'] ), $gtin);221 $code = sprintf( '<%1$s class="%3$s">%2$s <%4$s class="%5$s wpm_pgw_code" data-product-id="%7$s">%6$s</%4$s></%1$s>', $atts['wrapper'], $atts['label'], esc_attr( $atts['class_wrapper'] ), $atts['wrapper_code'], esc_attr( $atts['class'] ), $gtin, $product->get_id() ); 222 222 echo apply_filters( 'wpm_show_gtin_code', $code, $product, $atts ); 223 223 } -
product-gtin-ean-upc-isbn-for-woocommerce/trunk/product-gtin-ean-upc-isbn-for-woocommerce.php
r2406268 r2419463 5 5 * Author URI: https://emanuelacastorina.com/ 6 6 * Description: Add a Global Trade Item Number (EAN, UPC, ISBN, JAN, ITF-14) field to WooCommerce 7 * Version: 1.1. 07 * Version: 1.1.1 8 8 * Author: Emanuela Castorina 9 9 * Text Domain: product-gtin-ean-upc-isbn-for-woocommerce … … 22 22 */ 23 23 if (!defined('WPM_PRODUCT_GTIN_WC_VERSION')) { 24 define('WPM_PRODUCT_GTIN_WC_VERSION', '1.1. 0');24 define('WPM_PRODUCT_GTIN_WC_VERSION', '1.1.1'); 25 25 } 26 26 -
product-gtin-ean-upc-isbn-for-woocommerce/trunk/readme.txt
r2406268 r2419463 6 6 Requires at least: 4.0.0 7 7 Requires PHP: 7.0 8 Tested up to: 5. 59 Stable tag: 1.1. 08 Tested up to: 5.6 9 Stable tag: 1.1.1 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 121 121 122 122 == Changelog == 123 = 1.1.1 - Released: 16 Nov, 2020 = 124 * New: Support for WordPress 5.6 125 * Dev: Added attribute product-id inside the wrapper of GTIN code to avoide some issue with Elementor Widget 126 123 127 = 1.1.0 - Released: 25 Oct, 2020 = 124 128 * New: Support for WordPress 5.5
Note: See TracChangeset
for help on using the changeset viewer.