Skip to content

Commit

Permalink
Merge pull request #1 from vyskoczilova/fix-my-account
Browse files Browse the repository at this point in the history
Version 1.0.3
  • Loading branch information
Karolína Vyskočilová authored Feb 1, 2017
2 parents 99de80b + 53fc601 commit 3b6163c
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 19 deletions.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Download here: https://wordpress.org/plugins/woolab-ic-dic/

* přidává **políčka pro IČO a DIČ** do fakturační adresy WooCommerce
* pokud je IČO anebo DIČ zadáno a je fakturováno do ČR, tak **ověří jejich správnost** (algoritmem)
* **kompatibilita s pluginem [WooCommerce PDF Invoices & Packing Slips](https://cs.wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)**
* **kompatibilita s pluginy Vladislava Musílka (Toret)** - Woo Doprava, Woo GoPay apod.
* možnost editace IČO a DIČ i z administrace:
* `Uživatelé -> Jan Novák (Upravit) -> Fakturační adresa zákazníka`
Expand All @@ -19,6 +20,7 @@ Download here: https://wordpress.org/plugins/woolab-ic-dic/

* adds **Czech IČO - Company number, DIČ - VAT number** too WooCommerce
* **validates its value** if added and billing country is set to CZ
* **compatible with [WooCommerce PDF Invoices & Packing Slips](https://cs.wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)**
* **compatible with plugins of Vladislav Musilek (Toret)** - Woo Doprava, Woo GoPay etc.
* support for editing IČO, DIČ in the administration (backend):
* `Users -> Joe Doe (Edit) -> Billing address of the customer`
Expand All @@ -39,13 +41,15 @@ Download here: https://wordpress.org/plugins/woolab-ic-dic/

## Changelog

= future update =
* přidán odkaz na GitHub ve výpisech pluginů
* added plugin link to GitHub
= 1.0.3 (2017-02-1) =
* CZ - Opraveno zobrazování polí v "Můj účet" (frontendová editace účtu zákazníkem).
* CZ - Podpora pro WooCommerce PDF Invoices & Packing Slips.
* EN - Fix display fields in My Account frontend page.
* EN - Add support for WooCommerce PDF Invoices & Packing Slips.

= 1.0.2 (2016-12-15) =
* Vytvořen repozitář GIT
* Created the GIT repository
= 1.0.2.1 (2016-12-15) =
* CZ - Vytvořen repozitář GIT
* EN - Created the GIT repository

= 1.0.2 (2016-09-05) =
* CZ - Opraveno "IČ" na "IČO.
Expand Down
36 changes: 29 additions & 7 deletions includes/filters-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ function woolab_icdic_load_plugin_textdomain() {
}

// add plugin links
public function woolab_icdic_plugin_action_links( $links ) {
$settings_link = sprintf( '<a href="%s" target="_blank">%s</a>', 'https://github.com/vyskoczilova/kybernaut-ic-dic', __( 'GitHub', 'aryo-activity-log' ) );
function woolab_icdic_plugin_action_links( $links ) {
$settings_link = sprintf( '<a href="%s" target="_blank">%s</a>', 'https://github.com/vyskoczilova/kybernaut-ic-dic', __( 'GitHub', 'woolab-ic-dic' ) );
array_unshift( $links, $settings_link );

return $links;
Expand All @@ -17,24 +17,45 @@ public function woolab_icdic_plugin_action_links( $links ) {
function woolab_icdic_checkout_fields( $fields ) {

$fields['billing']['billing_ic'] = array(
'label' => __('IČO', 'woocommerce'),
'placeholder' => _x('IČO', 'placeholder', 'woocommerce'),
'label' => __('IČO', 'woolab-ic-dic'),
'placeholder' => _x('IČO', 'placeholder', 'woolab-ic-dic'),
'required' => false,
'class' => array('form-row-wide'),
'clear' => true
);

$fields['billing']['billing_dic'] = array(
'label' => __('DIČ', 'woocommerce'),
'placeholder' => _x('DIČ', 'placeholder', 'woocommerce'),
'label' => __('DIČ', 'woolab-ic-dic'),
'placeholder' => _x('DIČ', 'placeholder', 'woolab-ic-dic'),
'required' => false,
'class' => array('form-row-wide'),
'clear' => true
);

return $fields;

}
}

function woolab_icdic_billing_fields( $fields, $country ) {

$fields['billing_ic'] = array(
'label' => __('IČO', 'woolab-ic-dic'),
'placeholder' => _x('IČO', 'placeholder', 'woolab-ic-dic'),
'required' => false,
'class' => array('form-row-wide'),
'clear' => true
);

$fields['billing_dic'] = array(
'label' => __('DIČ', 'woolab-ic-dic'),
'placeholder' => _x('DIČ', 'placeholder', 'woolab-ic-dic'),
'required' => false,
'class' => array('form-row-wide'),
'clear' => true
);

return $fields;
}

// check field on checkout
function woolab_icdic_checkout_field_process() {
Expand All @@ -61,6 +82,7 @@ function woolab_icdic_my_address_formatted_address( $fields, $customer_id, $name
'billing_dic' => get_user_meta( $customer_id, $name . '_dic', true )
);
}

function woolab_icdic_localisation_address_formats($address_formats) {
$address_formats['CZ'] .= "\n{billing_ic}\n{billing_dic}";
return $address_formats;
Expand Down
20 changes: 16 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: vyskoczilova
Tags: woocommerce, DIČ, IČO, IČ, IČ DPH, česky, česká, české, cz, Czech, zobrazení, úprava, VAT, number, Company, identification, tax, eshop, e-shop, ecommerce, e-commerce, commerce, woothemes, wordpress woocommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, additional, fields, variable, download, downloadable, digital, inventory, fakturační, billing, shipping, adresa, address, woo commerce, order, objednávka, admin, backend
Requires at least: 4.0
Tested up to: 4.6.1
Tested up to: 4.7.2
Stable tag: /trunk
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Expand All @@ -14,20 +14,26 @@ Přidá IČO a DIČ do formuláře s fakturační adresou ve WooCommerce a rovno

* přidává **políčka pro IČO a DIČ** do fakturační adresy WooCommerce
* pokud je IČO anebo DIČ zadáno a je fakturováno do ČR, tak **ověří jejich správnost** (algoritmem)
* **kompatibilita s pluginem [WooCommerce PDF Invoices & Packing Slips](https://cs.wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)**
* **kompatibilita s pluginy Vladislava Musílka (Toret)** - Woo Doprava, Woo GoPay apod.
* možnost editace IČO a DIČ i z administrace:
* `Uživatelé -> Jan Novák (Upravit) -> Fakturační adresa zákazníka`
* `E-shop-WooCommerce -> Objednávky -> Objednávka (zobrazit(upravit)) -> Fakturační údaje (editace)`

Pokud mi chcete pomoci, přidejte se na [GitHubu](https://github.com/vyskoczilova/kybernaut-ic-dic).

= EN =

* adds **Czech IČO - Company number, DIČ - VAT number** too WooCommerce
* **validates its value** if added and billing country is set to CZ
* **compatible with [WooCommerce PDF Invoices & Packing Slips](https://cs.wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)**
* **compatible with plugins of Vladislav Musilek (Toret)** - Woo Doprava, Woo GoPay etc.
* support for editing IČO, DIČ in the administration (backend):
* `Users -> Joe Doe (Edit) -> Billing address of the customer`
* `E-shop-WooCommerce -> Orders-> Order (show(edit)) -> Billing Information (edit)`

If you want to help, join the [Github](https://github.com/vyskoczilova/kybernaut-ic-dic).

== Installation ==
= CZ =
1. Stáhněte si poslední verzi a rozbalte ji do adresáře /wp-content/plugins/, nebo plugin nainstalujte přes menu Pluginy -> Instalace pluginů v administraci.
Expand All @@ -47,9 +53,15 @@ Přidá IČO a DIČ do formuláře s fakturační adresou ve WooCommerce a rovno

== Changelog ==

= 1.0.2 (2016-12-15) =
* Vytvořen repozitář GIT
* Created the GIT repository
= 1.0.3 (2017-02-1) =
* CZ - Opraveno zobrazování polí v "Můj účet" (frontendová editace účtu zákazníkem).
* CZ - Podpora pro WooCommerce PDF Invoices & Packing Slips.
* EN - Fix display fields in My Account frontend page.
* EN - Add support for WooCommerce PDF Invoices & Packing Slips.

= 1.0.2.1 (2016-12-15) =
* CZ - Vytvořen repozitář GIT
* EN - Created the GIT repository

= 1.0.2 (2016-09-05) =
* CZ - Opraveno "IČ" na "IČO.
Expand Down
5 changes: 3 additions & 2 deletions woolab-ic-dic.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Kybernaut IC DIC
* Plugin URI: http://kybernaut.cz/pluginy/kybernaut-ic-dic
* Description: Přidá IČO a DIČ do formuláře s fakturační adresou ve WooCommerce a rovnou ověří, jestli jsou zadané hodnoty skutečné.
* Version: 1.0.2
* Version: 1.0.3
* Author: Karolína Vyskočilová
* Author URI: http://www.kybernaut.cz
* Text Domain: woolab-ic-dic
Expand Down Expand Up @@ -54,8 +54,9 @@ function woolab_icdic_plugin_admin_notice() {
require_once('includes/filters-actions.php');

add_action( 'plugins_loaded', 'woolab_icdic_load_plugin_textdomain' );
add_filter( 'woocommerce_billing_fields' , 'woolab_icdic_billing_fields', 10, 2 );
add_filter( 'woocommerce_checkout_fields', 'woolab_icdic_checkout_fields', 10, 2);
add_action('woocommerce_checkout_process', 'woolab_icdic_checkout_field_process', 10, 2);
add_action( 'woocommerce_checkout_process', 'woolab_icdic_checkout_field_process', 10, 2);
add_filter( 'woocommerce_my_account_my_address_formatted_address', 'woolab_icdic_my_address_formatted_address', 10, 3 );
add_filter( 'woocommerce_localisation_address_formats', 'woolab_icdic_localisation_address_formats' );
add_filter( 'woocommerce_formatted_address_replacements', 'woolab_icdic_formatted_address_replacements', 10, 2 );
Expand Down

0 comments on commit 3b6163c

Please sign in to comment.