Plugin Directory

Changeset 3132501


Ignore:
Timestamp:
08/08/2024 08:11:10 AM (20 months ago)
Author:
inspireui
Message:

version 4.15.2

Location:
mstore-api
Files:
487 added
27 edited

Legend:

Unmodified
Added
Removed
  • mstore-api/trunk/controllers/flutter-2c2p.php

    r2959633 r3132501  
    11<?php
    22require_once(__DIR__ . '/flutter-base.php');
     3
    34use Firebase\JWT\JWT;
    45use Firebase\JWT\Key;
     
    5758    {
    5859        if (!is_plugin_active('2c2p_woocommerce/2c2p.php')) {
    59             return parent::sendError("invalid_plugin", "You need to install 2C2P Redirect API for WooCommerce plugin to use this api", 404);
     60            return parent::send_invalid_plugin_error("You need to install 2C2P Redirect API for WooCommerce plugin to use this api");
    6061        }
    6162
     
    9394    {
    9495        if (!is_plugin_active('2c2p_woocommerce/2c2p.php')) {
    95             return parent::sendError("invalid_plugin", "You need to install 2C2P Redirect API for WooCommerce plugin to use this api", 404);
     96            return parent::send_invalid_plugin_error("You need to install 2C2P Redirect API for WooCommerce plugin to use this api");
    9697        }
    9798
  • mstore-api/trunk/controllers/flutter-b2bking.php

    r3115231 r3132501  
    107107    {
    108108        if (!class_exists('B2bking')) {
    109             return parent::sendError("invalid_plugin", "You need to install B2BKing Core plugin to use this api", 404);
     109            return parent::send_invalid_plugin_error("You need to install B2BKing Core plugin to use this api");
    110110        }
    111111
     
    136136    {
    137137        if (!class_exists('B2bking')) {
    138             return parent::sendError("invalid_plugin", "You need to install B2BKing Core plugin to use this api", 404);
     138            return parent::send_invalid_plugin_error("You need to install B2BKing Core plugin to use this api");
    139139        }
    140140
     
    195195       
    196196        if (!class_exists('B2bking')) {
    197             return parent::sendError("invalid_plugin", "You need to install B2BKing Core plugin to use this api", 404);
     197            return parent::send_invalid_plugin_error("You need to install B2BKing Core plugin to use this api");
    198198        }
    199199
     
    450450    {
    451451        if (!class_exists('B2bking')) {
    452             return parent::sendError("invalid_plugin", "You need to install B2BKing Core plugin to use this api", 404);
     452            return parent::send_invalid_plugin_error("You need to install B2BKing Core plugin to use this api");
    453453        }
    454454
  • mstore-api/trunk/controllers/flutter-base.php

    r2924554 r3132501  
    1717        return isPurchaseCodeVerified();
    1818    }
     19
     20    /**
     21     * Send invalid plugin error.
     22     *
     23     * @param string $message Error message.
     24     */
     25    public function send_invalid_plugin_error($message)
     26    {
     27        return $this->sendError("invalid_plugin", $message, 403);
     28    }
    1929}
  • mstore-api/trunk/controllers/flutter-booking.php

    r3106210 r3132501  
    6767        $params = json_decode($json, TRUE);
    6868        if (!is_plugin_active('woocommerce-appointments/woocommerce-appointments.php')) {
    69             return parent::sendError("invalid_plugin", "You need to install WooCommerce Appointments plugin to use this api", 404);
     69            return parent::send_invalid_plugin_error("You need to install WooCommerce Appointments plugin to use this api");
    7070        }
    7171
     
    236236    {
    237237        if (!is_plugin_active('woocommerce-appointments/woocommerce-appointments.php')) {
    238             return parent::sendError("invalid_plugin", "You need to install WooCommerce Appointments plugin to use this api", 404);
     238            return parent::send_invalid_plugin_error("You need to install WooCommerce Appointments plugin to use this api");
    239239        }
    240240
  • mstore-api/trunk/controllers/flutter-cc-avenue.php

    r2998624 r3132501  
    4444    {
    4545        if (!is_plugin_active('ccavanue-woocommerce-payment-getway/index.php')) {
    46             return parent::sendError("invalid_plugin", "You need to install CCAvenue Payment Gateway for WooCommerce plugin to use this api", 404);
     46            return parent::send_invalid_plugin_error("You need to install CCAvenue Payment Gateway for WooCommerce plugin to use this api");
    4747        }
    4848
     
    5454
    5555        $available_payment_methods = WC()->payment_gateways->payment_gateways();
    56         if(!isset($available_payment_methods['ccavenue'])){
    57             return parent::sendError("invalid_plugin", "You need to install CCAvenue Payment Gateway for WooCommerce plugin to use this api", 404);
     56        if (!isset($available_payment_methods['ccavenue'])) {
     57            return parent::send_invalid_plugin_error("You need to install CCAvenue Payment Gateway for WooCommerce plugin to use this api");
    5858        }
    5959       
  • mstore-api/trunk/controllers/flutter-composite-products.php

    r3048873 r3132501  
    5353    {
    5454        if (!class_exists('YITH_WCP')) {
    55             return parent::sendError("invalid_plugin", "You need to install YITH Composite Products for WooCommerce plugin to use this api", 404);
     55            return parent::send_invalid_plugin_error("You need to install YITH Composite Products for WooCommerce plugin to use this api");
    5656        }
    5757        $product_id = $request["id"];
  • mstore-api/trunk/controllers/flutter-expresspay.php

    r2943356 r3132501  
    5656
    5757        if (!is_plugin_active('woo-web-payment-getaway/web-payment-gateway.php')) {
    58             return parent::sendError("invalid_plugin", "You need to install ShahbandrPay plugin to use this api", 404);
     58            return parent::send_invalid_plugin_error("You need to install ShahbandrPay plugin to use this api");
    5959        }
    6060
     
    104104    {
    105105        if (!is_plugin_active('woo-web-payment-getaway/web-payment-gateway.php')) {
    106             return parent::sendError("invalid_plugin", "You need to install ShahbandrPay plugin to use this api", 404);
     106            return parent::send_invalid_plugin_error("You need to install ShahbandrPay plugin to use this api");
    107107        }
    108108
  • mstore-api/trunk/controllers/flutter-flow-flow.php

    r2976154 r3132501  
    4545    {
    4646        if (!is_plugin_active('flow-flow/flow-flow.php')) {
    47             return parent::sendError("invalid_plugin", "You need to install Flow-Flow plugin to use this api", 404);
     47            return parent::send_invalid_plugin_error("You need to install Flow-Flow plugin to use this api");
    4848        }
    4949        global $wpdb;
  • mstore-api/trunk/controllers/flutter-flutterwave.php

    r2758408 r3132501  
    4646    {
    4747        if (!is_plugin_active('rave-woocommerce-payment-gateway/woocommerce-rave.php')) {
    48             return parent::sendError("invalid_plugin", "You need to install Flutterwave WooCommerce plugin to use this api", 404);
     48            return parent::send_invalid_plugin_error("You need to install Flutterwave WooCommerce plugin to use this api");
    4949        }
    5050        $_GET['txref'] = sanitize_text_field($request['txref']);
  • mstore-api/trunk/controllers/flutter-home.php

    r3110793 r3132501  
    231231        $params['per_page'] = $limit;
    232232        $params['page'] = 0;
    233         $params['is_all_data'] = true;
     233        $params['is_all_data'] = $request->get_param('is_all_data') ?? false;
    234234   
    235235        if (is_plugin_active('wc-multivendor-marketplace/wc-multivendor-marketplace.php')) {
  • mstore-api/trunk/controllers/flutter-midtrans.php

    r3094904 r3132501  
    5656    {
    5757        if (!is_plugin_active('midtrans-woocommerce/midtrans-gateway.php')) {
    58             return parent::sendError("invalid_plugin", "You need to install Midtrans WooCommerce Payment Gateway plugin to use this api", 404);
     58            return parent::send_invalid_plugin_error("You need to install Midtrans WooCommerce Payment Gateway plugin to use this api");
    5959        }
    6060        $json = file_get_contents('php://input');
  • mstore-api/trunk/controllers/flutter-myfatoorah.php

    r2781050 r3132501  
    4646    {
    4747        if (!is_plugin_active('myfatoorah-woocommerce/myfatoorah-woocommerce.php')) {
    48             return parent::sendError("invalid_plugin", "You need to install MyFatoorah – WooCommerce plugin to use this api", 404);
     48            return parent::send_invalid_plugin_error("You need to install MyFatoorah – WooCommerce plugin to use this api");
    4949        }
    5050        $_GET['oid'] = base64_encode(sanitize_text_field($request['orderId']));
  • mstore-api/trunk/controllers/flutter-paid-memberships-pro.php

    r3068464 r3132501  
    5656    {
    5757        if (!is_plugin_active('paid-memberships-pro/paid-memberships-pro.php')) {
    58             return parent::sendError("plugin_not_found", "Please install Paid Memberships Pro", 404);
     58            return parent::send_invalid_plugin_error("Please install Paid Memberships Pro");
    5959        }
    6060
     
    293293    {
    294294        if (!is_plugin_active('paid-memberships-pro/paid-memberships-pro.php')) {
    295             return parent::sendError("plugin_not_found", "Please install Paid Memberships Pro", 404);
     295            return parent::send_invalid_plugin_error("Please install Paid Memberships Pro");
    296296        }
    297297
  • mstore-api/trunk/controllers/flutter-paystack.php

    r2943356 r3132501  
    5656    {
    5757        if (!is_plugin_active('woo-paystack/woo-paystack.php')) {
    58             return parent::sendError("invalid_plugin", "You need to install Paystack WooCommerce Payment Gateway plugin to use this api", 404);
     58            return parent::send_invalid_plugin_error("You need to install Paystack WooCommerce Payment Gateway plugin to use this api");
    5959        }
    6060        $json = file_get_contents('php://input');
     
    122122    {
    123123        if (!is_plugin_active('woo-paystack/woo-paystack.php')) {
    124             return parent::sendError("invalid_plugin", "You need to install Paystack WooCommerce Payment Gateway plugin to use this api", 404);
     124            return parent::send_invalid_plugin_error("You need to install Paystack WooCommerce Payment Gateway plugin to use this api");
    125125        }
    126126        $json = file_get_contents('php://input');
  • mstore-api/trunk/controllers/flutter-paytm.php

    r2635138 r3132501  
    4646    {
    4747        if (!is_plugin_active('paytm-payments/woo-paytm.php')) {
    48             return parent::sendError("invalid_plugin", "You need to install Paytm WooCommerce Payment Gateway plugin to use this api", 404);
     48            return parent::send_invalid_plugin_error("You need to install Paytm WooCommerce Payment Gateway plugin to use this api");
    4949        }
    5050        $json = file_get_contents('php://input');
  • mstore-api/trunk/controllers/flutter-store-locator.php

    r3098380 r3132501  
    6262    {
    6363        if (!is_plugin_active('yith-store-locator-for-wordpress/init.php')) {
    64             return parent::sendError("invalid_plugin", "You need to install YITH Store Locator for WordPress & WooCommerce plugin to use this api", 404);
     64            return parent::send_invalid_plugin_error("You need to install YITH Store Locator for WordPress & WooCommerce plugin to use this api");
    6565        }
    6666        $params = [];
     
    126126    {
    127127        if (!is_plugin_active('yith-store-locator-for-wordpress/init.php')) {
    128             return parent::sendError("invalid_plugin", "You need to install YITH Store Locator for WordPress & WooCommerce plugin to use this api", 404);
     128            return parent::send_invalid_plugin_error("You need to install YITH Store Locator for WordPress & WooCommerce plugin to use this api");
    129129        }
    130130        $store_id = $request["id"];
  • mstore-api/trunk/controllers/flutter-stripe.php

    r2897545 r3132501  
    5959    {
    6060        if (!is_plugin_active('woocommerce-gateway-stripe/woocommerce-gateway-stripe.php')) {
    61             return parent::sendError("invalid_plugin", "You need to install WooCommerce Stripe Gateway plugin to use this api", 404);
     61            return parent::send_invalid_plugin_error("You need to install WooCommerce Stripe Gateway plugin to use this api");
    6262        }
    6363        $json = file_get_contents('php://input');
     
    113113    {
    114114        if (!is_plugin_active('woocommerce-gateway-stripe/woocommerce-gateway-stripe.php')) {
    115             return parent::sendError("invalid_plugin", "You need to install WooCommerce Stripe Gateway plugin to use this api", 404);
     115            return parent::send_invalid_plugin_error("You need to install WooCommerce Stripe Gateway plugin to use this api");
    116116        }
    117117        $parameters = $request->get_params();
  • mstore-api/trunk/controllers/flutter-tera-wallet.php

    r3058324 r3132501  
    162162                'methods' => "POST",
    163163                'callback' => array($this, 'submit_request'),
     164                'permission_callback' => function () {
     165                    return parent::checkApiPermission();
     166                }
     167            ),
     168        ));
     169
     170        register_rest_route($this->namespace, '/referrals', array(
     171            array(
     172                'methods' => "GET",
     173                'callback' => array($this, 'get_referrals'),
    164174                'permission_callback' => function () {
    165175                    return parent::checkApiPermission();
     
    193203    {
    194204        if (!is_plugin_active('woo-wallet/woo-wallet.php')) {
    195             return parent::sendError("invalid_plugin", "You need to install TeraWallet plugin to use this api", 404);
     205            return parent::send_invalid_plugin_error("You need to install TeraWallet plugin to use this api");
    196206        }
    197207
     
    228238    {
    229239        if (!is_plugin_active('woo-wallet/woo-wallet.php')) {
    230             return parent::sendError("invalid_plugin", "You need to install TeraWallet plugin to use this api", 404);
     240            return parent::send_invalid_plugin_error("You need to install TeraWallet plugin to use this api");
    231241        }
    232242
     
    247257    {
    248258        if (!is_plugin_active('woo-wallet/woo-wallet.php')) {
    249             return parent::sendError("invalid_plugin", "You need to install TeraWallet plugin to use this api", 404);
     259            return parent::send_invalid_plugin_error("You need to install TeraWallet plugin to use this api");
    250260        }
    251261
     
    280290    {
    281291        if (!is_plugin_active('woo-wallet/woo-wallet.php')) {
    282             return parent::sendError("invalid_plugin", "You need to install TeraWallet plugin to use this api", 404);
     292            return parent::send_invalid_plugin_error("You need to install TeraWallet plugin to use this api");
    283293        }
    284294
     
    308318    {
    309319        if (!is_plugin_active('woo-wallet/woo-wallet.php')) {
    310             return parent::sendError("invalid_plugin", "You need to install TeraWallet plugin to use this api", 404);
     320            return parent::send_invalid_plugin_error("You need to install TeraWallet plugin to use this api");
    311321        }
    312322
     
    356366    {
    357367        if (!is_plugin_active('woo-wallet/woo-wallet.php')) {
    358             return parent::sendError("invalid_plugin", "You need to install TeraWallet plugin to use this api", 404);
     368            return parent::send_invalid_plugin_error("You need to install TeraWallet plugin to use this api");
    359369        }
    360370
     
    389399    {
    390400        if (!is_plugin_active('woo-wallet/woo-wallet.php')) {
    391             return parent::sendError("invalid_plugin", "You need to install TeraWallet plugin to use this api", 404);
     401            return parent::send_invalid_plugin_error("You need to install TeraWallet plugin to use this api");
    392402        }
    393403
     
    431441    public function get_payment_methods($request){
    432442        if (!class_exists('WOO_WALLET_WITHDRAWAL')) {
    433             return parent::sendError("invalid_plugin", "You need to install TeraWallet Withdrawal plugin to use this api", 404);
     443            return parent::send_invalid_plugin_error("You need to install TeraWallet Withdrawal plugin to use this api");
    434444        }
    435445        return woo_wallet_withdrawal()->gateways->get_available_gateways();
     
    439449    {
    440450        if (!class_exists('WOO_WALLET_WITHDRAWAL')) {
    441             return parent::sendError("invalid_plugin", "You need to install TeraWallet Withdrawal plugin to use this api", 404);
     451            return parent::send_invalid_plugin_error("You need to install TeraWallet Withdrawal plugin to use this api");
    442452        }
    443453         $cookie = $request->get_header("User-Cookie");
     
    471481    {
    472482        if (!class_exists('WOO_WALLET_WITHDRAWAL')) {
    473             return parent::sendError("invalid_plugin", "You need to install TeraWallet Withdrawal plugin to use this api", 404);
     483            return parent::send_invalid_plugin_error("You need to install TeraWallet Withdrawal plugin to use this api");
    474484        }
    475485
     
    506516    public function get_pending_requests($request){
    507517        if (!class_exists('WOO_WALLET_WITHDRAWAL')) {
    508             return parent::sendError("invalid_plugin", "You need to install TeraWallet Withdrawal plugin to use this api", 404);
     518            return parent::send_invalid_plugin_error("You need to install TeraWallet Withdrawal plugin to use this api");
    509519        }
    510520
     
    545555    public function get_approved_requests($request){
    546556        if (!class_exists('WOO_WALLET_WITHDRAWAL')) {
    547             return parent::sendError("invalid_plugin", "You need to install TeraWallet Withdrawal plugin to use this api", 404);
     557            return parent::send_invalid_plugin_error("You need to install TeraWallet Withdrawal plugin to use this api");
    548558        }
    549559
     
    582592    public function get_cancelled_requests($request){
    583593        if (!class_exists('WOO_WALLET_WITHDRAWAL')) {
    584             return parent::sendError("invalid_plugin", "You need to install TeraWallet Withdrawal plugin to use this api", 404);
     594            return parent::send_invalid_plugin_error("You need to install TeraWallet Withdrawal plugin to use this api");
    585595        }
    586596
     
    676686    {
    677687        if (!class_exists('WOO_WALLET_WITHDRAWAL')) {
    678             return parent::sendError("invalid_plugin", "You need to install TeraWallet Withdrawal plugin to use this api", 404);
     688            return parent::send_invalid_plugin_error("You need to install TeraWallet Withdrawal plugin to use this api");
    679689        }
    680690
     
    733743        return false;
    734744    }
     745
     746    function get_referrals($request){
     747        if (!is_plugin_active('woo-wallet/woo-wallet.php')) {
     748            return parent::send_invalid_plugin_error("You need to install TeraWallet plugin to use this api");
     749        }
     750
     751        $cookie = $request->get_header("User-Cookie");
     752        if (isset($cookie) && $cookie != null) {
     753            $user_id = validateCookieLogin($cookie);
     754            if (is_wp_error($user_id)) {
     755                return $user_id;
     756            }
     757
     758            $actionReferrals = new Action_Referrals();
     759            $settings = $actionReferrals->settings;
     760            $referral_handel = apply_filters( 'woo_wallet_referral_handel', 'wwref' );
     761
     762            $user                   = new WP_User( $user_id );
     763            $referral_url_by_userid = 'id' === $settings['referal_link'] ? true : false;
     764            $referral_url           = add_query_arg( $referral_handel, $user->user_login, wc_get_page_permalink( 'myaccount' ) );
     765            if ( $referral_url_by_userid ) {
     766                $referral_url = add_query_arg( $referral_handel, $user->ID, wc_get_page_permalink( 'myaccount' ) );
     767            }
     768            $referring_visitor = get_user_meta( $user_id, '_woo_wallet_referring_visitor', true ) ? get_user_meta( $user_id, '_woo_wallet_referring_visitor', true ) : 0;
     769            $referring_signup  = get_user_meta( $user_id, '_woo_wallet_referring_signup', true ) ? get_user_meta( $user_id, '_woo_wallet_referring_signup', true ) : 0;
     770            $referring_earning = get_user_meta( $user_id, '_woo_wallet_referring_earning', true ) ? get_user_meta( $user_id, '_woo_wallet_referring_earning', true ) : 0;
     771
     772            return [
     773                'referral_url' => $referral_url,
     774                'referral_code' => $referral_url_by_userid ? $user->ID : $user->user_login,
     775                'referring_visitor' => $referring_visitor,
     776                'referring_signup' => $referring_signup,
     777                'referring_earning' => $referring_earning
     778            ];
     779        } else {
     780            return parent::sendError("no_permission", "You need to add User-Cookie in header request", 400);
     781        }
     782    }
    735783}
    736784
  • mstore-api/trunk/controllers/flutter-user.php

    r3115231 r3132501  
    11331133            return $woocommerce_wpml->settings['currency_options'];
    11341134        }
    1135         return parent::sendError("not_install_woocommerce_wpml", "WooCommerce WPML hasn't been installed yet.", 404);
     1135        return parent::send_invalid_plugin_error("WooCommerce WPML hasn't been installed yet.");
    11361136    }
    11371137
     
    12741274        }
    12751275        $_REQUEST['json'] = 1;
     1276
     1277        if (isset($params['referral_code'])) {
     1278            $_COOKIE['woo_wallet_referral'] = sanitize_text_field( wp_unslash( $params['referral_code'] ) );
     1279        }
    12761280    }
    12771281
  • mstore-api/trunk/controllers/flutter-vendor.php

    r3061440 r3132501  
    438438                $product->save();
    439439            }
     440            if (isset($request["tags"]) && count($request["tags"]) > 0) {
     441                $product->set_tag_ids([$request["tags"][0]["id"]]);
     442                $product->save();
     443            }
    440444            return $product->get_data();
    441445        } else {
     
    562566            }
    563567
     568            if (isset($request['stock_status'])) {
     569                if (isset($args['meta_query'])) {
     570                    $args['meta_query'] = array(
     571                        'relation' => 'AND',
     572                        $args['meta_query'],
     573                        array(
     574                            'key' => '_stock_status',
     575                            'value' => $request['stock_status'],
     576                            'compare' => '=',
     577                        )
     578                    );
     579                }else{
     580                    $args['meta_query'] = array(
     581                        array(
     582                            'key' => '_stock_status',
     583                            'value' => $request['stock_status'],
     584                            'compare' => '=',
     585                        )
     586                    );
     587                }
     588            }
    564589            $products = get_posts($args);
    565590        } else {
     
    788813            return $reviews;
    789814        } else {
    790             return parent::sendError("invalid_plugin", "Please install WCFM Marketplace Rest API plugin", 400);
     815            return parent::send_invalid_plugin_error("Please install WCFM Marketplace Rest API plugin", 400);
    791816        }
    792817    }
  • mstore-api/trunk/controllers/flutter-wholesale.php

    r2975412 r3132501  
    5555    {
    5656        if (!class_exists('WooCommerceWholeSalePrices')) {
    57             return parent::sendError("invalid_plugin", "You need to install WooCommerce Wholesale Prices plugin to use this api", 404);
     57            return parent::send_invalid_plugin_error("You need to install WooCommerce Wholesale Prices plugin to use this api");
    5858        }
    5959        global $wc_wholesale_prices;
     
    7676       
    7777        if (!class_exists('WooCommerceWholeSalePrices')) {
    78             return parent::sendError("invalid_plugin", "You need to install WooCommerce Wholesale Prices plugin to use this api", 404);
     78            return parent::send_invalid_plugin_error("You need to install WooCommerce Wholesale Prices plugin to use this api");
    7979        }
    8080        global $wc_wholesale_prices;
  • mstore-api/trunk/controllers/flutter-woo.php

    r3115231 r3132501  
    312312            $ean_key = get_option('alg_wc_ean_meta_key', '_alg_ean');
    313313            $data = $this->get_post_id_from_meta($ean_key, $raw_data);
     314        }
     315
     316        // Get id from sku
     317        if (!isset($data)) {
     318            $data = $this->get_post_id_from_meta('_sku', $raw_data);
     319        }
     320
     321        // Try to get id directly
     322        if (!isset($data)) {
     323            $data = $raw_data;
    314324        }
    315325
     
    953963        $session = $session_handler->get_session($user_id);
    954964
     965        if($session == false){
     966            return [];
     967        }
     968       
    955969        // Get cart items array
    956970        $cart_items = maybe_unserialize($session['cart']);
     
    11291143    {
    11301144        if (!is_plugin_active('woocommerce-points-and-rewards/woocommerce-points-and-rewards.php')) {
    1131             return parent::sendError("invalid_plugin", "You need to install WooCommerce Points and Rewards plugin to use this api", 404);
     1145            return parent::send_invalid_plugin_error("You need to install WooCommerce Points and Rewards plugin to use this api");
    11321146        }
    11331147
     
    11551169    {
    11561170        if (!is_plugin_active('woocommerce-points-and-rewards/woocommerce-points-and-rewards.php')) {
    1157             return parent::sendError("invalid_plugin", "You need to install Points and Rewards for WooCommerce plugin to use this api", 404);
     1171            return parent::send_invalid_plugin_error("You need to install Points and Rewards for WooCommerce plugin to use this api");
    11581172        }
    11591173
     
    12581272            }
    12591273            return $arr;
    1260         }else{
    1261             return parent::sendError("invalid_plugin", "You need to install Order Delivery Date for WooCommerce or WOOCOMMERCE FRONTEND MANAGER - DELIVERY plugin to use this api", 404);
     1274        } else {
     1275            return parent::send_invalid_plugin_error("You need to install Order Delivery Date for WooCommerce or WOOCOMMERCE FRONTEND MANAGER - DELIVERY plugin to use this api");
    12621276        }
    12631277    }
     
    12821296
    12831297        if (!is_plugin_active('indeed-membership-pro/indeed-membership-pro.php')) {
    1284             return parent::sendError("invalid_plugin", "You need to install Ultimate Membership Pro plugin to use this api", 404);
     1298            return parent::send_invalid_plugin_error("You need to install Ultimate Membership Pro plugin to use this api");
    12851299        }
    12861300
     
    14641478    }
    14651479
    1466     /// Clone from function `custom_product_tabs_content` of `PSCW_PRODUCT_SIZE_CHART_F_WOO_Front_end`
     1480    /**
     1481     * custom_product_tabs_content
     1482     *
     1483     * Clone from function `custom_product_tabs_content` of
     1484     * `PSCW_PRODUCT_SIZE_CHART_F_WOO_Front_end`
     1485     *
     1486     * Plugin Product Size Chart For WooCommerce
     1487     * https://wordpress.org/plugins/product-size-chart-for-woo/
     1488     *
     1489     * @param  mixed $post_id
     1490     * @return String
     1491     */
    14671492    private function custom_product_tabs_content($post_id)
    14681493    {
    14691494        $html = '';
     1495
     1496        if (!class_exists('PSCW_PRODUCT_SIZE_CHART_F_WOO_Front_end')) {
     1497            return $html;
     1498        }
    14701499
    14711500        // Initialize controller manually
  • mstore-api/trunk/controllers/helpers/vendor-wcfm.php

    r3080638 r3132501  
    11011101            $params['hide_empty'] = $request['hide_empty'];
    11021102        }
     1103        $exclude = $request['exclude'];
     1104        if (isset($exclude) && is_string($exclude)) {
     1105            $params['exclude'] = explode(',', $exclude);
     1106        }
    11031107
    11041108        if (isset($store_id)) {
     
    11401144
    11411145            $categoryIds = array();
     1146            $excludes = isset($params['exclude']) ? $params['exclude'] : array();
    11421147            foreach ($products as $object) {
    11431148                $terms = get_the_terms($object->ID ?? $object->get_id(), 'product_cat');
    11441149                foreach ((array)$terms as $term) {
    11451150                    $cat_id = $term->term_id;
    1146                     if (!in_array($cat_id, $categoryIds)) {
     1151                    if (!in_array($cat_id, $categoryIds) && !in_array($cat_id, $excludes)) {
    11471152                        $categoryIds[] = $cat_id;
    11481153                    }
  • mstore-api/trunk/controllers/listing-rest-api/class.api.fields.php

    r3115231 r3132501  
    764764        $_user_id = $object['user_id'];
    765765        $user_info = get_user_meta($_user_id);
    766 
    767         $first_name = $user_info['billing_first_name'][0];
    768         $last_name = $user_info['billing_last_name'][0];
    769         $email = $user_info['billing_email'][0];
     766        $u_data = get_user_by( 'id', $_user_id );
     767
     768        $first_name = isset($user_info['billing_first_name']) ? $user_info['billing_first_name'][0] : $user_info['first_name'][0];
     769        $last_name = isset($user_info['billing_last_name']) ? $user_info['billing_last_name'][0] : $user_info['last_name'][0];
     770        $email = isset($user_info['billing_email']) ? $user_info['billing_email'][0] : $u_data->user_email;
    770771        $billing_address_1 = (isset($user_info['billing_address_1'][0])) ? $user_info['billing_address_1'][0] : false;
    771772        $billing_postcode = (isset($user_info['billing_postcode'][0])) ? $user_info['billing_postcode'][0] : false;
    772773        $billing_city = (isset($user_info['billing_city'][0])) ? $user_info['billing_city'][0] : false;
    773774        $billing_country = (isset($user_info['billing_country'][0])) ? $user_info['billing_country'][0] : false;
    774         $billing_phone = $user_info['billing_phone'][0];
     775        $billing_phone = isset($user_info['billing_phone'][0]) ? $user_info['billing_phone'][0] : false;
    775776
    776777        $data = json_decode($object['value']);
    777         $date_start = $data->date_start;
    778         $date_end = $data->date_end;
    779         $adults = $data->adults;
    780         $tickets = $data->tickets;
    781         $listing_id = $data->listing_id;
    782         $slot = $data->slot;
    783         $_hour_end = $data->_hour_end;
    784         $_hour = $data->_hour;
     778        $date_start = isset($data->date_start) ? $data->date_start : null;
     779        $date_end = isset($data->date_end) ? $data->date_end : null;
     780        $adults = isset($data->adults) ? $data->adults : null;
     781        $tickets = isset($data->tickets) ? $data->tickets : null;
     782        $listing_id = isset($data->listing_id) ? $data->listing_id : null;
     783        $slot = isset($data->slot) ? $data->slot : null;
     784        $_hour_end = isset($data->_hour_end) ? $data->_hour_end : null;
     785        $_hour = isset($data->_hour) ? $data->_hour : null;
    785786        $services = isset($data->services) ? $data->services : false;
    786787        $comment_services = false;
     
    13431344                $status = wp_get_comment_status($item->comment_ID);
    13441345                $countRating = get_comment_meta($item->comment_ID, $commentKey, true);
    1345                 $current_rating = get_comment_meta($comment->comment_ID, $commentKey, true);
     1346                $current_rating = get_comment_meta($item->comment_ID, $commentKey, true);
    13461347                $results[] = ["id" => $item->comment_ID, "rating" => $countRating, "status" => $status, "author_name" => $item->comment_author, "date" => $item->comment_date, "content" => $item->comment_content, "author_email" => $item->comment_author_email];
    13471348            }
     
    14031404                $listing_type = \MyListing\Src\Listing_Type::get_by_name( $listing_type );
    14041405                $meta['_case27_listing_type_name'] = $listing_type->get_name();
     1406            }
     1407           
     1408            if (array_key_exists('_menu', $meta)) {
     1409                $meta['_menu'] = array_map(function($item){
     1410                    if (isset($item['menu_elements']) && !empty($item['menu_elements'])) {
     1411                        $item['menu_elements'] = array_map(function($element){
     1412                            if (isset($element['cover']) && !empty($element['cover'])) {
     1413                                $image = wp_get_attachment_image_src($element['cover'], 'listeo-gallery');
     1414                                $thumb = wp_get_attachment_image_src($element['cover'], 'thumbnail');
     1415                                $element['image'] = !empty($image) ? $image[0] : null;
     1416                                $element['thumb'] = !empty($thumb) ? $thumb[0] : null;
     1417                            }
     1418                            return $element;
     1419                        }, $item['menu_elements']);
     1420                    }
     1421                    return $item;
     1422                }, $meta['_menu']);
    14051423            }
    14061424           
  • mstore-api/trunk/functions/index.php

    r3106341 r3132501  
    424424        );
    425425
     426        $hide_on_single = get_option( 'yith-wcbm-hide-on-single-product', 'no' ) === 'yes';
     427        $meta_data[] = array(
     428            'id'    => '_yith-wcbm-hide-on-single-product',
     429            'key'   => '_yith-wcbm-hide-on-single-product',
     430            'value' => $hide_on_single,
     431        );
     432       
    426433        $response->data['meta_data'] = $meta_data;
    427434    }
     
    592599            $response->data['price']= $sign_up_fee;
    593600        }
     601    }
     602   
     603    /* TeraWallet */
     604    if ( class_exists( 'WooWallet' ) ) {
     605        $response->data['is_wallet_product'] =  get_option( '_woo_wallet_recharge_product' ) == (string) $response->data['id'];
    594606    }
    595607   
  • mstore-api/trunk/mstore-api.php

    r3115231 r3132501  
    44 * Plugin URI: https://github.com/inspireui/mstore-api
    55 * Description: The MStore API Plugin which is used for the FluxBuilder and FluxStore Mobile App
    6  * Version: 4.15.0
     6 * Version: 4.15.2
    77 * Author: FluxBuilder
    88 * Author URI: https://fluxbuilder.com
     
    5757class MstoreCheckOut
    5858{
    59     public $version = '4.15.0';
     59    public $version = '4.15.2';
    6060
    6161    public function __construct()
  • mstore-api/trunk/readme.txt

    r3115238 r3132501  
    44Requires at least: 4.4
    55Tested up to:      6.5.3
    6 Stable tag:        4.15.0
     6Stable tag:        4.15.2
    77License:           GPL-2.0
    88License URI:       https://www.gnu.org/licenses/gpl-2.0.html
     
    4949
    5050== Changelog ==
     51= 4.15.2 =
     52  * Fix waring issues
     53
     54= 4.15.1 =
     55  * Support Tera Wallet Referrals
     56 
    5157= 4.15.0 =
    5258  * Remove api/flutter_user/firebase_sms_login and api/flutter_user/firebase_sms_login_v2 endpoint. They're replaced by api/flutter_user/firebase_sms and api/flutter_user/firebase_sms_login_v2
Note: See TracChangeset for help on using the changeset viewer.