Changeset 2371116
- Timestamp:
- 08/28/2020 02:47:54 PM (5 years ago)
- Location:
- shopping-feed/trunk
- Files:
-
- 4 edited
-
readme.txt (modified) (2 diffs)
-
shoppingfeed.php (modified) (2 diffs)
-
src/Feed/Generator.php (modified) (1 diff)
-
src/Products/Product.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shopping-feed/trunk/readme.txt
r2357009 r2371116 2 2 Contributors: ShoppingFeed, BeAPI 3 3 Tags: shoppingfeed, marketplace, woocommerce, woocommerce shoppingfeed, create woocommerce products shoppingfeed, products feed, generate shoppingfeed, amazon, Jet, Walmart, many marketplace, import orders 4 Stable tag: 6.0. 55 Version: 6.0. 54 Stable tag: 6.0.6 5 Version: 6.0.6 6 6 Requires PHP: 5.6 7 7 Requires at least: 5.2 … … 19 19 6.0.4: fix permalink issue 20 20 6.0.5: correct attribute values 21 6.0.6: add ean support for variations 21 22 22 23 == Description == -
shopping-feed/trunk/shoppingfeed.php
r2357009 r2371116 8 8 * Text Domain: shopping-feed 9 9 * Domain Path: /languages 10 * Version: 6.0. 510 * Version: 6.0.6 11 11 * Requires at least WP: 5.2 12 12 * Requires at least WooCommerce: 3.8 (3.9/4.0) … … 26 26 } 27 27 28 define( 'SF_VERSION', '6.0. 5' );28 define( 'SF_VERSION', '6.0.6' ); 29 29 define( 'SF_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 30 30 define( 'SF_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); -
shopping-feed/trunk/src/Feed/Generator.php
r2339808 r2371116 229 229 ->setReference( $sf_product_variation['sku'] ) 230 230 ->setPrice( $sf_product_variation['price'] ) 231 ->setQuantity( $sf_product_variation['quantity'] ); 231 ->setQuantity( $sf_product_variation['quantity'] ) 232 ->setGtin( $sf_product_variation['ean'] ); 232 233 233 234 if ( ! empty( $sf_product_variation['attributes'] ) ) { -
shopping-feed/trunk/src/Products/Product.php
r2357009 r2371116 96 96 * @return string 97 97 */ 98 public function get_ean() { 99 $ean_meta = ShoppingFeedHelper::wc_product_ean(); 100 101 if ( empty( $ean_meta ) ) { 102 return ''; 103 } 104 105 $ean = $this->product->get_meta( $ean_meta ) ? $this->product->get_meta( $ean_meta ) : ''; 106 107 return $ean; 98 public function get_ean( $wc_product = false ) { 99 $ean_meta_key = ShoppingFeedHelper::wc_product_ean(); 100 101 if ( empty( $ean_meta_key ) ) { 102 return ''; 103 } 104 105 if ( ! empty( $wc_product ) ) { 106 return $wc_product->get_meta( $ean_meta_key ) ? $wc_product->get_meta( $ean_meta_key ) : ''; 107 } 108 109 return $this->product->get_meta( $ean_meta_key ) ? $this->product->get_meta( $ean_meta_key ) : ''; 108 110 } 109 111 … … 309 311 $variations = array(); 310 312 foreach ( $wc_product_variations as $wc_product_variation ) { 311 $wc_product_variation = new \WC_Product_Variation( $wc_product_variation['variation_id'] );313 $wc_product_variation = new \WC_Product_Variation( $wc_product_variation['variation_id'] ); 312 314 $variation = array(); 313 315 $variation['sku'] = ( 'id' === $this->product_identifier ) ? $wc_product_variation->get_id() : $wc_product_variation->get_sku(); 316 $variation['ean'] = $this->get_ean( $wc_product_variation ); 314 317 $variation['quantity'] = ! is_null( $wc_product_variation->get_stock_quantity() ) ? $wc_product_variation->get_stock_quantity() : ShoppingFeedHelper::get_default_product_quantity(); 315 318 $variation['price'] = ! is_null( $wc_product_variation->get_regular_price() ) ? $wc_product_variation->get_regular_price() : $wc_product_variation->get_price();
Note: See TracChangeset
for help on using the changeset viewer.