Plugin Directory

Changeset 3238543


Ignore:
Timestamp:
02/11/2025 12:15:13 PM (13 months ago)
Author:
cedcommerce
Message:

version update

Location:
marketplace-integration-for-shopee-and-lazada
Files:
156 added
8 edited

Legend:

Unmodified
Added
Removed
  • marketplace-integration-for-shopee-and-lazada/trunk/README.txt

    r3236554 r3238543  
    66WC requires at least: 7.0.0
    77WC tested up to: 9.0.0
    8 Stable tag: 1.0.0
     8Stable tag: 1.0.1
    99License: GPLv3 or later
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    100100== Changelog ==
    101101
    102 = 1.0.0 =
    103 * First version
     102= 1.0.1 =
     103* Bug fix
    104104
    105105
  • marketplace-integration-for-shopee-and-lazada/trunk/marketplace-integration-for-shopee-and-lazada.php

    r3236554 r3238543  
    44 * Plugin URI:        https://woocommerce.com/vendor/cedcommerce/
    55 * Description:       Connect your WooCommerce Store to SEA marketplaces like Shopee and Lazada.
    6  * Version:           1.0.0
     6 * Version:           1.0.1
    77 * Requires at least: 5.8
    88 * Requires PHP:      7.4
  • marketplace-integration-for-shopee-and-lazada/trunk/marketplaces/shopee/admin/js/ced_shopee_cat.js

    r3236554 r3238543  
    262262                    let shopee_store_id = $("#shopee_shop_id").val();
    263263                    var form_data = $('form').serialize();
     264                    // console.log(store_category_array);
     265                    // console.log(shopee_category_array);
     266                    // console.log(shopee_category_name);
     267                    // console.log(shopee_store_id);
     268                    // console.log(form_data);
     269                    // alert();
    264270                    $.ajax(
    265271                        {
     
    282288                                var html = "<div class='notice notice-success'><p>Profile Created Successfully</p></div>";
    283289                                $("#profile_create_message").html(html);
    284                                 window.setTimeout(function () { window.location.reload() }, 2000);
     290                                // window.setTimeout(function () { window.location.reload() }, 2000);
    285291                            }
    286292                        }
  • marketplace-integration-for-shopee-and-lazada/trunk/marketplaces/shopee/admin/partials/ced-shopee-metakeys-list.php

    r3236554 r3238543  
    4242$metakey_html = ced_shopee_render_html( $meta_keys_to_be_displayed, $added_meta_keys );
    4343$data = array(
    44     'html' => wp_kses_post($metakey_html),
     44    'html' => $metakey_html,
    4545);
    4646
  • marketplace-integration-for-shopee-and-lazada/trunk/marketplaces/shopee/admin/partials/profile-edit-view.php

    r3236554 r3238543  
    5454
    5555    if (isset($_POST['ced_shopee_required_common'])) {
     56
    5657        $post_array = filter_input_array(INPUT_POST, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
     58
    5759        foreach (($post_array['ced_shopee_required_common']) as $key) {
    5860            $array_to_save = array();
     
    8486
    8587    $updateinfo = wp_json_encode($profile_data);
    86     // print_r($updateinfo);
    87     // die();
     88
    8889    if ($profile_id) {
    8990        global $wpdb;
     
    106107    $profile_category_data = json_decode($profile_data[0]['profile_data'], true);
    107108}
    108 // echo '<pre>';
    109 // print_r($profile_data);
    110 // die();
     109
    111110$profile_category_data = isset($profile_category_data) ? $profile_category_data : '';
    112111$profile_category_id = isset($profile_category_data['_umb_shopee_category']['default']) ? $profile_category_data['_umb_shopee_category']['default'] : '';
     
    180179    <form method='POST'>
    181180        <?php
    182         if (isset($_GET['profileID']) && $_GET['profileID'] == $profile_data['id']) {
    183181            wp_nonce_field('profile_creation', 'profile_creation_submit');
    184         }
    185182        ?>
    186183
     
    386383                                                $fields = $product_field_instance->ced_shopee_get_required_fields($shopee_shop_id, $profile_category_id, $remote_shop_id);
    387384                                                $saved_data = $profile_category_data;
    388                                                 // echo '<pre>';
    389                                                 // print_r($saved_data);
    390                                                 // die();
     385
    391386                                                foreach ($fields as $value) {
    392387                                                    // print_r($fields);
     
    924919            ?>
    925920                <button style='float: right;'
    926                     class='button-primary components-button is-primary' id="ced_shopee_save_category_button">Save Template</button>
     921                    class='button-primary components-button is-primary' id="ced_shopee_save_category_button" value="<?php echo $shopee_shop_id ?>">Save Template</button>
    927922            <?php } ?>
    928923        </div>
  • marketplace-integration-for-shopee-and-lazada/trunk/marketplaces/shopee/admin/shopee/class-class-ced-shopee-manager.php

    r3236554 r3238543  
    292292                    $profile_name = isset($shopee_mapped_categories_name[$value]) ? $shopee_mapped_categories_name[$value] : 'Profile for Shopee - Category Id : ' . $value;
    293293                    $profile_exists = $this->ced_shopee_check_profile_exists($key, $value, $shopee_store_id, $profile_name);
    294 
     294// print_r($form_data);
    295295                    $profile_data = array();
    296296                    $profile_data = $this->ced_shopee_prepare_profile_data($shopee_store_id, $value, $form_data);
    297 
     297                    // print_r($profile_data);
     298                    // die();
    298299                    /*
    299300                    Group profiles
     
    304305
    305306                    $is_active = 1;
    306                     $marketplace_name = 'Shopee';
     307                    $marketplace_name = 'shopee';
    307308                    $woo_categories = array($key);
    308309
     
    314315                        'woo_categories' => wp_json_encode($woo_categories),
    315316                    );
    316 
     317                    // print_r($profile_details);
     318                    // die();
    317319                    $profile_id = $this->insert_shopee_profile($profile_details);
    318320                    foreach ($woo_categories as $key12 => $value12) {
     
    396398         */
    397399        public function ced_shopee_prepare_profile_data($shopee_store_id, $shopee_category_id, $post_array)
    398         {
     400        {
     401            $post_array = filter_input_array(INPUT_POST, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
     402
    399403            foreach (($post_array['ced_shopee_required_common']) as $key) {
     404                // print_r($key);
     405                // die();
    400406                $array_to_save = array();
    401407
    402408                isset($post_array[$key][0]) ? $array_to_save['default'] = $post_array[$key][0] : $array_to_save['default'] = '';
    403409
    404                 if ('_umb_' . $marketplace_name . '_subcategory' == $key) {
     410                if ('_umb_shopee_subcategory' == $key) {
    405411                    isset($post_array[$key]) ? $array_to_save['default'] = $post_array[$key] : $array_to_save['default'] = '';
    406412                }
     
    408414                    isset($post_array[$key][0]) ? $array_to_save['default'] = $post_array[$key] : $array_to_save['default'] = '';
    409415                }
    410                 if ('_umb_shopee_category' == $key && empty($profile_id)) {
     416                if ('_umb_shopee_category' == $key) {
     417
    411418                    $category_id = isset($post_array['ced_shopee_level3_category']) ? $post_array['ced_shopee_level3_category'] : '';
    412419                    $category_id = isset($category_id[0]) ? $category_id[0] : '';
     
    418425            }
    419426            $profile_data = array();
    420 
     427   
    421428            foreach ($updateinfo as $key => $value) {
    422429
     
    653660        public function ced_shopee_store_categories($categories, $shopee_shop_id)
    654661        {
    655             print_r($categories);
    656662            $base_dir = wp_upload_dir()['basedir'];
    657663            $folder_name = $base_dir . '/cedcommerce/Shopee/Categories/';
  • marketplace-integration-for-shopee-and-lazada/trunk/marketplaces/shopee/admin/shopee/lib/class-class-ced-shopee-category.php

    r3236554 r3238543  
    144144        }
    145145
    146         // /**
    147         //  * Function for getting shopee categories
    148         //  *
    149         //  * @since 1.0.0
    150         //  * @param int $shop_id Shopee Shop Id.
    151         //  */
    152         // public function get_shopee_category($remote_shop_id = '')
    153         // {
    154         //  if (empty($remote_shop_id)) {
    155         //      return;
    156         //  }
    157         //  $action     = 'get_category';
    158         //  $parameters =
    159         //      array(
    160         //          'shop_id' => $remote_shop_id
    161         //      );
    162         //  $body_param = array();
    163         //  $categories = $this->shopee_remote_request_instance->shopee_remote_request($action, $parameters, $remote_shop_id, 'GET', $body_param);
    164         //  $categories = json_decode($categories['body'], true);
    165         //  if (isset($categories['data']['response']) && !empty($categories['data']['response'])) {
    166         //      return $categories['data'];
    167         //  }
    168         // }
    169146
    170147        /**
  • marketplace-integration-for-shopee-and-lazada/trunk/marketplaces/shopee/admin/shopee/lib/class-class-ced-shopee-remote-request.php

    r3236554 r3238543  
    6868    {
    6969        $url = CED_VALIDATOR_URL;
    70         $token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjaGFubmVsIjoid29vY29tbWVyY2Vfc2VhIiwiY2hlY2tvdXRfaW5pdGlhdGVkIjp0cnVlLCJkb21haW4iOiJodHRwczovL2Zpc2hpbmdzdXBwbGllc3RoYWlsYW5kLmNvbSIsImVtYWlsIjoiZGFyZW5AZmlzaGluZ3N1cHBsaWVzdGhhaWxhbmQuY29tIiwibWFya2V0cGxhY2VzIjpbIlNob3BlZSIsIkxhemFkYSJdLCJwbGFuX3BlcmlvZCI6Im1vbnRoIiwicGxhbl90eXBlIjoic2hvcGVlLWxhemFkYS1hZHZhbmNlLW1vbnRobHktVVNELU1vbnRobHkiLCJzdGF0ZSI6ImFjdGl2ZSIsInN1YnNjcmlwdGlvbl9pZCI6IkF6cVVGU1VXQUpmNzhBNlNtIn0.DkNvBS8Z9SkGvd43AXvhozyOOXWYKezyEEjdSwPUFBQ';
    7170        if ($method === 'POST') {
    7271            $body = wp_json_encode(array_filter([
     
    7574                'body' =>  $parameters, // empty object
    7675                'method' => $method,
    77                 'domain' => 'https://fishingsuppliesthailand.com',
     76                'domain' => site_url(),
    7877            ]));
    7978        } else {
     
    8382                'query_params' =>  $parameters,
    8483                'method' => $method,
    85                 'domain' => 'https://fishingsuppliesthailand.com',
     84                'domain' => site_url(),
    8685            ]));
    8786        }
     
    9089            'headers'     => [
    9190                'Content-Type' => 'application/json',
    92                 'Authorization' => 'Bearer ' . $token,
     91                'Authorization' => 'Bearer ' . CED_SEA_TOKEN,
    9392                'Product' => 'shopee'
    9493            ],
     
    9998
    10099        $response = wp_remote_post($url, $args);
     100        // print_r($response);
     101        // die();
    101102        return $response;
    102103    }
     
    142143    public function ced_remote_products_cap_request($marketplace, $product_ids)
    143144    {
    144         $token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjaGFubmVsIjoid29vY29tbWVyY2Vfc2VhIiwiY2hlY2tvdXRfaW5pdGlhdGVkIjp0cnVlLCJkb21haW4iOiJodHRwczovL2Zpc2hpbmdzdXBwbGllc3RoYWlsYW5kLmNvbSIsImVtYWlsIjoiZGFyZW5AZmlzaGluZ3N1cHBsaWVzdGhhaWxhbmQuY29tIiwibWFya2V0cGxhY2VzIjpbIlNob3BlZSIsIkxhemFkYSJdLCJwbGFuX3BlcmlvZCI6Im1vbnRoIiwicGxhbl90eXBlIjoic2hvcGVlLWxhemFkYS1hZHZhbmNlLW1vbnRobHktVVNELU1vbnRobHkiLCJzdGF0ZSI6ImFjdGl2ZSIsInN1YnNjcmlwdGlvbl9pZCI6IkF6cVVGU1VXQUpmNzhBNlNtIn0.DkNvBS8Z9SkGvd43AXvhozyOOXWYKezyEEjdSwPUFBQ';
     145       
    145146        $response = wp_remote_request(
    146147            CED_SHOPEE_PRODUCT_CAP_URL,
     
    153154                        'topic'       => 'products_count',
    154155                        'product_ids'   => array_unique($product_ids),
    155                         'domain'      => 'https://fishingsuppliesthailand.com',
     156                        'domain'      => site_url(),
    156157                        'marketplace' => $marketplace,
    157158                    )
     
    162163                    'Accept'        => 'application/json',
    163164                    'Product'       => 'shopee',
    164                     'Authorization' => 'Bearer ' . $token,
     165                    'Authorization' => 'Bearer ' . CED_SEA_TOKEN,
    165166                    // 'Product-type'  => 'native',
    166167                ),
Note: See TracChangeset for help on using the changeset viewer.