From b9d69bf546f0f0b1d88a44c391464e820a4c0f8b Mon Sep 17 00:00:00 2001 From: Dat Hoang Date: Thu, 5 Apr 2018 22:43:46 +0700 Subject: [PATCH 01/13] Start verion 1.4 --- woo-viet.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/woo-viet.php b/woo-viet.php index 60f0403..d0e118c 100644 --- a/woo-viet.php +++ b/woo-viet.php @@ -7,7 +7,7 @@ * Author URI: https://profiles.wordpress.org/htdat * Text Domain: woo-viet * Domain Path: /languages - * Version: 1.3.1 + * Version: 1.4-dev * License: GPLv2+ */ From 1ad14ee9b898412432cd75dee7bc6b802d0ceb0a Mon Sep 17 00:00:00 2001 From: Long Date: Sat, 7 Apr 2018 20:53:45 +0700 Subject: [PATCH 02/13] Fix Order status error #37 --- inc/class-wooviet-vnd-paypal-standard.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/inc/class-wooviet-vnd-paypal-standard.php b/inc/class-wooviet-vnd-paypal-standard.php index a515164..74f9861 100644 --- a/inc/class-wooviet-vnd-paypal-standard.php +++ b/inc/class-wooviet-vnd-paypal-standard.php @@ -43,6 +43,9 @@ class WooViet_VND_PayPal_Standard { // Add the exchange rate info for this gateway in the checkout page before proceeding in the PayPal pages add_filter( 'option_woocommerce_paypal_settings', array( $this, 'add_exchange_rate_info' ), 11 ); + + // Match currency of Paypal with local order + add_action( 'valid-paypal-standard-ipn-request', array( $this, 'match_currency_order' ), 10 ); } /** @@ -107,4 +110,18 @@ class WooViet_VND_PayPal_Standard { return $value; } + /* + * Match response currency from Paypal IPN with the order + * + * Topic https://wordpress.org/support/topic/loi-order-bi-on-hold/ + * + * @author Longkt + * @since 1.4 + */ + public function match_currency_order($posted) { + if($posted['mc_currency']) { + $posted['mc_currency'] = $order->get_currency(); + } + } + } \ No newline at end of file From cf7bf361c1178a1353800c4edab58acab03b7f50 Mon Sep 17 00:00:00 2001 From: longnguyen Date: Mon, 16 Apr 2018 21:59:23 +0700 Subject: [PATCH 03/13] Improve order checkout page #17 (#43) Issue #17 - Arrange the address fields to the Vietnam standard: Country - Province - District - Address --- assets/provinces.css | 48 +++++++++++++++++++++++++++++++++ assets/provinces.js | 14 ++++++++++ inc/class-wooviet-provinces.php | 17 ++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 assets/provinces.css create mode 100644 assets/provinces.js diff --git a/assets/provinces.css b/assets/provinces.css new file mode 100644 index 0000000..4c8a0de --- /dev/null +++ b/assets/provinces.css @@ -0,0 +1,48 @@ +.woocommerce-billing-fields__field-wrapper.active { + display: flex; + flex-wrap: wrap; +} + +#billing_first_name_field { + order: 1; +} + +#billing_last_name_field { + order: 2; +} + +#billing_company_field { + order: 3; +} + +#billing_country_field { + order: 4; +} + +#billing_state_field { + order: 5; +} + +#billing_city_field { + order: 6; +} + +#billing_address_1_field { + order: 7; +} + +#billing_address_2_field { + order: 8; +} + +#billing_postcode_field { + order: 9; +} + +#billing_phone_field { + order: 10; +} + +#billing_email_field { + order: 11; +} \ No newline at end of file diff --git a/assets/provinces.js b/assets/provinces.js new file mode 100644 index 0000000..27dc594 --- /dev/null +++ b/assets/provinces.js @@ -0,0 +1,14 @@ +(function($) { + $('#billing_country_field').on('change', function() { + + // Get country code + var country_code = $(this).find('#billing_country').val(); + + // Match country code with Vietnam + if(country_code == 'VN') { + $('.woocommerce-billing-fields__field-wrapper').addClass('active'); + } else { + $('.woocommerce-billing-fields__field-wrapper').removeClass('active'); + } + }) +})(jQuery) \ No newline at end of file diff --git a/inc/class-wooviet-provinces.php b/inc/class-wooviet-provinces.php index 6251375..bff188b 100644 --- a/inc/class-wooviet-provinces.php +++ b/inc/class-wooviet-provinces.php @@ -21,6 +21,9 @@ class WooViet_Provinces { add_filter( 'woocommerce_states', array( $this, 'add_provinces' ) ); add_filter( 'woocommerce_get_country_locale', array( $this, 'edit_vn_locale' ) ); add_filter( 'woocommerce_localisation_address_formats', array( $this, 'edit_vn_address_formats' ) ); + + // Enqueue province scripts + add_action( 'wp_enqueue_scripts', array( $this, 'load_provinces_scripts' ) ); } /** @@ -136,4 +139,18 @@ class WooViet_Provinces { return $states; } + + /** + * Enqueue provinces scripts + * + * @author Longkt + * @since 1.4 + */ + public function load_provinces_scripts() { + // Enqueue province style + wp_enqueue_style( 'woo-viet-provinces-style', WOO_VIET_URL . 'assets/provinces.css' ); + + // Enqueue province script + wp_enqueue_script( 'woo-viet-provinces-script', WOO_VIET_URL . 'assets/provinces.js', array( 'jquery' ), '1.0', true ); + } } \ No newline at end of file From 137f0d2ac8a8f86b6920b7cbc232eca28ceeed7a Mon Sep 17 00:00:00 2001 From: Dat Hoang Date: Mon, 16 Apr 2018 22:19:32 +0700 Subject: [PATCH 04/13] Clarify the purpose of the scripts --- inc/class-wooviet-provinces.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/inc/class-wooviet-provinces.php b/inc/class-wooviet-provinces.php index bff188b..c7f9b95 100644 --- a/inc/class-wooviet-provinces.php +++ b/inc/class-wooviet-provinces.php @@ -6,8 +6,6 @@ if ( ! defined( 'ABSPATH' ) ) { /** * The class to handle Vietnam Provinces * - * @todo Arrange the orders of fields displaying in the checkout page: Country - Province - District - Address - * * @author htdat * @since 1.0 * @@ -143,6 +141,7 @@ class WooViet_Provinces { /** * Enqueue provinces scripts * + * Arrange the address field orders to the Vietnam standard in the checkout page: Country - Province - District - Address * @author Longkt * @since 1.4 */ @@ -153,4 +152,4 @@ class WooViet_Provinces { // Enqueue province script wp_enqueue_script( 'woo-viet-provinces-script', WOO_VIET_URL . 'assets/provinces.js', array( 'jquery' ), '1.0', true ); } -} \ No newline at end of file +} From ae4743a2f27d26686ff26c6e7d36bc64a14085cb Mon Sep 17 00:00:00 2001 From: Dat Hoang Date: Mon, 16 Apr 2018 22:41:16 +0700 Subject: [PATCH 05/13] Fix the small typo - #33 --- inc/class-wooviet-notices.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/class-wooviet-notices.php b/inc/class-wooviet-notices.php index ebb0588..25e339f 100644 --- a/inc/class-wooviet-notices.php +++ b/inc/class-wooviet-notices.php @@ -86,7 +86,7 @@ class WooViet_Notices { $line1 = __( 'Please help us to improve Woo Viet.', 'woo-viet' ); $line2 = __( 'Rate us!', 'woo-viet' ); - $line3 = __( 'Or run a short survery:', 'woo-viet' ); + $line3 = __( 'Or run a short survey:', 'woo-viet' ); $line4 = 'tiếng Việt - English'; $line5 = __( 'Dismiss this notice', 'woo-viet' ); $link = admin_url( 'admin.php?page=woo-viet&wooviet_dismiss=displaying_survey_after_4_weeks' ); @@ -104,4 +104,4 @@ class WooViet_Notices { ', $line1, $line2, $line3, $line4, $line5, $link ); } -} \ No newline at end of file +} From 09611435ded86591a8df3328a7afef6a156066a5 Mon Sep 17 00:00:00 2001 From: Dat Hoang Date: Tue, 17 Apr 2018 16:32:15 +0700 Subject: [PATCH 06/13] Change the notice to "warning", which is more correct --- woo-viet.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/woo-viet.php b/woo-viet.php index d0e118c..9cacca8 100644 --- a/woo-viet.php +++ b/woo-viet.php @@ -90,7 +90,7 @@ class WooViet { * Throw a notice if WooCommerce is NOT active */ public function notice_if_not_woocommerce() { - $class = 'notice notice-error'; + $class = 'notice notice-warning'; $message = __( 'Woo Viet is not running because WooCommerce is not active. Please activate both plugins.', 'woo-viet' ); @@ -224,4 +224,4 @@ class WooViet { } -} \ No newline at end of file +} From fe715598798c2f8099dc9efc93fdfd4566022ea2 Mon Sep 17 00:00:00 2001 From: longnguyen Date: Wed, 18 Apr 2018 21:57:32 +0700 Subject: [PATCH 07/13] Add Settings link when plugin is active #41 (#48) --- woo-viet.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/woo-viet.php b/woo-viet.php index 9cacca8..50fbb10 100644 --- a/woo-viet.php +++ b/woo-viet.php @@ -109,6 +109,9 @@ class WooViet { if ( class_exists( 'WooCommerce' ) ) { // Run this plugin normally if WooCommerce is active $this->main(); + + // Add "Settings" link when the plugin is active + add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array( $this, 'add_settings_link' ) ) ; } else { // Throw a notice if WooCommerce is NOT active add_action( 'admin_notices', array( $this, 'notice_if_not_woocommerce' ) ); @@ -224,4 +227,17 @@ class WooViet { } + /** + * Add "Settings" link in the Plugins list page when the plugin is active + * + * @since 1.4 + * @author Longkt + */ + public function add_settings_link( $links ) { + $settings = array( '' . __( 'Settings', 'woo-viet' ) . '' ); + $links = array_reverse( array_merge( $links, $settings ) ); + + return $links; + } + } From 0e4e78a89ab0a54449039be0e460199db1dcd63e Mon Sep 17 00:00:00 2001 From: longnguyen Date: Sun, 22 Apr 2018 21:04:26 +0700 Subject: [PATCH 08/13] Fix bug OnePay domestic gateway #45 (#50) --- inc/class-wooviet-onepay-domestic.php | 45 ++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/inc/class-wooviet-onepay-domestic.php b/inc/class-wooviet-onepay-domestic.php index ad39401..62a3c87 100644 --- a/inc/class-wooviet-onepay-domestic.php +++ b/inc/class-wooviet-onepay-domestic.php @@ -255,22 +255,53 @@ class WooViet_OnePay_Domestic extends WC_Payment_Gateway { ); $order->add_order_note( $order_note ); - // If the payment is successful, update the order - if ( "0" == $vpc_TxnResponseCode ) { - $order->payment_complete(); + + // Do action for the order based on the response code from OnePay + // This is an intentional DRY switch - refer to #DRY_vpc_TxnResponseCode below + switch ( $vpc_TxnResponseCode ) { + case '0': + // If the payment is successful, update the order + $order->payment_complete(); + break; + case '99': + // If the user cancels payment, cancel the order + $order->cancel_order(); + break; + default: + // For other cases, do nothing. By default, the order status is still "Pending Payment" + break; } + // Log data $message_log = sprintf('process_onepay_response_data - Order ID: %1$s - Order Note: %2$s - http_args: %3$s', $order_id, $order_note, print_r($args, true) ); self::log( $message_log); - // Return the info switch ( $type ) { - case 'return': - wp_redirect( $this->get_return_url( $order ) ); + case 'return': // Add info from OnePay and redirect to the appropriate URLs + + wc_add_notice( __( 'OnePay info: ', 'woo-viet') . $this->OnePay_getResponseDescription( $vpc_TxnResponseCode ), 'notice' ); + + // This is an intentional DRY switch - refer to #DRY_vpc_TxnResponseCode above + // I need to make sure that `ipn` case below and message_log can be executed as well. + switch ( $vpc_TxnResponseCode ) { + case '0': + // If the payment is successful, redirect to the order page + wp_redirect( $this->get_return_url( $order ) ); + break; + case '99': + // If the user cancels payment, redirect to the canceled cart page + wp_redirect( $order->get_cancel_order_url_raw() ); + break; + default: + // For other cases, redirect to the payment page + wp_redirect( $order->get_checkout_payment_url () ); + break; + } + break; - case 'ipn': + case 'ipn': // Output the data to the page content exit( 'responsecode=1&desc=confirm-success' ); break; From 9c371f6d743701643398ebf7953a131ce05bf5e0 Mon Sep 17 00:00:00 2001 From: Dat Hoang Date: Sun, 22 Apr 2018 21:10:20 +0700 Subject: [PATCH 09/13] Add the comment to make clear for "switch ( $type )" --- inc/class-wooviet-onepay-domestic.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/class-wooviet-onepay-domestic.php b/inc/class-wooviet-onepay-domestic.php index 62a3c87..e763c66 100644 --- a/inc/class-wooviet-onepay-domestic.php +++ b/inc/class-wooviet-onepay-domestic.php @@ -275,7 +275,8 @@ class WooViet_OnePay_Domestic extends WC_Payment_Gateway { // Log data $message_log = sprintf('process_onepay_response_data - Order ID: %1$s - Order Note: %2$s - http_args: %3$s', $order_id, $order_note, print_r($args, true) ); self::log( $message_log); - + + // Do the last actions based on $type switch ( $type ) { case 'return': // Add info from OnePay and redirect to the appropriate URLs From 68752ae2155941b418f07458bae892e493006e9d Mon Sep 17 00:00:00 2001 From: longnguyen Date: Tue, 24 Apr 2018 22:36:04 +0700 Subject: [PATCH 10/13] Support PayPal Express Checkout #27 (#46) --- inc/class-wooviet-admin-page.php | 36 ++++ ...ss-wooviet-vnd-paypal-express-checkout.php | 180 ++++++++++++++++++ woo-viet.php | 16 ++ 3 files changed, 232 insertions(+) create mode 100644 inc/class-wooviet-vnd-paypal-express-checkout.php diff --git a/inc/class-wooviet-admin-page.php b/inc/class-wooviet-admin-page.php index 4f10bc4..08c33e4 100644 --- a/inc/class-wooviet-admin-page.php +++ b/inc/class-wooviet-admin-page.php @@ -239,6 +239,42 @@ class WooViet_Admin_Page { + + the PayPal Express Checkout gateway', 'woo-viet' ), 'https://docs.woocommerce.com/document/paypal-express-checkout/' ) ?> + + + > + + +

