Changeset 3148999
- Timestamp:
- 09/10/2024 06:09:58 AM (18 months ago)
- Location:
- bsecure
- Files:
-
- 59 added
- 3 edited
-
tags/1.7.9 (added)
-
tags/1.7.9/assets (added)
-
tags/1.7.9/assets/css (added)
-
tags/1.7.9/assets/css/bsecure-style-admin.css (added)
-
tags/1.7.9/assets/css/bsecure-style.css (added)
-
tags/1.7.9/assets/fonts (added)
-
tags/1.7.9/assets/fonts/fontsfree-net-sfprodisplay-regular-demo.html (added)
-
tags/1.7.9/assets/fonts/fontsfree-net-sfprodisplay-regular-webfont.woff (added)
-
tags/1.7.9/assets/fonts/fontsfree-net-sfprodisplay-regular-webfont.woff2 (added)
-
tags/1.7.9/assets/fonts/fontsfree-net-sfprotext-regular-demo.html (added)
-
tags/1.7.9/assets/fonts/fontsfree-net-sfprotext-regular-webfont.woff (added)
-
tags/1.7.9/assets/fonts/fontsfree-net-sfprotext-regular-webfont.woff2 (added)
-
tags/1.7.9/assets/fonts/generator_config.txt (added)
-
tags/1.7.9/assets/fonts/specimen_files (added)
-
tags/1.7.9/assets/fonts/specimen_files/grid_12-825-55-15.css (added)
-
tags/1.7.9/assets/fonts/specimen_files/specimen_stylesheet.css (added)
-
tags/1.7.9/assets/fonts/stylesheet.css (added)
-
tags/1.7.9/assets/images (added)
-
tags/1.7.9/assets/images/add-icon.png (added)
-
tags/1.7.9/assets/images/ajax-loader-large.gif (added)
-
tags/1.7.9/assets/images/ajax-loader.gif (added)
-
tags/1.7.9/assets/images/bsecure-checkout-img.svg (added)
-
tags/1.7.9/assets/images/bsecure-lock-img.png (added)
-
tags/1.7.9/assets/images/bsecure-logo.png (added)
-
tags/1.7.9/assets/images/bsecure-payment-gateway-icon-1.png (added)
-
tags/1.7.9/assets/images/bsecure-payment-gateway-icon.png (added)
-
tags/1.7.9/assets/images/bsecure-small-arrow.svg (added)
-
tags/1.7.9/assets/images/bsecure-small-line.svg (added)
-
tags/1.7.9/assets/images/bsecure-small-logo.png (added)
-
tags/1.7.9/assets/images/buy-with-bsecure-black.svg (added)
-
tags/1.7.9/assets/images/complete-checkout-img.png (added)
-
tags/1.7.9/assets/images/down-arrow.png (added)
-
tags/1.7.9/assets/images/edit-icon.png (added)
-
tags/1.7.9/assets/images/fast-checkout-btn.png (added)
-
tags/1.7.9/assets/images/login-with-bsecure.jpg (added)
-
tags/1.7.9/assets/images/pay-with-bsecure-black.svg (added)
-
tags/1.7.9/assets/images/popup-close.png (added)
-
tags/1.7.9/assets/images/qisst-pay-popup-bottom-logo.svg (added)
-
tags/1.7.9/assets/images/qisst-pay.png (added)
-
tags/1.7.9/assets/images/qpLogo-1.png (added)
-
tags/1.7.9/assets/images/qpLogo-2.png (added)
-
tags/1.7.9/assets/images/select-qisstpay-at-checkout.png (added)
-
tags/1.7.9/assets/js (added)
-
tags/1.7.9/assets/js/bsecure-admin.js (added)
-
tags/1.7.9/assets/js/bsecure-front.js (added)
-
tags/1.7.9/bsecure.php (added)
-
tags/1.7.9/includes (added)
-
tags/1.7.9/includes/class-bsecure-admin.php (added)
-
tags/1.7.9/includes/class-bsecure-apis.php (added)
-
tags/1.7.9/includes/class-bsecure-checkout.php (added)
-
tags/1.7.9/includes/class-sign-in-with-bsecure.php (added)
-
tags/1.7.9/includes/class-wc-bsecure.php (added)
-
tags/1.7.9/includes/class-wc-gateway-bsecure.php (added)
-
tags/1.7.9/includes/templates (added)
-
tags/1.7.9/includes/templates/checkout-reminder-popup.php (added)
-
tags/1.7.9/includes/templates/error-messages.php (added)
-
tags/1.7.9/includes/templates/mini-cart.php (added)
-
tags/1.7.9/includes/templates/qisstpay-popup.php (added)
-
tags/1.7.9/readme.txt (added)
-
trunk/bsecure.php (modified) (1 diff)
-
trunk/includes/class-bsecure-checkout.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bsecure/trunk/bsecure.php
r3016297 r3148999 21 21 * @since 1.0.0 22 22 */ 23 24 25 23 26 24 function wc_besecure_run() { -
bsecure/trunk/includes/class-bsecure-checkout.php
r3016297 r3148999 2835 2835 } 2836 2836 2837 2837 // dubug by sk old code 2838 2838 // Hook to the product api response build process and add variations objects. 2839 public function custom_product_api_response($response, $post, $request){ 2840 2839 // public function custom_product_api_response($response, $post, $request){ 2840 2841 // $params = $request->get_params(); 2842 // // check request is for bsecure portal or not 2843 // if(is_wp_error( $response ) || !isset($params['bsecure']) ) { 2844 2845 // return $response; 2846 // } 2847 2848 // WC()->api->includes(); 2849 // WC()->api->register_resources( new WC_API_Server( '/' ) ); 2850 2851 // $wc_webhook = new WC_Webhook(); 2852 // $variations_objs = []; 2853 2854 // $productKeys = ["id","name","short_description","slug","tags","sku","price","weight","categories","images","attributes","variations"]; 2855 // $variationKeys = ["id","title","price","sku","description","image","attributes","manage_stock","stock_quantity"]; 2856 // $new_response = []; 2857 2858 // // Filter product data as per provided keys 2859 // /*foreach($productKeys as $productKey){ 2860 // // Temprorary Commented from Asim 1.6.1 2861 // if(in_array($productKey, $response->data)){ 2862 // //$new_response[$productKey] = $response->data[$productKey]; 2863 // } 2864 2865 // }*/ 2866 2867 2868 2869 // // Store variation data in new variable 2870 // if(isset($response->data["type"])){ 2871 // if ( 'variable' === $response->data["type"] ) { 2872 // if(!empty($response->data["variations"])){ 2873 // foreach( $response->data["variations"] as $variation ) { 2874 2875 // $product_objs = WC()->api->WC_API_Products->get_product( $variation ); 2876 // $variations_objs[] = !empty($product_objs['product']) ? $product_objs['product'] : []; 2877 // } 2878 // } 2879 // } 2880 // } 2881 2882 // // Filter variation data as per provided keys 2883 // if(!empty($variations_objs)){ 2884 // $new_response["variations"] = []; 2885 // foreach($variations_objs as $key => $variations_obj){ 2886 2887 // foreach($variationKeys as $variationKey){ 2888 2889 // if(in_array($variationKey, $variations_obj)){ 2890 // //$new_response["variations"][$key][$variationKey] = $variations_obj[$variationKey]; 2891 // } 2892 // } 2893 // } 2894 // } 2895 // $response->data["variations"] = $variations_objs; 2896 // return $response; 2897 // } 2898 2899 2900 // new code by sk 2901 public function custom_product_api_response($response, $post, $request) { 2841 2902 $params = $request->get_params(); 2842 // check request is for bsecure portal or not 2843 if(is_wp_error( $response ) || !isset($params['bsecure']) ) { 2844 2903 // Check if request is for bsecure portal or not 2904 if (is_wp_error($response) || !isset($params['bsecure'])) { 2845 2905 return $response; 2846 2906 } 2847 2848 WC()->api->includes(); 2849 WC()->api->register_resources( new WC_API_Server( '/' ) ); 2850 2907 // Identify WooCommerce version 2908 $wc_version = WC()->version; 2909 2910 // Check and include relevant API classes based on WooCommerce version 2911 if (version_compare($wc_version, '3.6.0', '>=')) { 2912 // WooCommerce 3.6.0+ 2913 include_once WC_ABSPATH . 'includes/api/class-wc-rest-system-status-controller.php'; 2914 } else { 2915 // WooCommerce pre-3.6.0 2916 WC()->api->includes(); 2917 WC()->api->register_resources(new WC_API_Server('/')); 2918 } 2919 2851 2920 $wc_webhook = new WC_Webhook(); 2852 2921 $variations_objs = []; 2853 2922 2854 $productKeys = ["id","name","short_description","slug","tags","sku","price","weight","categories","images","attributes","variations"];2855 $variationKeys = ["id", "title","price","sku","description","image","attributes","manage_stock","stock_quantity"];2923 // $productKeys = ["id", "name", "short_description", "slug", "tags", "sku", "price", "weight", "categories", "images", "attributes", "variations"]; 2924 $variationKeys = ["id", "title", "price", "sku", "description", "image", "attributes", "manage_stock", "stock_quantity"]; 2856 2925 $new_response = []; 2857 2926 2858 2927 // Filter product data as per provided keys 2859 /*foreach($productKeys as $productKey){ 2860 // Temprorary Commented from Asim 1.6.1 2861 if(in_array($productKey, $response->data)){ 2862 //$new_response[$productKey] = $response->data[$productKey]; 2863 } 2864 2865 }*/ 2866 2867 2868 2869 // Store variation data in new variable 2870 if(isset($response->data["type"])){ 2871 if ( 'variable' === $response->data["type"] ) { 2872 if(!empty($response->data["variations"])){ 2873 foreach( $response->data["variations"] as $variation ) { 2874 2875 $product_objs = WC()->api->WC_API_Products->get_product( $variation ); 2876 $variations_objs[] = !empty($product_objs['product']) ? $product_objs['product'] : []; 2877 } 2878 } 2879 } 2880 } 2881 2882 // Filter variation data as per provided keys 2883 if(!empty($variations_objs)){ 2884 $new_response["variations"] = []; 2885 foreach($variations_objs as $key => $variations_obj){ 2886 2887 foreach($variationKeys as $variationKey){ 2888 2889 if(in_array($variationKey, $variations_obj)){ 2890 //$new_response["variations"][$key][$variationKey] = $variations_obj[$variationKey]; 2891 } 2928 // foreach($productKeys as $productKey){ 2929 // // Temprorary Commented from Asim 1.6.1 2930 // if(in_array($productKey, $response->data)){ 2931 // //$new_response[$productKey] = $response->data[$productKey]; 2932 // } 2933 2934 // } 2935 2936 // Store variation data in new variable 2937 if (isset($response->data["type"]) && 'variable' === $response->data["type"]) { 2938 // write_log('Product is of type variable.'); 2939 if (!empty($response->data["variations"])) { 2940 // write_log('Variations found: ' . print_r($response->data["variations"], true)); 2941 foreach ($response->data["variations"] as $variation) { 2942 // Get product variation using wc_get_product 2943 $product = wc_get_product($variation); 2944 if ($product) { 2945 $product_data = $product->get_data(); 2946 $variations_objs[] = $product_data; 2947 } else { 2948 // write_log('Failed to get product for variation ID: ' . $variation); 2892 2949 } 2893 } 2894 } 2895 $response->data["variations"] = $variations_objs; 2896 return $response; 2897 } 2950 } 2951 } else { 2952 // write_log('No variations found.'); 2953 } 2954 } else { 2955 // write_log('Product is not of type variable or type is not set.'); 2956 } 2957 2958 // Filter variation data as per provided keys 2959 if (!empty($variations_objs)) { 2960 $new_response["variations"] = []; 2961 foreach ($variations_objs as $key => $variations_obj) { 2962 foreach ($variationKeys as $variationKey) { 2963 if (array_key_exists($variationKey, $variations_obj)) { 2964 // $new_response["variations"][$key][$variationKey] = $variations_obj[$variationKey]; 2965 } 2966 } 2967 } 2968 } 2969 2970 $response->data["variations"] = $variations_objs; 2971 2972 // write_log('Final Response Data: ' . print_r($response->data, true)); 2973 2974 return $response; 2975 } 2976 2977 2978 // new code by sk 2898 2979 2899 2980 /** -
bsecure/trunk/readme.txt
r3016297 r3148999 5 5 Tested up to: 6.4 6 6 Requires PHP: 5.6.20 or above 7 Stable tag: 1.7. 87 Stable tag: 1.7.9 8 8 License: GNU General Public License v3.0 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 182 182 * 1.7.8 Released with General Update and Bug Fixes 183 183 184 = 1.7.9 September 09, 2024 = 185 * 1.7.9 Released with General Update and Bug Fixes 186 184 187 == Screenshots ==
Note: See TracChangeset
for help on using the changeset viewer.