Plugin Directory

Changeset 2332301


Ignore:
Timestamp:
06/29/2020 10:39:03 AM (6 years ago)
Author:
rnlab
Message:

feat: add analytic page

Location:
mobile-builder/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • mobile-builder/trunk/api/class-mobile-builder-cart.php

    r2324940 r2332301  
    131131        ) );
    132132
     133        register_rest_route( $this->namespace, 'check-auth-header', array(
     134            'methods'             => WP_REST_Server::CREATABLE,
     135            'callback'            => array( $this, 'check_auth_header' ),
     136        ) );
     137
     138    }
     139
     140    public function check_auth_header( $request ) {
     141        $headers = mobile_builder_headers();
     142
     143        if ( isset( $headers['Authorization'] ) && $headers['Authorization'] == "Bearer test" ) {
     144            return array("check" => true);
     145        }
     146
     147        return array("check" => false);
    133148    }
    134149
  • mobile-builder/trunk/helpers/mobile-builder-functions.php

    r2322821 r2332301  
    9494    return $result;
    9595}
     96
     97/**
     98 * Get request headers
     99 * @return array|false
     100 */
     101function mobile_builder_headers() {
     102    if ( function_exists( 'apache_request_headers' ) ) {
     103        return apache_request_headers();
     104    } else {
     105
     106        foreach ( $_SERVER as $key => $value ) {
     107            if ( substr( $key, 0, 5 ) == "HTTP_" ) {
     108                $key         = str_replace( " ", "-",
     109                    ucwords( strtolower( str_replace( "_", " ", substr( $key, 5 ) ) ) ) );
     110                $out[ $key ] = $value;
     111            } else {
     112                $out[ $key ] = $value;
     113            }
     114        }
     115
     116        return $out;
     117    }
     118}
  • mobile-builder/trunk/mobile-builder.php

    r2324940 r2332301  
    1111 * Plugin URI:        https://doc-oreo.rnlab.io
    1212 * Description:       The most advanced drag & drop app builder. Create multi templates and app controls.
    13  * Version:           1.0.2
     13 * Version:           1.0.3
    1414 * Author:            Rnlab.io
    1515 * Author URI:        https://rnlab.io
     
    3131 * Rename this for your plugin and update it as you release new versions.
    3232 */
    33 define( 'MOBILE_BUILDER_CONTROL_VERSION', '1.4.4' );
     33define( 'MOBILE_BUILDER_CONTROL_VERSION', '1.4.5' );
    3434
    3535define( 'MOBILE_BUILDER_PLUGIN_NAME', 'mobile-builder' );
  • mobile-builder/trunk/product/class-mobile-builder-product.php

    r2311294 r2332301  
    227227//      echo $request->get_param('lat'); die;
    228228
     229        $type  = $response->data['type'];
     230
     231        if( $type == 'variable' ){
     232            $price_min = $object->get_variation_price();
     233            $price_max = $object->get_variation_price('max');
     234            $response->data['price_min'] = $price_min;
     235            $response->data['price_max'] = $price_max;
     236        }
     237
    229238        global $woocommerce_wpml;
    230 
    231239        if ( ! empty( $woocommerce_wpml->multi_currency ) && ! empty( $woocommerce_wpml->settings['currencies_order'] ) ) {
    232240
    233             $type  = $response->data['type'];
    234241            $price = $response->data['price'];
    235242
    236243            if ( $type == 'grouped' || $type == 'variable' ) {
     244               
    237245                foreach ( $woocommerce_wpml->settings['currencies_order'] as $currency ) {
    238246
Note: See TracChangeset for help on using the changeset viewer.