Plugin Directory

Changeset 3164634


Ignore:
Timestamp:
10/08/2024 05:25:49 AM (18 months ago)
Author:
olivery
Message:

1.0.7

Location:
connect-plus-for-woocommerce
Files:
38 added
4 edited

Legend:

Unmodified
Added
Removed
  • connect-plus-for-woocommerce/trunk/README.txt

    r3163357 r3164634  
    99Tested up to: 6.6
    1010
    11 Stable tag: 1.0.6
     11Stable tag: 1.0.7
    1212
    1313Requires PHP: 7.0
  • connect-plus-for-woocommerce/trunk/connect-plus-for-woocommerce.php

    r3163352 r3164634  
    1717 * Plugin URI:        https://website.olivery.app/
    1818 * Description:       Plugin to help you connect WooCommerce with Connect Plus application
    19  * Version:           1.0.6
     19 * Version:           1.0.7
    2020 * Author:            Olivery dev
    2121 * Text Domain:       connect-plus-for-woocommerce
  • connect-plus-for-woocommerce/trunk/endpoints/cpfw-connect-ajax-wrapper.php

    r3163352 r3164634  
    7070        }catch(Exception $e){
    7171            wp_send_json_error([
    72                 'message' => esc_html($e->getMessage(), 'connect-plus-for-woocommerce'),
    73                 'error' => esc_html($e->getMessage() , 'connect-plus-for-woocommerce'),
     72                'message' => esc_html($e->getMessage()),
     73                'error' => esc_html($e->getMessage()),
    7474            ]);
    7575            wp_die();
  • connect-plus-for-woocommerce/trunk/includes/services/cpfw-connect-api.php

    r3163352 r3164634  
    127127            ];
    128128        }
     129
     130
     131        $cpfw_order_notes = wc_get_order_notes( array( 'order_id' => $cpfw_the_order->get_id() ) );
     132       
     133        $content_array = array();
     134
     135        foreach ($cpfw_order_notes as $note) {
     136            $content_array[] = $note->content; // Access content directly from stdClass
     137        }
     138
    129139        // Add the URL for add orders
    130140        $cpfw_url  = "https://api.connect-plus.app/integration/add_orders";
    131141
    132         $cpfw_body = '{ "orders_list": [{
     142        $cpfw_body ='{ "orders_list": [{
    133143                    "address": "' . ($cpfw_customer_address ?: ' ') . '",
    134144                    "customer_mobile": "' . trim($cpfw_customer_phone) . '",
    135                     "customer_name": "' . sanitize_text_field($cpfw_customer_name) . '",
     145                    "customer_name": "' . sanitize_text_field($cpfw_the_order->get_formatted_billing_full_name()) . '",
    136146                    "area": "' . $cpfw_customer_area . '",
    137                     "sub_area": "' . sanitize_text_field($cpfw_customer_address). '",
     147                    "sub_area": "' . sanitize_text_field($cpfw_the_order->get_billing_address_1()). '",
    138148                    "country": "' .sanitize_text_field($cpfw_the_order->get_billing_country()) . '",
    139149                    "country_code": "",
     150                    "note": '.wp_json_encode(wp_json_encode($content_array, JSON_UNESCAPED_UNICODE), JSON_UNESCAPED_UNICODE).',
    140151                    "order_reference": "' . $cpfw_the_order->get_id() . '",
    141152                    "product_info": ' . wp_json_encode(wp_json_encode($cpfw_products_detail, JSON_UNESCAPED_UNICODE), JSON_UNESCAPED_UNICODE) . ',
    142                     "package_cost": ' . $cpfw_the_order->get_total() . ',
    143                     "total_cod": ' . $cpfw_the_order->get_total() . '
     153                    "package_cost": ' . $cpfw_the_order->get_subtotal() . ',
     154                    "delivery_fee": "' . intval($cpfw_the_order->get_shipping_total() ?:0). '",
     155                    "total_cod": "' . intval($cpfw_the_order->get_total() ?: 0) . '",
     156                    "payment_method": "' . sanitize_text_field($cpfw_the_order->get_payment_method_title()) . '"
     157
    144158                    }]
    145159                }';
Note: See TracChangeset for help on using the changeset viewer.