Plugin Directory

Changeset 2480965


Ignore:
Timestamp:
02/24/2021 08:00:58 PM (5 years ago)
Author:
scottopolis
Message:

v0.5.0

Location:
woo-add-gtin
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • woo-add-gtin/trunk/includes/class-woo-gtin-functions.php

    r1937074 r2480965  
    5757            add_action( 'woocommerce_product_meta_end', array( $this, 'maybe_display_tn' ) );
    5858
     59            add_filter( 'woocommerce_structured_data_product', array( $this, 'add_gtin_to_structured_data' ), 10, 2 );
     60
    5961        }
    6062
     
    209211        }
    210212
     213        function add_gtin_to_structured_data( $markup ) {
     214   
     215            global $product;
     216            $product_id = $product->get_id();
     217            $gtin = get_post_meta( $product_id, 'hwp_product_gtin', 1 );
     218            $markup['gtin'] = trim($gtin);
     219            return $markup;
     220       
     221        }
     222
    211223    }
    212224
  • woo-add-gtin/trunk/readme.txt

    r2101229 r2480965  
    44Tags: woocommerce, upc, ean, gtin, isbn
    55Requires at least: 4.5
    6 Tested up to: 5.2.1
    7 Stable tag: 0.4.0
     6Tested up to: 5.6.2
     7Stable tag: 0.5.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3030* Option to display GTIN on the single product page
    3131* Change GTIN to any other text
     32* Add GTIN to structured product data
     33* Works with product feeds like Google Shopping and more (requires a feed plugin)
    3234
    3335== Installation ==
     
    4042
    4143== Changelog ==
     44
     45= 0.5.0 =
     46
     47* Add structured data
     48* Test with newest versions of WordPress and WooCommerce
    4249
    4350= 0.4.0 =
  • woo-add-gtin/trunk/woocommerce-gtin.php

    r1937074 r2480965  
    44 * Plugin URI:      http://hollerwp.com
    55 * Description:     Add GTIN including UPC, EAN, and ISBN code fields to your WooCommerce product pages and checkout.
    6  * Version:         0.4.0
     6 * Version:         0.5.0
    77 * Author:          Scott Bolinger
    88 * Text Domain:     woo-add-gtin
    9  * WC requires at least: 3.0
    10  * WC tested up to: 3.4.5
     9 * WC requires at least: 4.0
     10 * WC tested up to: 5.0.0
    1111 *
    1212 * @author          Scott Bolinger
     
    6464        private function setup_constants() {
    6565            // Plugin version
    66             define( 'Woo_GTIN_VER', '0.4.0' );
     66            define( 'Woo_GTIN_VER', '0.5.0' );
    6767
    6868            // Plugin path
Note: See TracChangeset for help on using the changeset viewer.