Plugin Directory

Changeset 2842699


Ignore:
Timestamp:
01/03/2023 08:38:12 AM (3 years ago)
Author:
appmaker
Message:

1.36.10 = 1.36.10 =

Updated Date: 02/01/23


  • order webview URL fixes
  • Fixed issues with deletion of cart item and User Registeration
  • WooCommerce Plugin: WOO discount rules by flycart plugin support added
  • Reviews in webview fixes
  • cash app and vinmo payment gateways bug fixes
  • Removed delete account menu for android app
Location:
appmaker-woocommerce-mobile-app-manager/trunk
Files:
2 added
13 edited

Legend:

Unmodified
Added
Removed
  • appmaker-woocommerce-mobile-app-manager/trunk/lib/abstracts/abstract-appmaker-wc-rest-controller.php

    r2762683 r2842699  
    9494        if (substr($url, 0, 2) === '//' ) {
    9595            $url = 'https:' . $url;
    96         }
     96        }         
    9797        return $url;
    9898    }
  • appmaker-woocommerce-mobile-app-manager/trunk/lib/class-appmaker-wc-general-helper.php

    r2454757 r2842699  
    3737            $Android = stripos($_SERVER['HTTP_USER_AGENT'],"Android");
    3838            // $webOS   = stripos($_SERVER['HTTP_USER_AGENT'],"webOS");
    39 
     39           
     40            if( preg_match("/^okhttp/i", $_SERVER['HTTP_USER_AGENT'] ) ) {
     41                $Android = true;
     42            }
    4043           
    4144            if ( $iPhone ) {
  • appmaker-woocommerce-mobile-app-manager/trunk/lib/class-appmaker-wc-general-hooks.php

    r2647272 r2842699  
    2222            add_action( 'wp_head', array( $this, 'appmaker_wc_hide_header_and_footer' ) );
    2323            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' ) ) {
    2525                add_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'override_order_receive_url'), 10, 2 );
    2626            }           
     
    7979            require_once( APPMAKER_WC::$root . '/lib/third-party-support/misc/class-appmaker-wc-translatepress.php' );
    8080        }
    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   
    82114
    83115    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  
    589589                $request['refresh_totals'] = true;
    590590            }
     591            if ( ! isset( $request['quantity'] ) || empty( $request['quantity'] ) ) {
     592                $request['quantity'] = 0;
     593            }
    591594            if ( 0 == $request['quantity'] && method_exists( WC()->cart, 'remove_cart_item' ) ) {
    592595                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  
    323323            }
    324324
    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(
    326328                'id'           => $item_id,
    327329                'name'         => strip_tags( html_entity_decode($item['name'])),
     
    332334                'quantity'     => wc_stock_amount( $item['qty'] ),
    333335                'tax_class'    => ! empty( $item['tax_class'] ) ? $item['tax_class'] : '',
    334                 'price'        => $order->get_item_total( $item, false, false ),
     336                'price'        => $price,
    335337                'subtotal'     => $order->get_line_subtotal( $item, false, false ),
    336338                'subtotal_tax' =>  $item['line_subtotal_tax'],
  • appmaker-woocommerce-mobile-app-manager/trunk/lib/endpoints/wc/class-appmaker-wc-rest-products-controller.php

    r2762683 r2842699  
    581581        $return = array( 'items' => array() );
    582582        $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 )) ) {
    585591            $return['items']['price_filter'] = array(
    586592                'type'  => 'multi_slider',
    587593                'id'    => 'price_filter',
    588594                '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,
    592598            );
    593599        }
     
    734740
    735741        $args       = $wp_the_query->query_vars;
     742        if( empty($args) ) {
     743            $args       = WC()->query->get_main_query()->query_vars;
     744        }
    736745        $tax_query  = isset( $args['tax_query'] ) ? $args['tax_query'] : array();
    737746        $meta_query = isset( $args['meta_query'] ) ? $args['meta_query'] : array();
     
    753762        $meta_query = new WP_Meta_Query( $meta_query );
    754763        $tax_query  = new WP_Tax_Query( $tax_query );
     764        $search     = WC_Query::get_main_search_query_sql();
    755765
    756766        $meta_query_sql = $meta_query->get_sql( 'post', $wpdb->posts, 'ID' );
    757767        $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 );
    766782
    767783        return $wpdb->get_row( $sql );
     
    18311847
    18321848    public function get_content( $request ) {
    1833 
    1834         global $product,$post,$wp_query;     
     1849       
     1850        global $product,$post,$wp_query,$withcomments;     
     1851        $withcomments = 1;
     1852       
    18351853        if ( method_exists( 'WPBMap', 'addAllMappedShortcodes' ) ) {
    18361854            WPBMap::addAllMappedShortcodes();
     
    18661884            }
    18671885        }
    1868         $content = apply_filters('appmaker_product_widget_webview_content', $content );
     1886        $content = apply_filters('appmaker_product_widget_webview_content', $content,  $tab_id );
    18691887        $custom_style = APPMAKER_WC_General_Helper::get_custom_html();
    18701888        $custom_head = base64_decode(APPMAKER_WC::$api->get_settings( 'custom_webview_header', $custom_style ));
     
    19471965                //$name = str_repeat("*", strlen($name)-4) . substr($name, -4);// to show last 4 digits only
    19481966                $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             }
    19501975            $data[] = array(
    19511976                'id'     => (int) $review->comment_ID,
     
    19541979                'rating' => wc_format_decimal( get_comment_meta( $review->comment_ID, 'rating', true ), 1 ),
    19551980                'name'   => $name,
    1956                 'avatar' => get_avatar_url( $review->comment_author_email ),
     1981                'avatar' => $avatar,
     1982                'images' => $images,
    19571983                //  'verified'     => wc_review_is_from_verified_owner( $review->comment_ID )
    19581984            );
  • appmaker-woocommerce-mobile-app-manager/trunk/lib/endpoints/wc/class-appmaker-wc-rest-user-controller.php

    r2744958 r2842699  
    655655            }
    656656            case 'orders': {
    657                 $url = wc_get_page_permalink( 'myaccount' ) . '/orders';
     657                $url = wc_get_page_permalink( 'myaccount' ).'orders';               
    658658                $url = apply_filters( 'woocommerce_get_order_url', $url );
    659659                break;
     
    699699            exit;
    700700        }
     701       
    701702        $url = $this->ensure_absolute_link( $url );
    702703        if( 'checkout' == $type_of_url && ! $disable_appmaker_checkout_webview && !$appmaker_multi_step_checkout) {
     
    10871088            ),
    10881089        );
    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' ) {
    10901092            $return['delete_account'] = array(
    10911093                '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  
    504504        }
    505505
     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
    506516        APPMAKER_WC_Gateway_Appmaker::init();
    507517    }
  • appmaker-woocommerce-mobile-app-manager/trunk/lib/third-party-support/misc/class-appmaker-wc-advanced-woo-search.php

    r2222669 r2842699  
    3232            $data = $search_result['products'];
    3333            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                }
    3537            }   
    3638
  • appmaker-woocommerce-mobile-app-manager/trunk/lib/third-party-support/misc/class-appmaker-wc-dokan.php

    r2720601 r2842699  
    8383       
    8484        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' );
    8989            add_filter('appmaker_wc_cart_items', array($this, 'add_shipping_rate'), 10, 1);
    9090        }
     
    174174        if ( in_array( 'seller', (array) $user->roles ) ) {
    175175            $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           
    177183            $api_key = $this->options['api_key'];
    178184            $access_token = apply_filters('appmaker_wc_set_user_access_token', $user_id);
     
    385391        $response     = array(); 
    386392        $params = $request;
    387 
     393       // $per_page = isset( $params['per_page'] ) ? $params['per_page'] : 24;
     394        $count =  0;
    388395        $args = array(
    389             'number' => (int) $params['per_page'],
    390             'offset' => (int) ( $params['page'] - 1 ) * $params['per_page']
     396            'number' => (int) $count,
     397            'offset' => (int) ( $params['page'] - 1 ) * $per_page,           
    391398        );
    392399
     
    400407        }
    401408
    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        // }
    409416
    410417        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  
    6464        add_action('appmaker_wc_user_registered', array($this,'sumo_user_register') , 2 , 2);
    6565        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 );
    6667    }
     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    }
    67114
    68115    public function get_sumo_referral_details( $return, $request ) {
  • appmaker-woocommerce-mobile-app-manager/trunk/plugin.php

    r2762699 r2842699  
    66 * Plugin URI: https://appmaker.xyz
    77 * Description: This Plugin is used to manage Android and iOS mobile app created for your WooCommerce store
    8  * Version: 1.36.9
     8 * Version: 1.36.10
    99 * Author: Appmaker
    1010 * Author URI: https://appmaker.xyz/woocommerce
     
    1212 * Domain Path: /i18n/languages/
    1313 * WC requires at least: 2.6.0
    14  * WC tested up to: 6.7.0
     14 * WC tested up to: 7.2.2
    1515 */
    1616
     
    3232     * @var string
    3333     */
    34     static $version = '1.36.9';
     34    static $version = '1.36.10';
    3535
    3636    /**
  • appmaker-woocommerce-mobile-app-manager/trunk/readme.txt

    r2762699 r2842699  
    44Tags: 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
    55Requires at least: 4.5.0
    6 Tested up to: 6.0
    7 Stable tag: 1.36.9
     6Tested up to: 6.1.1
     7Stable tag: 1.36.10
    88Requires PHP: 5.2
    99This Plugin is used to manage Android and iOS mobile app created for your WooCommerce store
     
    165165== Changelog ==
    166166
     167= 1.36.10 =
     168
     169Updated 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
    167178= 1.36.8 =
    168179
Note: See TracChangeset for help on using the changeset viewer.