+ + +
+
+ + +
+ + diff --git a/inc/class-wooviet-vnd-paypal-express-checkout.php b/inc/class-wooviet-vnd-paypal-express-checkout.php new file mode 100644 index 0000000..435afb0 --- /dev/null +++ b/inc/class-wooviet-vnd-paypal-express-checkout.php @@ -0,0 +1,180 @@ +ppec_exchange_rate = (int) $ppec_exchange_rate; + $this->ppec_currency = $ppec_currency; + + $this->ppec_description = sprintf( __( 'The prices will be converted to %1$s in the PayPal Express Checkout pages with the exchange rate %2$s.', 'woo-viet' ), + " $this->ppec_currency", + " $this->ppec_currency / VND = $this->ppec_exchange_rate" + ); + + // Match response currency of PayPal with local order + add_action( 'woocommerce_paypal_express_checkout_valid_ipn_request', array( $this, 'ppec_match_currency_order' ) ); + + // Add exchange rate before send request to PayPal + add_filter( 'woocommerce_paypal_express_checkout_request_body', array( $this, 'ppec_convert_prices' ) ); + + // Load the method to add the exchange rate info for this gateway + $this->ppec_exchange_rate_info(); + + } + + /** + * Match response currency from PayPal with the order + * + * @param $posted_data + */ + public function ppec_match_currency_order( $posted_data ) { + + if( $posted_data['mc_currency'] ) { + $posted_data['mc_currency'] = $order->get_currency(); + } + + } + + /** + * @param $params + * @return mixed + */ + public function ppec_convert_prices( $params ) { + + if( isset( $params['PAYMENTREQUEST_0_CURRENCYCODE'] ) ) { + + $params['PAYMENTREQUEST_0_CURRENCYCODE'] = $this->ppec_currency; + + if( isset( $params['PAYMENTREQUEST_0_AMT'] ) ) { + $params['PAYMENTREQUEST_0_AMT'] = round( $params['PAYMENTREQUEST_0_AMT'] / $this->ppec_exchange_rate, 2 ); + } + + if( isset( $params['PAYMENTREQUEST_0_ITEMAMT'] ) ) { + $params['PAYMENTREQUEST_0_ITEMAMT'] = round( $params['PAYMENTREQUEST_0_ITEMAMT'] / $this->ppec_exchange_rate, 2 ); + } + + if( isset( $params['PAYMENTREQUEST_0_SHIPPINGAMT'] ) ) { + $params['PAYMENTREQUEST_0_SHIPPINGAMT'] = round( $params['PAYMENTREQUEST_0_SHIPPINGAMT'] / $this->ppec_exchange_rate, 2 ); + } + + if( isset( $params['PAYMENTREQUEST_0_TAXAMT'] ) ) { + $params['PAYMENTREQUEST_0_TAXAMT'] = round( $params['PAYMENTREQUEST_0_TAXAMT'] / $this->ppec_exchange_rate, 2 ); + } + + if( isset( $params['PAYMENTREQUEST_0_SHIPDISCAMT'] ) ) { + $params['PAYMENTREQUEST_0_SHIPDISCAMT'] = round( $params['PAYMENTREQUEST_0_SHIPDISCAMT'] / $this->ppec_exchange_rate, 2 ); + } + + $count = 0; + + while( isset( $params['L_PAYMENTREQUEST_0_AMT' . $count] ) ) { + $params['L_PAYMENTREQUEST_0_AMT' . $count] = round( $params['L_PAYMENTREQUEST_0_AMT' . $count] / $this->ppec_exchange_rate, 2 ); + $count++; + } + } + + return $params; + + } + + /** + * Add the exchange rate info in the suitable locations before proceeding in the PayPal pages + */ + public function ppec_exchange_rate_info() { + + // Check if "Checkout on cart page" is enabled. + if( 'yes' === wc_gateway_ppec()->settings->cart_checkout_enabled ) { + add_action( 'woocommerce_proceed_to_checkout', array( $this, 'add_ppec_button_exchange_rate_info' ), 30 ); + } + + // Check if "Checkout on Single Product" is enabled. + if( 'yes' === wc_gateway_ppec()->settings->checkout_on_single_product_enabled ) { + add_action( 'woocommerce_after_add_to_cart_form', array( $this, 'add_ppec_button_exchange_rate_info' ), 30 ); + } + + // Check if "Enable PayPal Credit" is enabled. + if( 'yes' === wc_gateway_ppec()->settings->credit_enabled ) { + add_filter( 'woocommerce_paypal_express_checkout_settings', array( $this, 'add_paypal_credit_exchange_rate_info' ), 11 ); + } + + // Add the exchange rate info for PPEC in Checkout page + add_filter( 'option_woocommerce_ppec_paypal_settings', array( $this, 'add_ppec_checkout_exchange_rate_info' ), 11 ); + + } + + /** + * Display the exchange rate info of PPEC in Cart and Single Product page + */ + public function add_ppec_button_exchange_rate_info() { + + echo '

