Plugin Directory

Changeset 2419463


Ignore:
Timestamp:
11/16/2020 03:35:18 PM (5 years ago)
Author:
kreamweb
Message:

version 1.1.1

Location:
product-gtin-ean-upc-isbn-for-woocommerce
Files:
18 added
5 edited

Legend:

Unmodified
Added
Removed
  • product-gtin-ean-upc-isbn-for-woocommerce/trunk/assets/js/product-gtin-wc-frontend.js

    r1922551 r2419463  
    22    'use strict';
    33
    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 = '';
    108
     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       
    1122    $.fn.wpm_gtin_variations = function() {
    1223
    1324        $form.on( 'found_variation', function( event, variation ){
     25
    1426            if ( variation.wpm_pgw_code ) {
    1527                $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  
    219219        if ( ! empty( $gtin ) || empty( $gtin ) && 'no' == $hide_empty || ( is_single() && $product->is_type( 'variable' ) ) ) {
    220220            $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() );
    222222            echo apply_filters( 'wpm_show_gtin_code', $code, $product, $atts );
    223223        }
  • product-gtin-ean-upc-isbn-for-woocommerce/trunk/product-gtin-ean-upc-isbn-for-woocommerce.php

    r2406268 r2419463  
    55 * Author URI: https://emanuelacastorina.com/
    66 * Description: Add a Global Trade Item Number (EAN, UPC, ISBN, JAN, ITF-14) field to WooCommerce
    7  * Version: 1.1.0
     7 * Version: 1.1.1
    88 * Author: Emanuela Castorina
    99 * Text Domain: product-gtin-ean-upc-isbn-for-woocommerce
     
    2222 */
    2323if (!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');
    2525}
    2626
  • product-gtin-ean-upc-isbn-for-woocommerce/trunk/readme.txt

    r2406268 r2419463  
    66Requires at least: 4.0.0
    77Requires PHP: 7.0
    8 Tested up to: 5.5
    9 Stable tag: 1.1.0
     8Tested up to: 5.6
     9Stable tag: 1.1.1
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    121121
    122122== 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
    123127= 1.1.0 - Released: 25 Oct, 2020 =
    124128*  New: Support for WordPress 5.5
Note: See TracChangeset for help on using the changeset viewer.