Plugin Directory

Changeset 3205228


Ignore:
Timestamp:
12/10/2024 04:27:34 AM (16 months ago)
Author:
inspireui
Message:

version 4.16.4

Location:
mstore-api
Files:
490 added
4 edited

Legend:

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

    r3196990 r3205228  
    424424     * Check any prerequisites for our REST request.
    425425     */
    426     private function check_prerequisites($request)
     426    private function check_prerequisites($request, $body)
    427427    {
    428428        $cookie = $request->get_header("User-Cookie");
     
    706706        $body = json_decode($json, TRUE);
    707707
    708         $check = $this->check_prerequisites($request);
     708        $check = $this->check_prerequisites($request, $body);
    709709        if(is_wp_error($check)){
    710710            return $check;
     
    791791        $body = json_decode($json, TRUE);
    792792
    793         $check = $this->check_prerequisites($request);
     793        $check = $this->check_prerequisites($request, $body);
    794794        if(is_wp_error($check)){
    795795            return $check;
     
    842842        $body = json_decode($json, TRUE);
    843843
    844         $check = $this->check_prerequisites($request);
     844        $check = $this->check_prerequisites($request, $body);
    845845        if(is_wp_error($check)){
    846846            return $check;
     
    10891089        $body = json_decode($json, TRUE);
    10901090
    1091         $check = $this->check_prerequisites($request);
     1091        $check = $this->check_prerequisites($request, $body);
    10921092        if(is_wp_error($check)){
    10931093            return $check;
  • mstore-api/trunk/functions/index.php

    r3189145 r3205228  
    648648        );
    649649        $response->data['meta_data'] = $meta_data;
     650    }
     651
     652    if (class_exists('WooCommerceWholeSalePrices')) {
     653        $meta_data = $response->data['meta_data'];
     654        foreach ($meta_data as $v) {
     655            $key = is_array($v) ? $v['key'] : $v->__get('key');
     656            if ((strpos($key, '_wholesale_price') !== false && strpos($key, '_have_wholesale_price') === false) || (strpos($key, '_wholesale_sale_price') !== false && strpos($key, '_have_wholesale_sale_price') === false)) {
     657                if($v->__get('value')){
     658                    $wholesale_price = wc_get_price_to_display(  $object, array( 'price' => $v->__get('value') ) );
     659                    $v->__set("value", number_format($wholesale_price, 2, '.', ''));
     660                    $v->apply_changes();
     661                }
     662            }
     663        }
    650664    }
    651665
  • mstore-api/trunk/mstore-api.php

    r3199468 r3205228  
    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.16.3
     6 * Version: 4.16.4
    77 * Author: FluxBuilder
    88 * Author URI: https://fluxbuilder.com
     
    6060class MstoreCheckOut
    6161{
    62     public $version = '4.16.3';
     62    public $version = '4.16.4';
    6363
    6464    public function __construct()
     
    723723            $response->data['regular_price']= $sign_up_fee;
    724724            $response->data['price']= $sign_up_fee;
     725        }
     726    }
     727
     728    if (class_exists('WooCommerceWholeSalePrices')) {
     729        $meta_data = $response->data['meta_data'];
     730        foreach ($meta_data as $v) {
     731            $key = is_array($v) ? $v['key'] : $v->__get('key');
     732            if ((strpos($key, '_wholesale_price') !== false && strpos($key, '_have_wholesale_price') === false) || (strpos($key, '_wholesale_sale_price') !== false && strpos($key, '_have_wholesale_sale_price') === false)) {
     733                if($v->__get('value')){
     734                    $wholesale_price = wc_get_price_to_display(  $object, array( 'price' => $v->__get('value') ) );
     735                    $v->__set("value", number_format($wholesale_price, 2, '.', ''));
     736                    $v->apply_changes();
     737                }
     738            }
    725739        }
    726740    }
  • mstore-api/trunk/readme.txt

    r3199468 r3205228  
    44Requires at least: 4.4
    55Tested up to:      6.5.3
    6 Stable tag:        4.16.3
     6Stable tag:        4.16.4
    77License:           GPL-2.0
    88License URI:       https://www.gnu.org/licenses/gpl-2.0.html
     
    4949
    5050== Changelog ==
     51= 4.16.4 =
     52  * Fix wholesale price with tax
     53
    5154= 4.16.3 =
    5255  * Support to post meta data when create product
Note: See TracChangeset for help on using the changeset viewer.