Plugin Directory

Changeset 3043419


Ignore:
Timestamp:
03/01/2024 03:35:52 AM (2 years ago)
Author:
shipdepot
Message:

Update version 1.2.14 for switch classic checkout direction

Location:
ship-depot/trunk
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • ship-depot/trunk/includes/Address/frontend/class-custom-checkout-fields.php

    r3009769 r3043419  
    9898        {
    9999            //Ship_Depot_Logger::wrlog('[sd_woocommerce_default_address_fields] fields: ' . print_r($fields, true));
     100            if (!Ship_Depot_Address_Helper::can_shipping_vietnam()) {
     101                Ship_Depot_Logger::wrlog('[sd_woocommerce_default_address_fields] This page is not support shipping to Vietnam.');
     102                return $fields;
     103            }
     104
    100105            unset($fields['company']);
    101106            unset($fields['postcode']);
    102107            unset($fields['state']);
    103108            unset($fields['address_2']);
    104             if (!Ship_Depot_Address_Helper::can_shipping_vietnam()) return $fields;
    105109            $fields['first_name']['label'] = esc_html__('Tên', 'ship-depot-translate');
    106110
     
    135139    new Ship_Depot_Custom_fields();
    136140}
     141
     142
     143// add_filter('__experimental_woocommerce_blocks_register_checkout_field', 'custom_register_checkout_field');
     144
     145// function custom_register_checkout_field($fields)
     146// {
     147//     // Replace 'custom_field' with your desired field name
     148//     $fields['gov-id'] = array(
     149//         'label'         => 'Government ID',
     150//         'optionalLabel' => 'Government ID (optional)',
     151//         'location'      => 'address',
     152//         'required'      => true,
     153//         'attributes'    => array(
     154//             'autocomplete'     => 'government-id',
     155//             'aria-describedby' => 'some-element',
     156//             'aria-label'       => 'custom aria label',
     157//             'pattern'          => '[A-Z0-9]{5}', // A 5-character string of capital letters and numbers.
     158//             'title'            => 'Title to show on hover',
     159//             'data-custom'      => 'custom data',
     160//         ),
     161//     );
     162
     163//     return $fields;
     164// }
  • ship-depot/trunk/includes/Settings/class-ship-depot-settings-backend.php

    r3009769 r3043419  
    7373                //Tạm đóng chức năng này
    7474                // 'custom_css' => __('Thay đổi CSS', 'ship-depot-translate'),
    75                 'about' => __('Giới thiệu & Trợ giúp', 'ship-depot-translate')
     75                'about' => __('Giới thiệu & Trợ giúp', 'ship-depot-translate'),
     76                'classic_checkout_direction' => __('Hướng dẫn trở về Classic Checkout', 'ship-depot-translate')
    7677            );
    7778
     
    127128                        case 'about':
    128129                            do_action('sd_about_section');
     130                            break;
     131                        case 'classic_checkout_direction':
     132                            do_action('sd_classic_checkout_direction_section');
    129133                            break;
    130134                    }
  • ship-depot/trunk/includes/Settings/class-ship-depot-settings-init.php

    r3009769 r3043419  
    1414        require_once SHIP_DEPOT_DIR_PATH . 'includes/Settings/class-ship-depot-couriers.php';
    1515        require_once SHIP_DEPOT_DIR_PATH . 'includes/Settings/class-ship-depot-about.php';
     16        require_once SHIP_DEPOT_DIR_PATH . 'includes/Settings/class-ship-depot-classic-checkout-direction.php';
    1617        if (is_admin()) {
    1718            add_filter('woocommerce_get_settings_pages', array($this, 'add_woocommerce_settings_tab'), PHP_INT_MAX);
  • ship-depot/trunk/includes/class-ship-depot-general.php

    r3026645 r3043419  
    126126    {
    127127        add_action('admin_notices', array($this, 'check_notify_update_plugin'), 99);
     128        add_action('admin_notices', array($this, 'notify_switch_classic_checkout'), 99);
    128129        if (!Ship_Depot_Helper::is_woocommerce_activated()) {
    129130            add_action('admin_notices', array($this, 'no_woocommerce_deactivated'), 99);
     
    508509    }
    509510
     511    public function notify_switch_classic_checkout()
     512    { ?>
     513        <div class="vf-notice notice notice-error is-dismissible">
     514            <p>
     515                <?php
     516                printf(
     517                    esc_html__('%s cần phải chỉnh về classic checkout để tránh bị lỗi. Vui lòng vào %s để xem hướng dẫn.', 'ship-depot-translate'),
     518                    '<strong>' . esc_html__('Ship Depot for WooCommerce', 'ship-depot-translate') . '</strong>',
     519                    '<a href="' . esc_url(get_site_url() . '/wp-admin/admin.php?page=wc-settings&tab=sd_settings&section=classic_checkout_direction') . '">đây<strong></strong></a>'
     520                );
     521                ?>
     522
     523            </p>
     524        </div>
     525    <?php
     526    }
     527
    510528    public function auto_deactivate()
    511529    {
    512         ?>
     530    ?>
    513531<?php
    514532        $vf_plugin = '';
  • ship-depot/trunk/page/frontend/sd-checkout-page.php

    r3026645 r3043419  
    428428        $product = $item_product->get_product();
    429429        Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] product: ' . print_r($product, true));
     430        // $item_product = new WC_Order_Item_Product($item);
     431        // $product = new WC_Product($item_product->get_product_id());
    430432
    431433        $package_size = new Ship_Depot_Package();
     
    580582    Ship_Depot_Logger::wrlog('[sd_woocommerce_after_checkout_validation] data: ' . print_r($data, true));
    581583    Ship_Depot_Logger::wrlog('[sd_woocommerce_after_checkout_validation] _POST: ' . print_r($_POST, true));
     584    // if (isset($_POST['sd_call_validate']) && sanitize_text_field($_POST['sd_call_validate']) == '1') {
     585    //     Ship_Depot_Logger::wrlog('[sd_woocommerce_after_checkout_validation] sd_call_validate: ' . print_r(sanitize_text_field($_POST['sd_call_validate']), true));
     586    //     Ship_Depot_Logger::wrlog('[sd_woocommerce_after_checkout_validation] add fake error');
     587    //     //Add fake error
     588    //     wc_add_notice(__("custom_notice", 'fake_error'), 'error');
     589    // }
    582590    //Check address
    583591    if (isset($data['ship_to_different_address']) && sanitize_text_field($data['ship_to_different_address']) == '1') {
  • ship-depot/trunk/readme.txt

    r3027204 r3043419  
    33Tags: shipping, couriers, ghn, ghtk, aha
    44Requires at least: 6.1.1
    5 Tested up to: 6.4.2
     5Tested up to: 6.4.3
    66Requires PHP: 7.4.3
    7 Stable tag: 1.2.13
     7Stable tag: 1.2.14
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    6565
    6666== Changelog ==
     67= 1.2.14 =
     68* Thêm phần hướng dẫn chỉnh về Classic Checkout trong trang Cài Đặt của Ship Depot.
     69
    6770= 1.2.13 =
    6871* Sửa một số lỗi nhỏ.
Note: See TracChangeset for help on using the changeset viewer.