Changeset 2291765
- Timestamp:
- 04/25/2020 09:22:43 PM (6 years ago)
- Location:
- product-gtin-ean-upc-isbn-for-woocommerce
- Files:
-
- 18 added
- 3 edited
-
tags/1.0.9 (added)
-
tags/1.0.9/LICENSE.txt (added)
-
tags/1.0.9/assets (added)
-
tags/1.0.9/assets/js (added)
-
tags/1.0.9/assets/js/product-gtin-wc-frontend.js (added)
-
tags/1.0.9/assets/js/product-gtin-wc-frontend.min.js (added)
-
tags/1.0.9/includes (added)
-
tags/1.0.9/includes/admin (added)
-
tags/1.0.9/includes/admin/settings (added)
-
tags/1.0.9/includes/admin/settings/settings-wpm-product-gtin-wc.php (added)
-
tags/1.0.9/includes/class.product-gtin-wc-admin.php (added)
-
tags/1.0.9/includes/class.product-gtin-wc-frontend.php (added)
-
tags/1.0.9/includes/class.product-gtin-wc.php (added)
-
tags/1.0.9/index.php (added)
-
tags/1.0.9/languages (added)
-
tags/1.0.9/languages/product-gtin-ean-upc-isbn-for-woocommerce.pot (added)
-
tags/1.0.9/product-gtin-ean-upc-isbn-for-woocommerce.php (added)
-
tags/1.0.9/readme.txt (added)
-
trunk/includes/class.product-gtin-wc.php (modified) (2 diffs)
-
trunk/product-gtin-ean-upc-isbn-for-woocommerce.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
product-gtin-ean-upc-isbn-for-woocommerce/trunk/includes/class.product-gtin-wc.php
r2222694 r2291765 133 133 134 134 //Structured data 135 add_filter( 'woocommerce_structured_data_product', array( $this,'wpm_structured_data_product') );135 add_filter( 'woocommerce_structured_data_product', array( $this,'wpm_structured_data_product'), 10, 2 ); 136 136 137 137 } … … 145 145 * @return mixed 146 146 */ 147 public function wpm_structured_data_product( $data ) { 148 global $product; 149 147 public function wpm_structured_data_product( $data, $product ) { 150 148 $property = apply_filters( 'wpm_structured_data_product_property', get_option( 'wpm_pgw_structured_data_field', 'gtin' ), $product ); 151 152 149 $data[ $property ] = $product->get_meta( '_wpm_gtin_code' ); 153 154 150 return $data; 155 151 } -
product-gtin-ean-upc-isbn-for-woocommerce/trunk/product-gtin-ean-upc-isbn-for-woocommerce.php
r2222694 r2291765 4 4 * Author URI: https://emanuelacastorina.com/ 5 5 * Description: Add a Global Trade Item Number (EAN, UPC, ISBN, JAN, ITF-14) field to WooCommerce 6 * Version: 1.0. 86 * Version: 1.0.9 7 7 * Author: Emanuela Castorina 8 8 * Text Domain: product-gtin-ean-upc-isbn-for-woocommerce 9 9 * Domain Path: /languages 10 * WC tested up to: 3.910 * WC tested up to: 4.1 11 11 * WC requires at least: 3.0 12 12 */ … … 21 21 */ 22 22 if ( ! defined( 'WPM_PRODUCT_GTIN_WC_VERSION' ) ) { 23 define( 'WPM_PRODUCT_GTIN_WC_VERSION', '1.0. 8' );23 define( 'WPM_PRODUCT_GTIN_WC_VERSION', '1.0.9' ); 24 24 } 25 25 -
product-gtin-ean-upc-isbn-for-woocommerce/trunk/readme.txt
r2222694 r2291765 66 66 If your product is variable, you can set a GTIN code for each variation; you can fill out the GTIN field that you'll find inside the variation detail panel. 67 67 68 = Where is stored the GTIN code ? = 69 The GTIN code is a private custom field of product with *meta_key* `_wpm_gtin_code` 70 If you have the product object you can get the GTIN code in this way: 71 72 `$gtin = $product->get_meta('_wpm_gtin_code');` 73 68 74 = How can use the shortcode to show the GTIN code where I want? = 69 75 The shortcode to show the GTIN code is `[wpm_product_gtin]` you can use these attributes: … … 80 86 "Override GTIN Code Label" 81 87 88 = How set GTIN code with WooCommerce REST API? = 89 When you create or update a product via REST API it is possible set or update the custom meta: 90 91 `"meta_data": [ 92 { 93 "key": "_wpm_gtin_code", 94 "value":"123798123987132" 95 } 96 ]` 82 97 83 98 == Screenshots == … … 99 114 100 115 == Changelog == 116 = 1.0.9 - Released: 25 April, 2020 = 117 * New: Support for WooCommerce 4.1 118 101 119 = 1.0.8 - Released: Jan 6, 2020 = 102 120 * Fix: Fixed the PHP warning
Note: See TracChangeset
for help on using the changeset viewer.