Changeset 3247936
- Timestamp:
- 02/27/2025 02:41:34 PM (13 months ago)
- Location:
- facebook-for-woocommerce/trunk
- Files:
-
- 6 edited
-
changelog.txt (modified) (1 diff)
-
facebook-for-woocommerce.php (modified) (2 diffs)
-
i18n/languages/facebook-for-woocommerce.pot (modified) (2 diffs)
-
includes/fbproduct.php (modified) (7 diffs)
-
readme.txt (modified) (2 diffs)
-
vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
facebook-for-woocommerce/trunk/changelog.txt
r3243084 r3247936 1 1 *** Facebook for WooCommerce Changelog *** 2 3 = 3.4.1 - 2025-02-27 = 4 * Tweak - Removed custom field definitions by @devbodaghe in #2876 5 * Dev - Improved readability of function prepare_product() in fbproduct.php by @mshymon in #2889 6 * Dev - Enabled PHPUnit code coverage report generation by @carterbruce in #2893 2 7 3 8 = 3.4.0 - 2025-02-19 = -
facebook-for-woocommerce/trunk/facebook-for-woocommerce.php
r3243084 r3247936 12 12 * Author: Facebook 13 13 * Author URI: https://www.facebook.com/ 14 * Version: 3.4. 014 * Version: 3.4.1 15 15 * Requires at least: 5.6 16 16 * Requires PHP: 7.4 … … 50 50 * @var string the plugin version. This must be in the main plugin file to be automatically bumped by Woorelease. 51 51 */ 52 const PLUGIN_VERSION = '3.4. 0'; // WRCS: DEFINED_VERSION.52 const PLUGIN_VERSION = '3.4.1'; // WRCS: DEFINED_VERSION. 53 53 54 54 // Minimum PHP version required by this plugin. -
facebook-for-woocommerce/trunk/i18n/languages/facebook-for-woocommerce.pot
r3243084 r3247936 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Facebook for WooCommerce 3.4. 0\n"5 "Project-Id-Version: Facebook for WooCommerce 3.4.1\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/facebook-for-woocommerce\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-02- 19T08:42:54+00:00\n"12 "POT-Creation-Date: 2025-02-27T14:24:23+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.10.0\n" -
facebook-for-woocommerce/trunk/includes/fbproduct.php
r3243084 r3247936 810 810 $image_urls = $this->get_all_image_urls(); 811 811 812 $video_urls = $this->get_all_video_urls();813 814 812 // Replace WordPress sanitization's ampersand with a real ampersand. 815 813 $product_url = str_replace( … … 823 821 $id = $this->get_parent_id(); 824 822 } 825 $categories = 826 WC_Facebookcommerce_Utils::get_product_categories( $id ); 827 828 $custom_fields = $this->get_facebook_specific_fields(); 823 824 $categories = WC_Facebookcommerce_Utils::get_product_categories( $id ); 825 826 $product_data = array(); 827 $product_data[ 'description' ] = $this->get_fb_description(); 828 $product_data[ 'rich_text_description' ] = $this->get_rich_text_description(); 829 $product_data[ 'product_type' ] = $categories['categories']; 830 $product_data[ 'brand' ] = Helper::str_truncate( $this->get_fb_brand(), 100 ); 831 $product_data[ 'mpn' ] = Helper::str_truncate( $this->get_fb_mpn(), 100 ); 832 $product_data[ 'availability' ] = $this->is_in_stock() ? 'in stock' : 'out of stock'; 833 $product_data[ 'visibility' ] = Products::is_product_visible( $this->woo_product ) ? \WC_Facebookcommerce_Integration::FB_SHOP_PRODUCT_VISIBLE : \WC_Facebookcommerce_Integration::FB_SHOP_PRODUCT_HIDDEN; 834 $product_data[ 'retailer_id' ] = $retailer_id; 829 835 830 836 if ( self::PRODUCT_PREP_TYPE_ITEMS_BATCH === $type_to_prepare_for ) { 831 $product_data = array( 832 'title' => WC_Facebookcommerce_Utils::clean_string( $this->get_title() ), 833 'description' => $this->get_fb_description(), 834 'rich_text_description' => $this->get_rich_text_description(), 835 'image_link' => $image_urls[0], 836 'additional_image_link' => $this->get_additional_image_urls( $image_urls ), 837 'link' => $product_url, 838 'product_type' => $categories['categories'], 839 'brand' => Helper::str_truncate( $this->get_fb_brand(), 100 ), 840 'mpn' => Helper::str_truncate( $this->get_fb_mpn(), 100 ), 841 'retailer_id' => $retailer_id, 842 'price' => $this->get_fb_price( true ), 843 'availability' => $this->is_in_stock() ? 'in stock' : 'out of stock', 844 'visibility' => Products::is_product_visible( $this->woo_product ) ? \WC_Facebookcommerce_Integration::FB_SHOP_PRODUCT_VISIBLE : \WC_Facebookcommerce_Integration::FB_SHOP_PRODUCT_HIDDEN, 845 'custom_fields' => $custom_fields, 846 ); 847 $product_data = $this->add_sale_price( $product_data, true ); 848 if ( ! empty( $video_urls ) ) { 849 $product_data['video'] = $video_urls; 850 } 837 $product_data['title'] = WC_Facebookcommerce_Utils::clean_string( $this->get_title() ); 838 $product_data['image_link'] = $image_urls[0]; 839 $product_data['additional_image_link'] = $this->get_additional_image_urls( $image_urls ); 840 $product_data['link'] = $product_url; 841 $product_data['price'] = $this->get_fb_price( true ); 842 843 $product_data = $this->add_sale_price( $product_data, true ); 851 844 } else { 852 $product_data = array( 853 'name' => WC_Facebookcommerce_Utils::clean_string( $this->get_title() ), 854 'description' => $this->get_fb_description(), 855 'image_url' => $image_urls[0], 856 'additional_image_urls' => $this->get_additional_image_urls( $image_urls ), 857 'url' => $product_url, 858 'rich_text_description' => $this->get_rich_text_description(), 859 /** 860 * 'category' is a required field for creating a ProductItem object when posting to /{product_catalog_id}/products. 861 * This field should have the Google product category for the item. Google product category is not a required field 862 * in the WooCommerce product editor. Hence, we are setting 'category' to Woo product categories by default and overriding 863 * it when a Google product category is set. 864 * 865 * @see https://developers.facebook.com/docs/marketing-api/reference/product-catalog/products/#parameters-2 866 * @see https://github.com/woocommerce/facebook-for-woocommerce/pull/2575 867 * @see https://github.com/woocommerce/facebook-for-woocommerce/issues/2593 868 */ 869 'category' => $categories['categories'], 870 'product_type' => $categories['categories'], 871 'brand' => Helper::str_truncate( $this->get_fb_brand(), 100 ), 872 'mpn' => Helper::str_truncate( $this->get_fb_mpn(), 100 ), 873 'retailer_id' => $retailer_id, 874 'price' => $this->get_fb_price(), 875 'currency' => get_woocommerce_currency(), 876 'availability' => $this->is_in_stock() ? 'in stock' : 'out of stock', 877 'visibility' => Products::is_product_visible( $this->woo_product ) ? \WC_Facebookcommerce_Integration::FB_SHOP_PRODUCT_VISIBLE : \WC_Facebookcommerce_Integration::FB_SHOP_PRODUCT_HIDDEN, 878 'custom_fields' => $custom_fields 879 ); 880 881 if ( self::PRODUCT_PREP_TYPE_NORMAL !== $type_to_prepare_for && ! empty( $video_urls ) ) { 882 $product_data['video'] = $video_urls; 883 } 845 $product_data['name'] = WC_Facebookcommerce_Utils::clean_string( $this->get_title() ); 846 $product_data['image_url'] = $image_urls[0]; 847 $product_data['additional_image_urls'] = $this->get_additional_image_urls( $image_urls ); 848 $product_data['url'] = $product_url; 849 $product_data['price'] = $this->get_fb_price(); 850 $product_data['currency'] = get_woocommerce_currency(); 851 852 /** 853 * 'category' is a required field for creating a ProductItem object when posting to /{product_catalog_id}/products. 854 * This field should have the Google product category for the item. Google product category is not a required field 855 * in the WooCommerce product editor. Hence, we are setting 'category' to Woo product categories by default and overriding 856 * it when a Google product category is set. 857 * 858 * @see https://developers.facebook.com/docs/marketing-api/reference/product-catalog/products/#parameters-2 859 * @see https://github.com/woocommerce/facebook-for-woocommerce/pull/2575 860 * @see https://github.com/woocommerce/facebook-for-woocommerce/issues/2593 861 */ 862 $product_data['category'] = $categories['categories']; 863 884 864 $product_data = $this->add_sale_price( $product_data ); 885 865 }//end if 866 867 $video_urls = $this->get_all_video_urls(); 868 if ( ! empty( $video_urls ) && self::PRODUCT_PREP_TYPE_NORMAL !== $type_to_prepare_for ) { 869 $product_data['video'] = $video_urls; 870 } 886 871 887 872 $google_product_category = Products::get_google_product_category_id( $this->woo_product ); … … 891 876 892 877 // Currently only items batch and feed support enhanced catalog fields 893 if ( self::PRODUCT_PREP_TYPE_NORMAL !== $type_to_prepare_for && $google_product_category) {878 if ( $google_product_category && self::PRODUCT_PREP_TYPE_NORMAL !== $type_to_prepare_for ) { 894 879 $product_data = $this->apply_enhanced_catalog_fields_from_attributes( $product_data, $google_product_category ); 895 880 } … … 917 902 } 918 903 919 // I Fusing WPML, set the product to hidden unless it is in the904 // If using WPML, set the product to hidden unless it is in the 920 905 // default language. WPML >= 3.2 Supported. 921 906 if ( defined( 'ICL_LANGUAGE_CODE' ) ) { … … 925 910 } 926 911 927 // Exclude variations that are "virtual" products from export to Facebook &&928 // No Visibility Option for Variations929 // get_virtual() returns true for "unassembled bundles", so we exclude930 // bundles from this check.912 // Exclude variations that are "virtual" products from export to Facebook && 913 // No Visibility Option for Variations 914 // get_virtual() returns true for "unassembled bundles", so we exclude 915 // bundles from this check. 931 916 if ( true === $this->get_virtual() && 'bundle' !== $this->get_type() ) { 932 917 $product_data['visibility'] = \WC_Facebookcommerce_Integration::FB_SHOP_PRODUCT_HIDDEN; … … 943 928 944 929 /** 945 * Filters the generated product data.946 *947 * @param int $id Woocommerce product id948 * @param array $product_data An array of product data949 */930 * Filters the generated product data. 931 * 932 * @param int $id Woocommerce product id 933 * @param array $product_data An array of product data 934 */ 950 935 return apply_filters( 951 936 'facebook_for_woocommerce_integration_prepare_product', … … 1241 1226 } 1242 1227 1243 /**1244 * Returns information about which fields are using Facebook-specific values.1245 *1246 * @return array1247 */1248 private function get_facebook_specific_fields(): array {1249 return array(1250 'has_fb_description' => (bool) get_post_meta($this->id, self::FB_PRODUCT_DESCRIPTION, true),1251 'has_fb_price' => (bool) get_post_meta($this->id, self::FB_PRODUCT_PRICE, true),1252 'has_fb_image' => (bool) get_post_meta($this->id, self::FB_PRODUCT_IMAGE, true)1253 );1254 }1255 1256 1228 } -
facebook-for-woocommerce/trunk/readme.txt
r3243084 r3247936 40 40 41 41 == Changelog == 42 = 3.4.1 - 2025-02-27 = 43 * Tweak - Removed custom field definitions by @devbodaghe in #2876 44 * Dev - Improved readability of function prepare_product() in fbproduct.php by @mshymon in #2889 45 * Dev - Enabled PHPUnit code coverage report generation by @carterbruce in #2893 46 42 47 = 3.4.0 - 2025-02-19 = 43 48 * Add - FB product video field to add videos. Also added products sync to support the video field with Batch API by @gurtejrehal in #2874 … … 75 80 * Fix - Sync stock quantity when available by @mshymon in #2811 76 81 * Fix - Sync product GTIN when available by @mshymon in #2810 77 78 = 3.3.0 - 2024-11-07 =79 * Add - Extension navigation tabs on Product Sets screens.80 * Tweak - Tooltips, config labels, documentation links.81 * Tweak - WC 9.4 compatibility.82 * Tweak - WP 6.7 compatibility. -
facebook-for-woocommerce/trunk/vendor/composer/installed.php
r3243084 r3247936 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' 8bcab2089e5b5c5d1584c28bbab5617f8a7bf4ee',6 'reference' => '40d5fa6e6982ea496c9ae809d8ff0375a84b7d2a', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 23 23 'pretty_version' => 'dev-main', 24 24 'version' => 'dev-main', 25 'reference' => ' 8bcab2089e5b5c5d1584c28bbab5617f8a7bf4ee',25 'reference' => '40d5fa6e6982ea496c9ae809d8ff0375a84b7d2a', 26 26 'type' => 'wordpress-plugin', 27 27 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.