' . $this->ppec_description . '

'; + + } + + /** + * Display the exchange rate info of PP Credit in Checkout page + * + * @param $value + * @return mixed + */ + public function add_paypal_credit_exchange_rate_info( $value ) { + + if ( ! is_admin() ) { + $value['description']['default'] .= '
'; + $value['description']['default'] .= $this->ppec_description; + } + + return $value; + } + + /** + * Display the exchange rate info of PPEC in Checkout page + * + * @param $value + * @return mixed + */ + public function add_ppec_checkout_exchange_rate_info( $value ) { + + if ( ! is_admin() ) { + $value['description'] .= '
'; + $value['description'] .= $this->ppec_description; + } + return $value; + + } + +} \ No newline at end of file diff --git a/woo-viet.php b/woo-viet.php index 50fbb10..8c895b1 100644 --- a/woo-viet.php +++ b/woo-viet.php @@ -64,6 +64,12 @@ class WooViet { array( 'enabled' => 'yes', ), + 'vnd_paypal_express_checkout' => + array( + 'enabled' => 'yes', + 'currency' => 'USD', + 'rate' => '22770', + ), ); /** * The properties to manage all classes under the "inc/" folder @@ -76,6 +82,7 @@ class WooViet { protected $Currency; protected $VND_PayPal_Standard; protected $Admin_Page; + protected $VND_PayPal_Express_Checkout; /** * Setup class. @@ -199,6 +206,15 @@ class WooViet { ); } + // Check if "Support VND for the PayPal Express Checkout gateway" is enabled + if ( 'yes' == $settings['vnd_paypal_express_checkout']['enabled'] ) { + include( WOO_VIET_DIR . 'inc/class-wooviet-vnd-paypal-express-checkout.php' ); + $this->VND_PayPal_Express_Checkout = new WooViet_VND_PayPal_Express_Checkout( + $settings['vnd_paypal_express_checkout']['rate'], + $settings['vnd_paypal_express_checkout']['currency'] + ); + } + } /** From 2441ff16a92c6f3faae52ce8b8e3beb9dfa56aea Mon Sep 17 00:00:00 2001 From: Dat Hoang Date: Tue, 24 Apr 2018 23:30:06 +0700 Subject: [PATCH 11/13] Ingore PHPStorm files --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 1660023..5c24593 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,7 @@ Thumbs.db # Temporary folders /_temp + +# PHPStorm + +/.idea \ No newline at end of file From 4eeb5c8d60de8419bfdb50f20d056d706efc355d Mon Sep 17 00:00:00 2001 From: Dat Hoang Date: Tue, 24 Apr 2018 23:34:25 +0700 Subject: [PATCH 12/13] Add change logs and update the version --- readme.txt | 41 ++++++++++++++++++----------------------- woo-viet.php | 6 +++++- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/readme.txt b/readme.txt index 693ff4c..08942d3 100644 --- a/readme.txt +++ b/readme.txt @@ -1,9 +1,10 @@ === Woo Viet - WooCommerce for Vietnam === -Contributors: htdat, thup90 +Contributors: htdat, thup90, longnguyen Tags: OnePay WooCommerce, OnePay Vietnam, WooCommerce Vietnam, vietnam, vietnamese, vietnam provinces, paypal for vietnam dong, vnd, vietnam dong, vietnam currency, vietnam customization Requires at least: 4.3 -Tested up to: 4.8 -Stable tag: 1.3.1 +Tested up to: 4.9.5 +Requires PHP: 5.6 +Stable tag: 1.4 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -21,17 +22,17 @@ Add [the OnePay domestic (local ATM cards) gateway](http://onepay.com.vn/). = FEATURES = * Change the VND currency symbol `đ` to anything, e.g: `VND`, `VNĐ`, `đồng`, etc. -* Add provinces for Vietnam when visitors select Vietnam as a country of the shipping (billing) address. This is not available in WooCommerce by default. +* Add provinces for Vietnam when visitors select Vietnam as a country of the shipping (billing) address. Arrange the address fields to the Vietnam standard: Country - Province - District - Address. * Add districts to Vietnam provinces. * Convert `000` of prices to `K` (or anything). E.g: `50000` (VND) will be `50K` (VND), or `50 thousand` (VND). * Support `VND` for [the PayPal Standard gateway](https://docs.woocommerce.com/document/paypal-standard/). Convert `VND` prices to any PayPal supported currency before sending visitors to the PayPal pages. +* Support `VND` for [the PayPal Express Checkout gateway](https://docs.woocommerce.com/document/paypal-express-checkout/) * Add [the OnePay domestic (local ATM cards) gateway](http://onepay.com.vn/). Implement all methods in [the official documents](https://mtf.onepay.vn/developer/?page=modul_noidia_php): QueryDR, IPN, and Return URL. = ROAD MAP = In the future, this plugin will add more and more features for the Vietnam market: -* Integrate all districts to Vietnam provinces. (available since 1.2) * Integrate at least one solution for collecting money by phone cards. * Integrate the Vietnam payment gateways like 1Pay, OnePay, BaoKim, Ngan Luong, etc. * Integrate the Vietnam shipping solutions like ShipChung, Giaohangnhanh, ViettelPost, etc. @@ -75,30 +76,24 @@ Follow these steps to install and use the plugin: == Changelog == -= 1.3.1 - 2017.07.09 = -* Improve the OnePay domestic gateway. -* Add the plugin icon and banner. -* Add the questionnaire after 4 weeks of installation. += 1.4 - 2018.04.24 = -= 1.3 - 2017.04.22 = -* Add [the OnePay domestic (local ATM cards) gateway](http://onepay.com.vn/). +* Fix the on-hold order issue with PayPal Standard. +* Fix the issue in OnePay Domestic gateway when users cancel payment. +* Add enhancement: arrange the address fields to the Vietnam standard: Country - Province - District - Address. +* Add supporting VND for [the PayPal Express Checkout gateway](https://docs.woocommerce.com/document/paypal-express-checkout/). +* Add "Settings" link in the Plugins list page when the plugin is active. -= 1.2 - 2017.03.03 = -* Integrate all districts to Vietnam provinces. Credits: [WC City Select by 8manos](https://github.com/8manos/wc-city-select) and [the Vietnam district data by 10h30](https://github.com/htdat/woo-viet/issues/4#issuecomment-277449462) - -= 1.1 = -* Replace all “WooCommerce for Vietnam” to “Woo Viet” -* Replace all “woocomerce-for-vietnam” to “woo-viet” -* Re-upload to WordPress.org - -= 1.0 = -* First release. -* Upload to WordPress.org +See all change logs on [GitHub repo](https://github.com/htdat/woo-viet#changelog). == Upgrade Notice == += 1.4 = + +Version 1.4 arranges the address fields to the Vietnam standard (Country - Province - District - Address), supports VND for PayPal Express Checkout, and fixes issues on PayPal Standard and OnePay Domestic gateways. + = 1.3 = -The new version 1.2 comes with the feature "Add the OnePay domestic (local ATM cards) gateway]" +The new version 1.3 comes with the feature "Add the OnePay domestic (local ATM cards) gateway]" = 1.2 = The new version 1.2 comes with the feature "Add districts to Vietnam provinces". diff --git a/woo-viet.php b/woo-viet.php index 8c895b1..b81dc74 100644 --- a/woo-viet.php +++ b/woo-viet.php @@ -7,7 +7,11 @@ * Author URI: https://profiles.wordpress.org/htdat * Text Domain: woo-viet * Domain Path: /languages - * Version: 1.4-dev + * Version: 1.4 + * + * WC requires at least: 2.6 + * WC tested up to: 2.3 + * * License: GPLv2+ */ From 705e944b4e2f57d0af3bdf1f60918c23a2461432 Mon Sep 17 00:00:00 2001 From: Dat Hoang Date: Tue, 24 Apr 2018 23:36:37 +0700 Subject: [PATCH 13/13] Clean up the readme.md file Keep the full change log only, other info should be found on WordPress.org page --- readme.md | 79 ++++++++----------------------------------------------- 1 file changed, 11 insertions(+), 68 deletions(-) diff --git a/readme.md b/readme.md index eb3db7a..fcb1f90 100644 --- a/readme.md +++ b/readme.md @@ -1,80 +1,23 @@ # Woo Viet - WooCommerce for Vietnam -| Name | Value | -|:---|:---| -| Contributors | htdat | -|Tags| WooCommerce Vietnam, vietnam, vietnamese, vietnam provinces, paypal for vietnam dong, vnd, vietnam dong, vietnam currency, vietnam customization | -| Requires at least | 4.3 | -| Tested up to | 4.8 | -| Stable tag | 1.3 | -| License | GPLv2 or later | -| License URI | https://www.gnu.org/licenses/gpl-2.0.html | - -Add features to WooCommerce stores having anything related to Vietnam: currency, shipping address, PayPal and more. - -## Description - **"Woo Viet - WooCommerce for Vietnam" brings the features that help to run WooCommerce stores and customize them for Vietnam much easier.** +See here https://wordpress.org/plugins/woo-viet/ + Xem phiên bản tiếng Việt tại đây https://vi.wordpress.org/plugins/woo-viet/ -## FEATURES - -* Change the VND currency symbol `đ` to anything, e.g: `VND`, `VNĐ`, `đồng`, etc. -* Add provinces for Vietnam when visitors select Vietnam as a country of the shipping (billing) address. This is not available in WooCommerce by default. -* Add districts to Vietnam provinces. -* Convert `000` of prices to `K` (or anything). E.g: `50000` (VND) will be `50K` (VND), or `50 thousand` (VND). -* Support `VND` for [the PayPal Standard gateway](https://docs.woocommerce.com/document/paypal-standard/). Convert `VND` prices to any PayPal supported currency before sending visitors to the PayPal pages. -* Add [the OnePay domestic (local ATM cards) gateway](http://onepay.com.vn/). - -## ROAD MAP - -In the future, this plugin will add more and more features for the Vietnam market: - -* Integrate all districts to Vietnam provinces. -* Integrate at least one solution for collecting money by phone cards. -* Integrate the Vietnam payment gateways like 1Pay, OnePay, BaoKim, Ngan Luong, etc. -* Integrate the Vietnam shipping solutions like ShipChung, Giaohangnhanh, ViettelPost, etc. - -## WHERE CAN I CONTRIBUTE MY CODE OR IDEA? - -* You can report bugs or contribute code on [this GitHub repo](https://github.com/htdat/woo-viet). -* Please also do let us know if the "bug" is just a grammar/spelling error in both English and Vietnamese. We try to make our products as perfect as possible. - -## INSTALLATION - -Follow these steps to install and use the plugin: - -1. Upload the plugin files to the `/wp-content/plugins/woo-viet` directory, or install the plugin through the WordPress plugins screen directly. -1. Activate the plugin through the `Plugins` screen in WordPress. -1. Go to the `WooCommerce -> Woo Viet` screen and configure the plugin. - -## Installation - -Follow these steps to install and use the plugin: - -1. Upload the plugin files to the `/wp-content/plugins/woo-viet` directory, or install the plugin through the WordPress plugins screen directly. -1. Activate the plugin through the 'Plugins' screen in WordPress. -1. Go to the `WooCommerce -> Woo Viet` screen and configure the plugin. - - -## Frequently Asked Questions - -### WHERE CAN I CONTRIBUTE MY CODE OR IDEA? - -* You can report bugs or contribute code on [this GitHub repo](https://github.com/htdat/woo-viet). -* Please also do let us know if the "bug" is just a grammar/spelling error in both English and Vietnamese. We try to make our products as perfect as possible. - -## Screenshots - -1. The settings page under WooCommerce -> Woo Viet. -2. Prices are changed to "K", and the symbol is now "VND". -3. List provinces when selecting Vietnam. -4. Let clients know about the currency conversion before switching to the PayPal pages. - ## Changelog +### 1.4 - 2018.04.24 + +* Fix the on-hold order issue with PayPal Standard. +* Fix the issue in OnePay Domestic gateway when users cancel payment. +* Add enhancement: arrange the address fields to the Vietnam standard: Country - Province - District - Address. +* Add supporting VND for [the PayPal Express Checkout gateway](https://docs.woocommerce.com/document/paypal-express-checkout/). +* Add "Settings" link in the Plugins list page when the plugin is active. + ### 1.3.1 - 2017.07.09 + * Improve the OnePay domestic gateway. * Add the plugin icon and banner. * Add the questionnaire after 4 weeks of installation.