Changeset 2842699
- Timestamp:
- 01/03/2023 08:38:12 AM (3 years ago)
- Location:
- appmaker-woocommerce-mobile-app-manager/trunk
- Files:
-
- 2 added
- 13 edited
-
lib/abstracts/abstract-appmaker-wc-rest-controller.php (modified) (1 diff)
-
lib/class-appmaker-wc-general-helper.php (modified) (1 diff)
-
lib/class-appmaker-wc-general-hooks.php (modified) (2 diffs)
-
lib/endpoints/wc/class-appmaker-wc-rest-cart-controller.php (modified) (1 diff)
-
lib/endpoints/wc/class-appmaker-wc-rest-orders-controller.php (modified) (2 diffs)
-
lib/endpoints/wc/class-appmaker-wc-rest-products-controller.php (modified) (7 diffs)
-
lib/endpoints/wc/class-appmaker-wc-rest-user-controller.php (modified) (3 diffs)
-
lib/third-party-support/class-appmaker-wc-third-party-support.php (modified) (1 diff)
-
lib/third-party-support/misc/class-appmaker-wc-advanced-woo-search.php (modified) (1 diff)
-
lib/third-party-support/misc/class-appmaker-wc-dokan.php (modified) (4 diffs)
-
lib/third-party-support/misc/class-appmaker-wc-photo-reviews.php (added)
-
lib/third-party-support/misc/class-appmaker-wc-woo-discount-rules.php (added)
-
lib/third-party-support/points-and-rewards/class-appmaker-wc-sumo-points-rewards.php (modified) (1 diff)
-
plugin.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
appmaker-woocommerce-mobile-app-manager/trunk/lib/abstracts/abstract-appmaker-wc-rest-controller.php
r2762683 r2842699 94 94 if (substr($url, 0, 2) === '//' ) { 95 95 $url = 'https:' . $url; 96 } 96 } 97 97 return $url; 98 98 } -
appmaker-woocommerce-mobile-app-manager/trunk/lib/class-appmaker-wc-general-helper.php
r2454757 r2842699 37 37 $Android = stripos($_SERVER['HTTP_USER_AGENT'],"Android"); 38 38 // $webOS = stripos($_SERVER['HTTP_USER_AGENT'],"webOS"); 39 39 40 if( preg_match("/^okhttp/i", $_SERVER['HTTP_USER_AGENT'] ) ) { 41 $Android = true; 42 } 40 43 41 44 if ( $iPhone ) { -
appmaker-woocommerce-mobile-app-manager/trunk/lib/class-appmaker-wc-general-hooks.php
r2647272 r2842699 22 22 add_action( 'wp_head', array( $this, 'appmaker_wc_hide_header_and_footer' ) ); 23 23 require_once( APPMAKER_WC::$root . '/lib/wc-extended/class-appmaker-login-in-webview.php' ); 24 if ( class_exists( 'WC_UepaPay' ) || function_exists('my_faw_plugin_path') || class_exists('Vcb_Mh_Admin') ) {24 if ( class_exists( 'WC_UepaPay' ) || function_exists('my_faw_plugin_path') || class_exists('Vcb_Mh_Admin') || function_exists('cashapp_fs') || function_exists( 'venmo_fs' ) ) { 25 25 add_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'override_order_receive_url'), 10, 2 ); 26 26 } … … 79 79 require_once( APPMAKER_WC::$root . '/lib/third-party-support/misc/class-appmaker-wc-translatepress.php' ); 80 80 } 81 } 81 82 if( ! empty ( $_POST['from_app'] ) || ! empty( $_GET['from_app'] ) || isset( $_COOKIE['from_app_cookie'] ) ) { 83 add_filter( 'comment_post_redirect', array( $this, 'comment_post_redirect' ), 99, 2 ); 84 } 85 86 } 87 88 public function comment_post_redirect( $location, $comment ) { 89 90 if( isset($_POST['_wp_http_referer'] ) ){ 91 $url = $_POST['_wp_http_referer']; 92 $location = $url . '#comment-' . $comment->comment_ID; 93 94 $location = add_query_arg( 95 array( 96 'unapproved' => $comment->comment_ID, 97 'moderation-hash' => wp_hash( $comment->comment_date_gmt ), 98 ), 99 $location 100 ); 101 } 102 103 104 if ( 'sent' === get_comment_meta( $comment->comment_ID, 'coupon_email', true ) ) { 105 $location = add_query_arg( array( 'wcpr_thank_you_message' => 1 ), $location ); 106 update_comment_meta( $comment->comment_ID, 'coupon_email', 'notified' ); 107 } else { 108 $location = add_query_arg( array( 'wcpr_thank_you_message' => 2 ), $location ); 109 } 110 111 return $location; 112 } 113 82 114 83 115 public function appmaker_new_customer_order_note( $args ) { -
appmaker-woocommerce-mobile-app-manager/trunk/lib/endpoints/wc/class-appmaker-wc-rest-cart-controller.php
r2744958 r2842699 589 589 $request['refresh_totals'] = true; 590 590 } 591 if ( ! isset( $request['quantity'] ) || empty( $request['quantity'] ) ) { 592 $request['quantity'] = 0; 593 } 591 594 if ( 0 == $request['quantity'] && method_exists( WC()->cart, 'remove_cart_item' ) ) { 592 595 WC()->cart->remove_cart_item( $request['key'] ); -
appmaker-woocommerce-mobile-app-manager/trunk/lib/endpoints/wc/class-appmaker-wc-rest-orders-controller.php
r2737852 r2842699 323 323 } 324 324 325 $line_item = array( 325 $price = ((get_option( 'woocommerce_prices_include_tax', 'no' )=='no') && (get_option( 'woocommerce_tax_display_shop','inc' )=='incl' ))?$order->get_item_total( $item, true):$order->get_item_total( $item, false, false ); 326 327 $line_item = array( 326 328 'id' => $item_id, 327 329 'name' => strip_tags( html_entity_decode($item['name'])), … … 332 334 'quantity' => wc_stock_amount( $item['qty'] ), 333 335 'tax_class' => ! empty( $item['tax_class'] ) ? $item['tax_class'] : '', 334 'price' => $ order->get_item_total( $item, false, false ),336 'price' => $price, 335 337 'subtotal' => $order->get_line_subtotal( $item, false, false ), 336 338 'subtotal_tax' => $item['line_subtotal_tax'], -
appmaker-woocommerce-mobile-app-manager/trunk/lib/endpoints/wc/class-appmaker-wc-rest-products-controller.php
r2762683 r2842699 581 581 $return = array( 'items' => array() ); 582 582 $prices = $this->get_filtered_price(); 583 584 if ( ! ( $prices->min_price == $prices->max_price || $prices->min_price > $prices->max_price || APPMAKER_WC::$api->get_settings( 'hide_price_from_filter', false )) ) { 583 $step = max( apply_filters( 'woocommerce_price_filter_widget_step', 10 ), 1 ); 584 $min_price = $prices->min_price; 585 $max_price = $prices->max_price; 586 587 $min_price = apply_filters( 'woocommerce_price_filter_widget_min_amount', floor( $min_price / $step ) * $step ); 588 $max_price = apply_filters( 'woocommerce_price_filter_widget_max_amount', ceil( $max_price / $step ) * $step ); 589 590 if ( ! ( $min_price == $max_price || $min_price > $max_price || APPMAKER_WC::$api->get_settings( 'hide_price_from_filter', false )) ) { 585 591 $return['items']['price_filter'] = array( 586 592 'type' => 'multi_slider', 587 593 'id' => 'price_filter', 588 594 'label' => __( 'Price', 'woocommerce' ), 589 'min' => ( double) $prices->min_price,590 'max' => (double) $ prices->max_price,591 'step' => ( ( $prices->max_price - $prices->min_price ) > 100 ) ? ( $prices->max_price - $prices->min_price ) / 100 : 1,595 'min' => ( $min_price < 0 ) ? 0 : (double) $min_price, 596 'max' => (double) $max_price, 597 'step' => $step, 592 598 ); 593 599 } … … 734 740 735 741 $args = $wp_the_query->query_vars; 742 if( empty($args) ) { 743 $args = WC()->query->get_main_query()->query_vars; 744 } 736 745 $tax_query = isset( $args['tax_query'] ) ? $args['tax_query'] : array(); 737 746 $meta_query = isset( $args['meta_query'] ) ? $args['meta_query'] : array(); … … 753 762 $meta_query = new WP_Meta_Query( $meta_query ); 754 763 $tax_query = new WP_Tax_Query( $tax_query ); 764 $search = WC_Query::get_main_search_query_sql(); 755 765 756 766 $meta_query_sql = $meta_query->get_sql( 'post', $wpdb->posts, 'ID' ); 757 767 $tax_query_sql = $tax_query->get_sql( $wpdb->posts, 'ID' ); 758 759 $sql = "SELECT min( CAST( price_meta.meta_value AS UNSIGNED ) ) as min_price, max( CAST( price_meta.meta_value AS UNSIGNED ) ) as max_price FROM {$wpdb->posts} "; 760 $sql .= " LEFT JOIN {$wpdb->postmeta} as price_meta ON {$wpdb->posts}.ID = price_meta.post_id " . $tax_query_sql['join'] . $meta_query_sql['join']; 761 $sql .= " WHERE {$wpdb->posts}.post_type = 'product' 762 AND {$wpdb->posts}.post_status = 'publish' 763 AND price_meta.meta_key IN ('" . implode( "','", array_map( 'esc_sql', apply_filters( 'woocommerce_price_filter_meta_keys', array( '_price' ) ) ) ) . "') 764 AND price_meta.meta_value > '' "; 765 $sql .= $tax_query_sql['where'] . $meta_query_sql['where']; 768 $search_query_sql = $search ? ' AND ' . $search : ''; 769 770 $sql = " 771 SELECT min( min_price ) as min_price, MAX( max_price ) as max_price 772 FROM {$wpdb->wc_product_meta_lookup} 773 WHERE product_id IN ( 774 SELECT ID FROM {$wpdb->posts} 775 " . $tax_query_sql['join'] . $meta_query_sql['join'] . " 776 WHERE {$wpdb->posts}.post_type IN ('" . implode( "','", array_map( 'esc_sql', apply_filters( 'woocommerce_price_filter_post_type', array( 'product' ) ) ) ) . "') 777 AND {$wpdb->posts}.post_status = 'publish' 778 " . $tax_query_sql['where'] . $meta_query_sql['where'] . $search_query_sql . ' 779 )'; 780 781 $sql = apply_filters( 'woocommerce_price_filter_sql', $sql, $meta_query_sql, $tax_query_sql ); 766 782 767 783 return $wpdb->get_row( $sql ); … … 1831 1847 1832 1848 public function get_content( $request ) { 1833 1834 global $product,$post,$wp_query; 1849 1850 global $product,$post,$wp_query,$withcomments; 1851 $withcomments = 1; 1852 1835 1853 if ( method_exists( 'WPBMap', 'addAllMappedShortcodes' ) ) { 1836 1854 WPBMap::addAllMappedShortcodes(); … … 1866 1884 } 1867 1885 } 1868 $content = apply_filters('appmaker_product_widget_webview_content', $content );1886 $content = apply_filters('appmaker_product_widget_webview_content', $content, $tab_id ); 1869 1887 $custom_style = APPMAKER_WC_General_Helper::get_custom_html(); 1870 1888 $custom_head = base64_decode(APPMAKER_WC::$api->get_settings( 'custom_webview_header', $custom_style )); … … 1947 1965 //$name = str_repeat("*", strlen($name)-4) . substr($name, -4);// to show last 4 digits only 1948 1966 $name = substr($name, 0, -5) . "*****"; 1949 } 1967 } 1968 1969 $images = apply_filters( 'appmaker_review_images' , array() , $review, $product ); 1970 1971 $avatar = get_avatar_url( $review->comment_author_email ); 1972 if (substr($avatar, 0, 2) === '//' ) { 1973 $avatar = 'https:' . $avatar; 1974 } 1950 1975 $data[] = array( 1951 1976 'id' => (int) $review->comment_ID, … … 1954 1979 'rating' => wc_format_decimal( get_comment_meta( $review->comment_ID, 'rating', true ), 1 ), 1955 1980 'name' => $name, 1956 'avatar' => get_avatar_url( $review->comment_author_email ), 1981 'avatar' => $avatar, 1982 'images' => $images, 1957 1983 // 'verified' => wc_review_is_from_verified_owner( $review->comment_ID ) 1958 1984 ); -
appmaker-woocommerce-mobile-app-manager/trunk/lib/endpoints/wc/class-appmaker-wc-rest-user-controller.php
r2744958 r2842699 655 655 } 656 656 case 'orders': { 657 $url = wc_get_page_permalink( 'myaccount' ) . '/orders';657 $url = wc_get_page_permalink( 'myaccount' ).'orders'; 658 658 $url = apply_filters( 'woocommerce_get_order_url', $url ); 659 659 break; … … 699 699 exit; 700 700 } 701 701 702 $url = $this->ensure_absolute_link( $url ); 702 703 if( 'checkout' == $type_of_url && ! $disable_appmaker_checkout_webview && !$appmaker_multi_step_checkout) { … … 1087 1088 ), 1088 1089 ); 1089 if( APPMAKER_WC::$api->get_settings( 'remove_delete_account_menu', false ) == false ) { 1090 $platform = APPMAKER_WC_General_Helper::get_app_platform(); 1091 if( APPMAKER_WC::$api->get_settings( 'remove_delete_account_menu', false ) == false && $platform != 'android' ) { 1090 1092 $return['delete_account'] = array( 1091 1093 'title' => __( 'Delete Account', 'appmaker-woocommerce-mobile-app-manager' ), -
appmaker-woocommerce-mobile-app-manager/trunk/lib/third-party-support/class-appmaker-wc-third-party-support.php
r2744958 r2842699 504 504 } 505 505 506 // https://wordpress.org/plugins/woo-discount-rules/ 507 if ( class_exists( 'Wdr\App\Controllers\ManageDiscount' ) && ! class_exists('APPMAKER_WC_WDR') ) { 508 require 'misc/class-appmaker-wc-woo-discount-rules.php'; 509 } 510 511 //https://villatheme.com/extensions/woocommerce-photo-reviews/ 512 if ( class_exists( 'VI_WOOCOMMERCE_PHOTO_REVIEWS_Frontend_Shortcode' ) && ! class_exists('APPMAKER_WC_PHOTO_REVIEWS') ) { 513 require 'misc/class-appmaker-wc-photo-reviews.php'; 514 } 515 506 516 APPMAKER_WC_Gateway_Appmaker::init(); 507 517 } -
appmaker-woocommerce-mobile-app-manager/trunk/lib/third-party-support/misc/class-appmaker-wc-advanced-woo-search.php
r2222669 r2842699 32 32 $data = $search_result['products']; 33 33 foreach ($data as $post) { 34 $posts[] = $post['post_data']; 34 if( isset ( $post['post_data']->post_status ) && 'draft' !== $post['post_data']->post_status ) { 35 $posts[] = $post['post_data']; 36 } 35 37 } 36 38 -
appmaker-woocommerce-mobile-app-manager/trunk/lib/third-party-support/misc/class-appmaker-wc-dokan.php
r2720601 r2842699 83 83 84 84 if( class_exists('Dokan_Pro') ){ 85 if( ! empty( $_GET['rest_route'] ) && false == strpos($_SERVER['REQUEST_URI'], 'login_with_provider') ) {86 add_filter('appmaker_wc_registration_response',array($this,'dokan_registration_response'),2,1);87 }88 add_filter( 'appmaker_wc_login_after_register_required', '__return_false' );85 // if( ! empty( $_GET['rest_route'] ) && false == strpos($_SERVER['REQUEST_URI'], 'login_with_provider') ) { 86 // add_filter('appmaker_wc_registration_response',array($this,'dokan_registration_response'),2,1); 87 // } 88 //add_filter( 'appmaker_wc_login_after_register_required', '__return_false' ); 89 89 add_filter('appmaker_wc_cart_items', array($this, 'add_shipping_rate'), 10, 1); 90 90 } … … 174 174 if ( in_array( 'seller', (array) $user->roles ) ) { 175 175 $base_url = site_url(); 176 $url = $base_url . '/dashboard/orders/'; 176 $seller_dashboard = dokan_get_option( 'dashboard', 'dokan_pages' ); 177 if ( $seller_dashboard != -1 ) { 178 $url = get_permalink( $seller_dashboard ); 179 }else { 180 $url = $base_url . '/dashboard/orders/'; 181 } 182 177 183 $api_key = $this->options['api_key']; 178 184 $access_token = apply_filters('appmaker_wc_set_user_access_token', $user_id); … … 385 391 $response = array(); 386 392 $params = $request; 387 393 // $per_page = isset( $params['per_page'] ) ? $params['per_page'] : 24; 394 $count = 0; 388 395 $args = array( 389 'number' => (int) $ params['per_page'],390 'offset' => (int) ( $params['page'] - 1 ) * $p arams['per_page']396 'number' => (int) $count, 397 'offset' => (int) ( $params['page'] - 1 ) * $per_page, 391 398 ); 392 399 … … 400 407 } 401 408 402 if ( ! empty( $params['orderby'] ) ) {403 $args['orderby'] = sanitize_sql_orderby( $params['orderby'] );404 }405 406 if ( ! empty( $params['order'] ) ) {407 $args['order'] = sanitize_text_field( $params['order'] );408 }409 // if ( ! empty( $params['orderby'] ) ) { 410 // $args['orderby'] = sanitize_sql_orderby( $params['orderby'] ); 411 // } 412 413 // if ( ! empty( $params['order'] ) ) { 414 // $args['order'] = sanitize_text_field( $params['order'] ); 415 // } 409 416 410 417 if ( ! empty( $params['featured'] ) ) { -
appmaker-woocommerce-mobile-app-manager/trunk/lib/third-party-support/points-and-rewards/class-appmaker-wc-sumo-points-rewards.php
r2619875 r2842699 64 64 add_action('appmaker_wc_user_registered', array($this,'sumo_user_register') , 2 , 2); 65 65 add_filter('appmaker_wc_referral', array( $this,'get_sumo_referral_details') , 2, 2); 66 add_filter('appmaker_wc_product_data', array($this, 'rewards_on_product_list_page'), 3, 3 ); 66 67 } 68 69 public function rewards_on_product_list_page( $data, $product, $expanded ) { 70 71 72 $product_id = $product->get_id(); 73 $user_id = get_current_user_id(); 74 $earnmessage = ''; 75 if ( 'yes' == get_option( 'rs_product_purchase_activated' ) ) { 76 77 if( $product->is_type( 'variable' ) && 'yes' == get_option( 'rs_enable_display_earn_message_for_variation') ) { 78 79 $variation_ids = get_variation_id( $product_id ) ; 80 $varpointss = is_array( $variation_ids ) ? RSFunctionforSimpleProduct::rewardpoints_of_variation( $variation_ids[ 0 ] , $product_id ) : '' ; 81 82 if( $user_id && '1' == get_option( 'rs_show_hide_buy_points_message_for_variable_in_shop' ) && '' != $varpointss ) { 83 84 $earnmessage = str_replace( '[variationrewardpoints]' , round_off_type( $varpointss ) , get_option( 'rs_message_in_shop_page_for_variable' ) ) ; 85 $VarPointsValue = redeem_point_conversion( $varpointss , $user_id , 'price' ); 86 $earnmessage = str_replace( '[variationpointsvalue]' , wc_price( round_off_type_for_currency( $VarPointsValue ) ) , $earnmessage ) ; 87 88 } elseif ( !$user_id && '1' == get_option( 'rs_show_hide_buy_pont_message_for_variable_in_shop_guest' ) && '' != $varpointss ) { 89 $earnmessage = str_replace( '[variationrewardpoints]' , round_off_type( $varpointss ) , get_option( 'rs_message_in_shop_page_for_variable' ) ) ; 90 } 91 92 } elseif ( $product->is_type( 'simple' ) ) { 93 94 if ( $user_id && '1' == get_option( 'rs_show_hide_message_for_simple_in_shop' ) ) { 95 $earnmessage = do_shortcode( get_option( 'rs_message_in_shop_page_for_simple' ) ) ; 96 } elseif ( ! $user_id && '1' == get_option( 'rs_show_hide_message_for_simple_in_shop_guest' ) ) { 97 $earnmessage = do_shortcode( get_option( 'rs_message_in_shop_page_for_simple' ) ); 98 } 99 100 } 101 102 } 103 if( $earnmessage ) { 104 $labels[] = array('label' => $earnmessage ); 105 106 if( isset( $data['labels'] ) ) { 107 $data['labels'] = empty($data['labels']) ? $labels : array_merge( $data['labels'], $labels ); 108 } 109 110 } 111 112 return $data; 113 } 67 114 68 115 public function get_sumo_referral_details( $return, $request ) { -
appmaker-woocommerce-mobile-app-manager/trunk/plugin.php
r2762699 r2842699 6 6 * Plugin URI: https://appmaker.xyz 7 7 * Description: This Plugin is used to manage Android and iOS mobile app created for your WooCommerce store 8 * Version: 1.36. 98 * Version: 1.36.10 9 9 * Author: Appmaker 10 10 * Author URI: https://appmaker.xyz/woocommerce … … 12 12 * Domain Path: /i18n/languages/ 13 13 * WC requires at least: 2.6.0 14 * WC tested up to: 6.7.014 * WC tested up to: 7.2.2 15 15 */ 16 16 … … 32 32 * @var string 33 33 */ 34 static $version = '1.36. 9';34 static $version = '1.36.10'; 35 35 36 36 /** -
appmaker-woocommerce-mobile-app-manager/trunk/readme.txt
r2762699 r2842699 4 4 Tags: WooCommerce mobile app builder, WooCommerce to android app, convert WooCommerce to mobile app, WooCommerce app builder, WooCommerce to mobile app, WooCommerce app maker, Create WooCommerce app, Mobile app builder for WooCommerce 5 5 Requires at least: 4.5.0 6 Tested up to: 6. 07 Stable tag: 1.36. 96 Tested up to: 6.1.1 7 Stable tag: 1.36.10 8 8 Requires PHP: 5.2 9 9 This Plugin is used to manage Android and iOS mobile app created for your WooCommerce store … … 165 165 == Changelog == 166 166 167 = 1.36.10 = 168 169 Updated Date: 02/01/23 170 171 * order webview URL fixes 172 * Fixed issues with deletion of cart item and User Registeration 173 * WooCommerce Plugin: WOO discount rules by flycart plugin support added 174 * Reviews in webview fixes 175 * cash app and vinmo payment gateways bug fixes 176 * Removed delete account menu for android app 177 167 178 = 1.36.8 = 168 179
Note: See TracChangeset
for help on using the changeset viewer.