Changeset 3489092
- Timestamp:
- 03/23/2026 02:23:48 PM (10 days ago)
- Location:
- datafeedr-comparison-sets
- Files:
-
- 6 edited
- 1 copied
-
tags/0.9.81 (copied) (copied from datafeedr-comparison-sets/trunk)
-
tags/0.9.81/classes/class-dfrcs.php (modified) (11 diffs)
-
tags/0.9.81/datafeedr-comparison-sets.php (modified) (2 diffs)
-
tags/0.9.81/readme.txt (modified) (2 diffs)
-
trunk/classes/class-dfrcs.php (modified) (11 diffs)
-
trunk/datafeedr-comparison-sets.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
datafeedr-comparison-sets/tags/0.9.81/classes/class-dfrcs.php
r2986360 r3489092 100 100 * Also, if the display method is 'data', this will not create a compset. 101 101 * 102 * @since 0.9.0 103 * 102 104 * @return null This method does not return anything. 103 * @since 0.9.0104 *105 105 */ 106 106 public function create() { … … 183 183 * This also returns the value of display_data() if the display_method is 'data'. 184 184 * 185 * @since 0.9.0 186 * 185 187 * @return string $html Returns $html for display. 186 * @since 0.9.0187 *188 188 */ 189 189 public function display() { … … 704 704 * method returns true. 705 705 * 706 * @since 0.9.0 707 * 706 708 * @param string $id A unique Datafeedr product ID. 707 709 * 708 710 * @return boolean true if products are found, false if no query was run or no products were found. 709 * @since 0.9.0710 *711 711 */ 712 712 private function query_by_dfrps_product( $id ) { … … 755 755 * method returns true. 756 756 * 757 * @since 0.9.0 758 * 757 759 * @param string $id A unique Datafeedr product ID. 758 760 * 759 761 * @return boolean true if products are found, false if no query was run or no products were found. 760 * @since 0.9.0761 *762 762 */ 763 763 private function query_by_id( $id ) { … … 828 828 * method returns true to prevent any other queries being run. 829 829 * 830 * @since 0.9.0 831 * 830 832 * @param array $fields An array of fields to query the Amazon API on. Default: 'barcodes' and 'name'. 831 833 * 832 834 * @return boolean true if products are found, false if no query was run or no products were found. 833 * @since 0.9.0834 *835 835 */ 836 836 private function query_amazon() { … … 850 850 } 851 851 852 // Check if Amazon API keys exist and return if they do not. 853 if ( ! function_exists( 'dfrapi_get_amazon_keys' ) || ! $amazon = dfrapi_get_amazon_keys() ) { 854 $this->log( 'query_amazon/result', __( 'Halted. No Amazon Keys available.', DFRCS_DOMAIN ) ); 855 856 return; 852 if ( function_exists( 'dfrapi_get_amazon_api' ) ) { 853 $amazon_api = dfrapi_get_amazon_api(); 854 } else { 855 $amazon_api = 'paapi'; 856 } 857 858 if ( $amazon_api === 'capi' ) { 859 860 // Check if Amazon Creators API keys exist. 861 if ( ! dfrapi_capi_credentials_exist() ) { 862 $this->log( 'query_amazon/result', __( 'Halted. No Amazon Creators API keys exist.', DFRCS_DOMAIN ) ); 863 864 return; 865 } 866 867 } else { 868 // Check if Amazon API keys exist and return if they do not. 869 870 if ( ! function_exists( 'dfrapi_get_amazon_keys' ) || ! $amazon = dfrapi_get_amazon_keys() ) { 871 $this->log( 'query_amazon/result', __( 'Halted. No Amazon Keys available.', DFRCS_DOMAIN ) ); 872 873 return; 874 } 857 875 } 858 876 … … 911 929 } ); 912 930 913 $locale = ( isset( $this->source->filters['amazon_locale'] ) ) ? $this->source->filters['amazon_locale'] : $amazon['amazon_locale']; 914 $search = $api->amazonSearchRequest( $amazon['amazon_access_key_id'], $amazon['amazon_secret_access_key'], 915 $amazon['amazon_tracking_id'], $locale ); 916 917 918 $search->addParam( 'Keywords', $param ); 931 if ( $amazon_api === 'capi' ) { 932 933 $credentials = dfrapi_get_capi_credentials(); 934 $locale = ( isset( $this->source->filters['amazon_locale'] ) ) ? $this->source->filters['amazon_locale'] : $credentials['marketplace']; 935 936 $search = $api->amazonCreatorApiSearchRequest( strtoupper( $locale ) ); 937 938 $search->addParam( 'keywords', $param ); 939 940 } else { 941 942 $locale = ( isset( $this->source->filters['amazon_locale'] ) ) ? $this->source->filters['amazon_locale'] : $amazon['amazon_locale']; 943 944 $search = $api->amazonSearchRequest( 945 $amazon['amazon_access_key_id'], 946 $amazon['amazon_secret_access_key'], 947 $amazon['amazon_tracking_id'], 948 $locale 949 ); 950 951 $search->addParam( 'Keywords', $param ); 952 } 919 953 920 954 $this->log( 'query_amazon_by_' . $field . '/api_request/locale', $locale ); … … 923 957 // Add MinimumPrice filter. 924 958 if ( isset( $this->source->filters['finalprice_min'] ) ) { 925 $search->addParam( 'MinimumPrice', $this->source->filters['finalprice_min'] ); 926 $this->log( 'query_amazon_by_' . $field . '/api_request/finalprice_min', 927 $this->source->filters['finalprice_min'] ); 959 960 if ( $amazon_api === 'capi' ) { 961 $search->addParam( 'minPrice', dfrapi_price_to_int( $this->source->filters['finalprice_min'] ) ); 962 } else { 963 $search->addParam( 'MinimumPrice', $this->source->filters['finalprice_min'] ); 964 } 965 966 $this->log( 967 'query_amazon_by_' . $field . '/api_request/finalprice_min', 968 $this->source->filters['finalprice_min'] 969 ); 928 970 } 929 971 930 972 // Add MaximumPrice filter. 931 973 if ( isset( $this->source->filters['finalprice_max'] ) ) { 932 $search->addParam( 'MaximumPrice', $this->source->filters['finalprice_max'] ); 933 $this->log( 'query_amazon_by_' . $field . '/api_request/finalprice_max', 934 $this->source->filters['finalprice_max'] ); 974 975 if ( $amazon_api === 'capi' ) { 976 $search->addParam( 'maxPrice', dfrapi_price_to_int( $this->source->filters['finalprice_max'] ) ); 977 } else { 978 $search->addParam( 'MaximumPrice', $this->source->filters['finalprice_max'] ); 979 } 980 981 $this->log( 982 'query_amazon_by_' . $field . '/api_request/finalprice_max', 983 $this->source->filters['finalprice_max'] 984 ); 935 985 } 936 986 … … 991 1041 * method returns true. 992 1042 * 1043 * @since 0.9.0 1044 * 993 1045 * @param array $barcodes An array of unique codes like EAN, UPC, ISBN or ASIN values. 994 1046 * 995 1047 * @return boolean true if products are found, false if no query was run or no products were found. 996 * @since 0.9.0997 *998 1048 */ 999 1049 private function query_by_barcodes() { … … 1073 1123 * method returns true. 1074 1124 * 1125 * @since 0.9.0 1126 * 1075 1127 * @param array $model An array of possible model numbers. 1076 1128 * 1077 1129 * @return boolean true if products are found, false if no query was run or no products were found. 1078 * @since 0.9.01079 *1080 1130 */ 1081 1131 private function query_by_model() { … … 1397 1447 * Returns the 13 character EAN value from barcodes array. 1398 1448 * 1449 * @since 0.9.0 1450 * 1399 1451 * @param array $barcodes An array of unique codes such as EAN, UPC, ASIN and ISBN. 1400 1452 * 1401 1453 * @return string The first 13 character long code from $barcodes. 1402 * @since 0.9.01403 *1404 1454 */ 1405 1455 private function get_ean13( $barcodes ) { -
datafeedr-comparison-sets/tags/0.9.81/datafeedr-comparison-sets.php
r3113239 r3489092 10 10 Requires PHP: 7.4 11 11 Requires at least: 3.8 12 Tested up to: 6.6-RC213 Version: 0.9. 7112 Tested up to: 7.0-beta 13 Version: 0.9.81 14 14 15 15 WC requires at least: 3.0 16 WC tested up to: 9.016 WC tested up to: 10.0 17 17 18 18 Datafeedr Comparison Sets Plugin 19 Copyright (C) 202 4, Datafeedr - help@datafeedr.com19 Copyright (C) 2026, Datafeedr - help@datafeedr.com 20 20 21 21 This program is free software: you can redistribute it and/or modify … … 43 43 * Define constants. 44 44 */ 45 define( 'DFRCS_VERSION', '0.9. 71' );45 define( 'DFRCS_VERSION', '0.9.81' ); 46 46 define( 'DFRCS_DB_VERSION', '0.9.0' ); 47 47 define( 'DFRCS_URL', plugin_dir_url( __FILE__ ) ); -
datafeedr-comparison-sets/tags/0.9.81/readme.txt
r3113239 r3489092 8 8 Requires PHP: 7.4 9 9 Requires at least: 3.8 10 Tested up to: 6.6-RC211 Stable tag: 0.9. 7110 Tested up to: 7.0-beta 11 Stable tag: 0.9.81 12 12 13 13 Automatically create price comparison sets for your WooCommerce products or by using a shortcode. … … 205 205 206 206 == Changelog == 207 208 = 0.9.81 - 2026/03/23 = 209 * Added support for Amazon's Creators API program. 207 210 208 211 = 0.9.71 - 2024/07/05 = -
datafeedr-comparison-sets/trunk/classes/class-dfrcs.php
r2986360 r3489092 100 100 * Also, if the display method is 'data', this will not create a compset. 101 101 * 102 * @since 0.9.0 103 * 102 104 * @return null This method does not return anything. 103 * @since 0.9.0104 *105 105 */ 106 106 public function create() { … … 183 183 * This also returns the value of display_data() if the display_method is 'data'. 184 184 * 185 * @since 0.9.0 186 * 185 187 * @return string $html Returns $html for display. 186 * @since 0.9.0187 *188 188 */ 189 189 public function display() { … … 704 704 * method returns true. 705 705 * 706 * @since 0.9.0 707 * 706 708 * @param string $id A unique Datafeedr product ID. 707 709 * 708 710 * @return boolean true if products are found, false if no query was run or no products were found. 709 * @since 0.9.0710 *711 711 */ 712 712 private function query_by_dfrps_product( $id ) { … … 755 755 * method returns true. 756 756 * 757 * @since 0.9.0 758 * 757 759 * @param string $id A unique Datafeedr product ID. 758 760 * 759 761 * @return boolean true if products are found, false if no query was run or no products were found. 760 * @since 0.9.0761 *762 762 */ 763 763 private function query_by_id( $id ) { … … 828 828 * method returns true to prevent any other queries being run. 829 829 * 830 * @since 0.9.0 831 * 830 832 * @param array $fields An array of fields to query the Amazon API on. Default: 'barcodes' and 'name'. 831 833 * 832 834 * @return boolean true if products are found, false if no query was run or no products were found. 833 * @since 0.9.0834 *835 835 */ 836 836 private function query_amazon() { … … 850 850 } 851 851 852 // Check if Amazon API keys exist and return if they do not. 853 if ( ! function_exists( 'dfrapi_get_amazon_keys' ) || ! $amazon = dfrapi_get_amazon_keys() ) { 854 $this->log( 'query_amazon/result', __( 'Halted. No Amazon Keys available.', DFRCS_DOMAIN ) ); 855 856 return; 852 if ( function_exists( 'dfrapi_get_amazon_api' ) ) { 853 $amazon_api = dfrapi_get_amazon_api(); 854 } else { 855 $amazon_api = 'paapi'; 856 } 857 858 if ( $amazon_api === 'capi' ) { 859 860 // Check if Amazon Creators API keys exist. 861 if ( ! dfrapi_capi_credentials_exist() ) { 862 $this->log( 'query_amazon/result', __( 'Halted. No Amazon Creators API keys exist.', DFRCS_DOMAIN ) ); 863 864 return; 865 } 866 867 } else { 868 // Check if Amazon API keys exist and return if they do not. 869 870 if ( ! function_exists( 'dfrapi_get_amazon_keys' ) || ! $amazon = dfrapi_get_amazon_keys() ) { 871 $this->log( 'query_amazon/result', __( 'Halted. No Amazon Keys available.', DFRCS_DOMAIN ) ); 872 873 return; 874 } 857 875 } 858 876 … … 911 929 } ); 912 930 913 $locale = ( isset( $this->source->filters['amazon_locale'] ) ) ? $this->source->filters['amazon_locale'] : $amazon['amazon_locale']; 914 $search = $api->amazonSearchRequest( $amazon['amazon_access_key_id'], $amazon['amazon_secret_access_key'], 915 $amazon['amazon_tracking_id'], $locale ); 916 917 918 $search->addParam( 'Keywords', $param ); 931 if ( $amazon_api === 'capi' ) { 932 933 $credentials = dfrapi_get_capi_credentials(); 934 $locale = ( isset( $this->source->filters['amazon_locale'] ) ) ? $this->source->filters['amazon_locale'] : $credentials['marketplace']; 935 936 $search = $api->amazonCreatorApiSearchRequest( strtoupper( $locale ) ); 937 938 $search->addParam( 'keywords', $param ); 939 940 } else { 941 942 $locale = ( isset( $this->source->filters['amazon_locale'] ) ) ? $this->source->filters['amazon_locale'] : $amazon['amazon_locale']; 943 944 $search = $api->amazonSearchRequest( 945 $amazon['amazon_access_key_id'], 946 $amazon['amazon_secret_access_key'], 947 $amazon['amazon_tracking_id'], 948 $locale 949 ); 950 951 $search->addParam( 'Keywords', $param ); 952 } 919 953 920 954 $this->log( 'query_amazon_by_' . $field . '/api_request/locale', $locale ); … … 923 957 // Add MinimumPrice filter. 924 958 if ( isset( $this->source->filters['finalprice_min'] ) ) { 925 $search->addParam( 'MinimumPrice', $this->source->filters['finalprice_min'] ); 926 $this->log( 'query_amazon_by_' . $field . '/api_request/finalprice_min', 927 $this->source->filters['finalprice_min'] ); 959 960 if ( $amazon_api === 'capi' ) { 961 $search->addParam( 'minPrice', dfrapi_price_to_int( $this->source->filters['finalprice_min'] ) ); 962 } else { 963 $search->addParam( 'MinimumPrice', $this->source->filters['finalprice_min'] ); 964 } 965 966 $this->log( 967 'query_amazon_by_' . $field . '/api_request/finalprice_min', 968 $this->source->filters['finalprice_min'] 969 ); 928 970 } 929 971 930 972 // Add MaximumPrice filter. 931 973 if ( isset( $this->source->filters['finalprice_max'] ) ) { 932 $search->addParam( 'MaximumPrice', $this->source->filters['finalprice_max'] ); 933 $this->log( 'query_amazon_by_' . $field . '/api_request/finalprice_max', 934 $this->source->filters['finalprice_max'] ); 974 975 if ( $amazon_api === 'capi' ) { 976 $search->addParam( 'maxPrice', dfrapi_price_to_int( $this->source->filters['finalprice_max'] ) ); 977 } else { 978 $search->addParam( 'MaximumPrice', $this->source->filters['finalprice_max'] ); 979 } 980 981 $this->log( 982 'query_amazon_by_' . $field . '/api_request/finalprice_max', 983 $this->source->filters['finalprice_max'] 984 ); 935 985 } 936 986 … … 991 1041 * method returns true. 992 1042 * 1043 * @since 0.9.0 1044 * 993 1045 * @param array $barcodes An array of unique codes like EAN, UPC, ISBN or ASIN values. 994 1046 * 995 1047 * @return boolean true if products are found, false if no query was run or no products were found. 996 * @since 0.9.0997 *998 1048 */ 999 1049 private function query_by_barcodes() { … … 1073 1123 * method returns true. 1074 1124 * 1125 * @since 0.9.0 1126 * 1075 1127 * @param array $model An array of possible model numbers. 1076 1128 * 1077 1129 * @return boolean true if products are found, false if no query was run or no products were found. 1078 * @since 0.9.01079 *1080 1130 */ 1081 1131 private function query_by_model() { … … 1397 1447 * Returns the 13 character EAN value from barcodes array. 1398 1448 * 1449 * @since 0.9.0 1450 * 1399 1451 * @param array $barcodes An array of unique codes such as EAN, UPC, ASIN and ISBN. 1400 1452 * 1401 1453 * @return string The first 13 character long code from $barcodes. 1402 * @since 0.9.01403 *1404 1454 */ 1405 1455 private function get_ean13( $barcodes ) { -
datafeedr-comparison-sets/trunk/datafeedr-comparison-sets.php
r3113239 r3489092 10 10 Requires PHP: 7.4 11 11 Requires at least: 3.8 12 Tested up to: 6.6-RC213 Version: 0.9. 7112 Tested up to: 7.0-beta 13 Version: 0.9.81 14 14 15 15 WC requires at least: 3.0 16 WC tested up to: 9.016 WC tested up to: 10.0 17 17 18 18 Datafeedr Comparison Sets Plugin 19 Copyright (C) 202 4, Datafeedr - help@datafeedr.com19 Copyright (C) 2026, Datafeedr - help@datafeedr.com 20 20 21 21 This program is free software: you can redistribute it and/or modify … … 43 43 * Define constants. 44 44 */ 45 define( 'DFRCS_VERSION', '0.9. 71' );45 define( 'DFRCS_VERSION', '0.9.81' ); 46 46 define( 'DFRCS_DB_VERSION', '0.9.0' ); 47 47 define( 'DFRCS_URL', plugin_dir_url( __FILE__ ) ); -
datafeedr-comparison-sets/trunk/readme.txt
r3113239 r3489092 8 8 Requires PHP: 7.4 9 9 Requires at least: 3.8 10 Tested up to: 6.6-RC211 Stable tag: 0.9. 7110 Tested up to: 7.0-beta 11 Stable tag: 0.9.81 12 12 13 13 Automatically create price comparison sets for your WooCommerce products or by using a shortcode. … … 205 205 206 206 == Changelog == 207 208 = 0.9.81 - 2026/03/23 = 209 * Added support for Amazon's Creators API program. 207 210 208 211 = 0.9.71 - 2024/07/05 =
Note: See TracChangeset
for help on using the changeset viewer.