Changeset 2447754
- Timestamp:
- 12/30/2020 07:21:04 AM (5 years ago)
- Location:
- mobile-builder/trunk
- Files:
-
- 5 edited
-
README.txt (modified) (1 diff)
-
api/class-mobile-builder-vendor.php (modified) (2 diffs)
-
includes/class-mobile-builder.php (modified) (1 diff)
-
mobile-builder.php (modified) (1 diff)
-
product/class-mobile-builder-product.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mobile-builder/trunk/README.txt
r2447220 r2447754 42 42 43 43 == Changelog == 44 = 1.4.2 = 45 46 * Add: Send notification for vendor * 47 * Add: API get attribute for product * 48 * Improved: Decode token * 49 * Improved: Meta required version * 50 44 51 = 1.4.0 = 45 52 -
mobile-builder/trunk/api/class-mobile-builder-vendor.php
r2364781 r2447754 68 68 register_rest_route( $namespace, 'vendors', array( 69 69 array( 70 'methods' => WP_REST_Server::READABLE,71 'callback' => array( $this, 'vendors' ),72 'permission_callback' => '__return_true',70 'methods' => WP_REST_Server::READABLE, 71 'callback' => array( $this, 'vendors' ), 72 'permission_callback' => '__return_true', 73 73 ), 74 74 array( 75 'methods' => WP_REST_Server::CREATABLE,76 'callback' => array( $this, 'vendors' ),77 'permission_callback' => '__return_true',75 'methods' => WP_REST_Server::CREATABLE, 76 'callback' => array( $this, 'vendors' ), 77 'permission_callback' => '__return_true', 78 78 ) 79 79 ) ); 80 80 81 81 register_rest_route( $namespace, 'directions', array( 82 'methods' => WP_REST_Server::READABLE,83 'callback' => array( $this, 'directions' ),84 'permission_callback' => '__return_true',82 'methods' => WP_REST_Server::READABLE, 83 'callback' => array( $this, 'directions' ), 84 'permission_callback' => '__return_true', 85 85 ) ); 86 86 87 87 register_rest_route( $namespace, 'vendor' . '/(?P<id>[\d]+)', array( 88 'methods' => WP_REST_Server::READABLE,89 'callback' => array( $this, 'vendor' ),90 'permission_callback' => '__return_true',88 'methods' => WP_REST_Server::READABLE, 89 'callback' => array( $this, 'vendor' ), 90 'permission_callback' => '__return_true', 91 91 ) ); 92 92 93 93 register_rest_route( $namespace, 'delivery-boy-delivery-stat', array( 94 'methods' => WP_REST_Server::READABLE,95 'callback' => array( $this, 'delivery_boy_delivery_stat' ),96 'permission_callback' => '__return_true',94 'methods' => WP_REST_Server::READABLE, 95 'callback' => array( $this, 'delivery_boy_delivery_stat' ), 96 'permission_callback' => '__return_true', 97 97 ) ); 98 98 99 99 register_rest_route( $namespace, 'messages-mark-read', array( 100 'methods' => WP_REST_Server::CREATABLE,101 'callback' => array( $this, 'messages_mark_read' ),102 'permission_callback' => '__return_true',100 'methods' => WP_REST_Server::CREATABLE, 101 'callback' => array( $this, 'messages_mark_read' ), 102 'permission_callback' => '__return_true', 103 103 ) ); 104 104 105 105 register_rest_route( $namespace, 'messages-delete', array( 106 'methods' => WP_REST_Server::CREATABLE,107 'callback' => array( $this, 'messages_delete' ),108 'permission_callback' => '__return_true',106 'methods' => WP_REST_Server::CREATABLE, 107 'callback' => array( $this, 'messages_delete' ), 108 'permission_callback' => '__return_true', 109 109 ) ); 110 110 111 111 register_rest_route( $namespace, 'mark-order-delivered', array( 112 'methods' => WP_REST_Server::CREATABLE,113 'callback' => array( $this, 'mark_order_delivered' ),114 'permission_callback' => '__return_true',112 'methods' => WP_REST_Server::CREATABLE, 113 'callback' => array( $this, 'mark_order_delivered' ), 114 'permission_callback' => '__return_true', 115 115 ) ); 116 116 … … 475 475 } 476 476 477 function custom_after_wcfm_notification( $author_id, $message_to, $author_is_admin, $author_is_vendor, $wcfm_messages, $message_type ) { 478 $message_to = absint( $message_to ); 479 if ( $message_to ) { 480 $content = array( 481 "en" => strip_tags( $wcfm_messages ) 482 ); 483 484 $fields = array( 485 'app_id' => MOBILE_BUILDER_ONESIGNAL_APP_ID_STORE_MANAGER_APP, 486 'filters' => array( 487 array( 488 "field" => "tag", 489 "key" => "user_id", 490 "relation" => "=", 491 "value" => $message_to 492 ) 493 ), 494 'data' => array( "user_id" => $message_to ), 495 'contents' => $content 496 ); 497 498 mobile_builder_send_notification( $fields, MOBILE_BUILDER_ONESIGNAL_API_KEY_STORE_MANAGER_APP ); 499 } 500 } 501 502 477 503 /** 478 504 * Send a Notification event when an order status is changed. -
mobile-builder/trunk/includes/class-mobile-builder.php
r2423337 r2447754 230 230 $this->loader->add_action( 'wcfmd_after_delivery_boy_assigned', $plugin_api, 'delivery_boy_assigned_notification', 10, 6 ); 231 231 $this->loader->add_action( 'woocommerce_order_status_changed', $plugin_api, 'notification_order_status_changed', 10, 3 ); 232 $this->loader->add_action( 'after_wcfm_notification', $plugin_api, 'custom_after_wcfm_notification', 600, 6 ); 232 233 233 234 // WCFM -
mobile-builder/trunk/mobile-builder.php
r2447220 r2447754 11 11 * Plugin URI: https://doc-oreo.rnlab.io 12 12 * Description: The most advanced drag & drop app builder. Create multi templates and app controls. 13 * Version: 1.4. 113 * Version: 1.4.2 14 14 * Author: Rnlab.io 15 15 * Author URI: https://rnlab.io -
mobile-builder/trunk/product/class-mobile-builder-product.php
r2447220 r2447754 68 68 69 69 register_rest_route( $namespace, 'rating-count', array( 70 'methods' => 'GET',70 'methods' => WP_REST_Server::READABLE, 71 71 'callback' => array( $this, 'rating_count' ), 72 72 'permission_callback' => '__return_true', … … 74 74 75 75 register_rest_route( 'wc/v3', 'products-distance', array( 76 'methods' => 'GET',76 'methods' => WP_REST_Server::READABLE, 77 77 'callback' => array( $this, 'get_items' ), 78 78 'permission_callback' => array( $products, 'get_items_permissions_check' ), … … 80 80 81 81 register_rest_route( $namespace, 'attributes/(?P<product_id>[a-zA-Z0-9-]+)', array( 82 'methods' => 'GET',82 'methods' => WP_REST_Server::READABLE, 83 83 'callback' => array( $this, 'get_all_product_attributes' ), 84 'permission_callback' => '__return_true', 85 ) ); 86 87 register_rest_route( $namespace, 'variations/(?P<product_id>[a-zA-Z0-9-]+)', array( 88 'methods' => WP_REST_Server::READABLE, 89 'callback' => array( $this, 'get_all_product_variations' ), 84 90 'permission_callback' => '__return_true', 85 91 ) ); … … 154 160 155 161 return $product_attributes; 162 } 163 164 165 function get_all_product_variations( $request ) { 166 $product_id = $request->get_param('product_id'); 167 $handle = new WC_Product_Variable($product_id); 168 $variation_attributes = $handle->get_variation_attributes(); 169 $variation_attributes_data = array(); 170 $variation_attributes_label = array(); 171 foreach($variation_attributes as $key => $attribute){ 172 $variation_attributes_result['attribute_' . sanitize_title( $key )] = $attribute; 173 $variation_attributes_label['attribute_' . sanitize_title( $key )] = $key; 174 } 175 return array( 176 'variation_attributes_label' => $variation_attributes_label, 177 'variation_attributes'=> $variation_attributes_result, 178 'available_variations' => $handle->get_available_variations() 179 ); 156 180 } 157 181
Note: See TracChangeset
for help on using the changeset viewer.