Plugin Directory

Changeset 3098380


Ignore:
Timestamp:
06/06/2024 07:38:10 AM (22 months ago)
Author:
inspireui
Message:

version 4.14.4

Location:
mstore-api
Files:
486 added
4 edited

Legend:

Unmodified
Added
Removed
  • mstore-api/trunk/controllers/flutter-store-locator.php

    r3011790 r3098380  
    7878        $stores = yith_sl_get_stores($params);
    7979   
     80        //customize for YITH WooCommerce Checkout Manager
     81        $fields = get_option( 'ywccp_fields_shipping_options', array() );
     82        function find_field($slug, $fields){
     83            foreach ($fields as $key => $value) {
     84                if($value['condition_value'] == $slug.'|pick-up'){
     85                    return $value['label'];
     86                }
     87            }
     88            return "";
     89        }
     90        //
     91       
    8092        for ( $i = 0; $i < count($stores); $i++ ){
    8193            $store = YITH_Store_Locator_Store( $stores[ $i ]['id'] );
     
    8698                $src = null;
    8799            }
     100            $shipping_address = find_field($stores[ $i ]['slug'], $fields);
    88101            $results[] = [
    89102                'id' => $store->get_id(),
    90103                'name' => $store->get_name(),
     104                'slug' => $stores[ $i ]['slug'],
     105                'shipping_address' => $shipping_address,
    91106                'description' => $store->get_description(),
    92107                'image' => $src,
  • mstore-api/trunk/functions/index.php

    r3089934 r3098380  
    133133
    134134function _pushNotification($user_id, $title, $message, $meta_key){
     135    $is_notification_on = $meta_key == 'mstore_manager_device_token' || $meta_key == 'mstore_delivery_device_token';
    135136    if (is_plugin_active('onesignal-free-web-push-notifications/onesignal.php')) {
    136         _pushNotificationOneSignal($title,$message, $user_id);
     137        _pushNotificationOneSignal($title,$message, $user_id, $is_notification_on);
    137138    } else {
    138139        $deviceToken = get_user_meta($user_id, $meta_key, true);
    139140        if (isset($deviceToken) && $deviceToken != false) {
    140             _pushNotificationFirebase($user_id,$title, $message, $deviceToken);
     141            _pushNotificationFirebase($user_id,$title, $message, $deviceToken, $is_notification_on);
    141142        }
    142143    }
     
    220221    }
    221222    $message = str_replace("{{name}}", $user->display_name, $message);
    222     pushNotificationForUser($order_seller_id, $title, $message);
     223    pushNotificationForUser($order_seller_id, $title, $message);//push notification to vendor who logged in on FluxStore MV
    223224    if (!is_plugin_active('onesignal-free-web-push-notifications/onesignal.php')) {//fix duplicate notification if onesignal
    224         pushNotificationForVendor($order_seller_id, $title, $message);
     225        pushNotificationForVendor($order_seller_id, $title, $message);//push notification to vendor who logged in on FluxStore Manager
    225226    }
    226227    if (is_plugin_active('wc-multivendor-marketplace/wc-multivendor-marketplace.php')) {
     
    733734            $seller_ids[] = $order_seller_id;
    734735        }
    735     }
    736 
    737     if (is_plugin_active('wc-multivendor-marketplace/wc-multivendor-marketplace.php')) {
     736    }else if (is_plugin_active('wc-multivendor-marketplace/wc-multivendor-marketplace.php')) {
    738737        if (function_exists('wcfm_get_vendor_store_by_post')) {
    739738            $order = wc_get_order($order_id);
     
    757756            }
    758757        }
     758    }else{
     759        $users_query = new WP_User_Query( array(
     760                    'role' => 'Administrator',
     761                    'fields' => 'ID'
     762                    ));
     763        $seller_ids = $users_query->get_results();
    759764    }
    760765    return $seller_ids;
     
    786791}
    787792
    788 function _pushNotificationFirebase($user_id, $title, $message, $deviceToken){
    789     $is_on = isNotificationEnabled($user_id);
     793function _pushNotificationFirebase($user_id, $title, $message, $deviceToken, $is_notification_on){
     794    $is_on = $is_notification_on == true || isNotificationEnabled($user_id);
    790795    if($is_on){
    791796        FirebaseMessageHelper::push_notification($title, $message, $deviceToken);
     
    793798}
    794799
    795 function _pushNotificationOneSignal($user_id, $title, $message){
    796     $is_on = isNotificationEnabled($user_id);
     800function _pushNotificationOneSignal($user_id, $title, $message, $is_notification_on){
     801    $is_on = $is_notification_on == true || isNotificationEnabled($user_id);
    797802    if($is_on){
    798803        one_signal_push_notification($title,$message,array($user_id));
  • mstore-api/trunk/mstore-api.php

    r3094904 r3098380  
    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.14.3
     6 * Version: 4.14.4
    77 * Author: FluxBuilder
    88 * Author URI: https://fluxbuilder.com
     
    5656class MstoreCheckOut
    5757{
    58     public $version = '4.14.3';
     58    public $version = '4.14.4';
    5959
    6060    public function __construct()
  • mstore-api/trunk/readme.txt

    r3094904 r3098380  
    44Requires at least: 4.4
    55Tested up to:      6.5.3
    6 Stable tag:        4.14.3
     6Stable tag:        4.14.4
    77License:           GPL-2.0
    88License URI:       https://www.gnu.org/licenses/gpl-2.0.html
     
    4949
    5050== Changelog ==
     51= 4.14.4 =
     52  * Push notification to admin when has new order
     53
    5154= 4.14.3 =
    5255  * Fix update product in vendor admin
Note: See TracChangeset for help on using the changeset viewer.