diff --git a/cost-of-goods-for-woocommerce.php b/cost-of-goods-for-woocommerce.php index 84ea988..38d16ac 100644 --- a/cost-of-goods-for-woocommerce.php +++ b/cost-of-goods-for-woocommerce.php @@ -3,7 +3,7 @@ Plugin Name: Cost of Goods: Product Cost & Profit Calculator for WooCommerce Plugin URI: https://wpfactory.com/item/cost-of-goods-for-woocommerce/ Description: Save product purchase costs (cost of goods) in WooCommerce. Beautifully. -Version: 3.5.9 +Version: 3.6.0 Author: WPFactory Author URI: https://wpfactory.com Text Domain: cost-of-goods-for-woocommerce diff --git a/includes/class-alg-wc-cog-core.php b/includes/class-alg-wc-cog-core.php index 8a5b0fa..233bd85 100644 --- a/includes/class-alg-wc-cog-core.php +++ b/includes/class-alg-wc-cog-core.php @@ -2,7 +2,7 @@ /** * Cost of Goods for WooCommerce - Core Class. * - * @version 3.4.6 + * @version 3.6.0 * @since 1.0.0 * @author WPFactory */ @@ -96,6 +96,15 @@ class Alg_WC_Cost_of_Goods_Core { */ public $analytics; + /** + * $extra_costs_labels. + * + * @since 3.6.0 + * + * @var Alg_WC_Cost_of_Goods_Extra_Costs_Labels + */ + public $extra_costs_labels; + /** * Constructor. * @@ -119,6 +128,10 @@ class Alg_WC_Cost_of_Goods_Core { function __construct() { require_once( 'class-alg-wc-cog-options.php' ); $this->options = new Alg_WC_Cost_of_Goods_Options(); + // Extra costs labels. + require_once( 'class-alg-wc-cog-extra-costs-labels.php' ); + $this->extra_costs_labels = new Alg_WC_Cost_of_Goods_Extra_Costs_Labels(); + $this->extra_costs_labels->init(); // Background process. $this->init_bkg_process(); // Analytics. diff --git a/includes/class-alg-wc-cog-extra-costs-labels.php b/includes/class-alg-wc-cog-extra-costs-labels.php new file mode 100644 index 0000000..1b05360 --- /dev/null +++ b/includes/class-alg-wc-cog-extra-costs-labels.php @@ -0,0 +1,100 @@ +set_labels( array( + 'handling' => array( + 'short' => __( 'handling', 'cost-of-goods-for-woocommerce' ), + 'long' => __( 'handling fee', 'cost-of-goods-for-woocommerce' ) + ), + 'shipping' => array( + 'short' => __( 'shipping', 'cost-of-goods-for-woocommerce' ), + 'long' => __( 'shipping fee', 'cost-of-goods-for-woocommerce' ) + ), + 'payment' => array( + 'short' => __( 'payment', 'cost-of-goods-for-woocommerce' ), + 'long' => __( 'payment fee', 'cost-of-goods-for-woocommerce' ) + ), + ) ); + } ); + } + + /** + * Get label. + * + * @version 3.6.0 + * @since 3.6.0 + * + * @param $cost_type + * @param $label_type + * + * @return string + */ + function get_label( $cost_type, $label_type = 'short' ) { + $label = ''; + if ( isset( $this->get_labels()[ $cost_type ] ) && isset( $this->get_labels()[ $cost_type ][ $label_type ] ) ) { + $label = $this->get_labels()[ $cost_type ][ $label_type ]; + } + + return $label; + } + + /** + * get_labels. + * + * @version 3.6.0 + * @since 3.6.0 + * + * @return array + */ + public function get_labels(): array { + return $this->labels; + } + + /** + * set_labels. + * + * @version 3.6.0 + * @since 3.6.0 + * + * @param array $labels + */ + public function set_labels( array $labels ): void { + $this->labels = $labels; + } + + + } +} \ No newline at end of file diff --git a/includes/class-alg-wc-cog-orders.php b/includes/class-alg-wc-cog-orders.php index ba95948..fdd865c 100644 --- a/includes/class-alg-wc-cog-orders.php +++ b/includes/class-alg-wc-cog-orders.php @@ -2,7 +2,7 @@ /** * Cost of Goods for WooCommerce - Orders Class. * - * @version 3.5.8 + * @version 3.6.0 * @since 2.1.0 * @author WPFactory */ @@ -847,7 +847,7 @@ function get_shop_order_screen_id() { /** * add_order_columns. * - * @version 2.3.4 + * @version 3.6.0 * @since 1.0.0 * @todo [next] add more columns (i.e. not only cost, per order fees, profit, profit percent and profit margin) */ @@ -862,7 +862,7 @@ function add_order_columns( $columns ) { if ( $this->is_columns_extra_cost_per_order && in_array( true, $this->is_order_extra_cost_per_order ) ) { foreach ( $this->is_order_extra_cost_per_order as $fee_type => $is_enabled ) { if ( $is_enabled ) { - $this->order_columns[ $fee_type ] = ucfirst( $fee_type ); + $this->order_columns[ $fee_type ] = ucfirst( alg_wc_cog()->core->extra_costs_labels->get_label( $fee_type ) ); } } } diff --git a/includes/class-alg-wc-cog.php b/includes/class-alg-wc-cog.php index 2486f26..efe3638 100644 --- a/includes/class-alg-wc-cog.php +++ b/includes/class-alg-wc-cog.php @@ -35,7 +35,7 @@ final class Alg_WC_Cost_of_Goods { * @since 1.0.0 * @var string */ - public $version = '3.5.9'; + public $version = '3.6.0'; /** * @since 1.0.0 @@ -97,7 +97,7 @@ function init() { // Move WC Settings tab to WPFactory menu. $this->move_wc_settings_tab_to_wpfactory_menu(); - // Localization + // Localization. add_action( 'init', array( $this, 'localize' ) ); // Adds compatibility with HPOS. diff --git a/langs/cost-of-goods-for-woocommerce-de_DE.po b/langs/cost-of-goods-for-woocommerce-de_DE.po index 32fc5ce..4546c81 100644 --- a/langs/cost-of-goods-for-woocommerce-de_DE.po +++ b/langs/cost-of-goods-for-woocommerce-de_DE.po @@ -3189,3 +3189,27 @@ msgstr "" #: includes/settings/class-alg-wc-cog-settings-products.php:121 msgid "Inventory > SKU" msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:39 +msgid "handling" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:40 +msgid "handling fee" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:43 +msgid "shipping" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:44 +msgid "shipping fee" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:47 +msgid "payment" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:48 +msgid "payment fee" +msgstr "" diff --git a/langs/cost-of-goods-for-woocommerce-nl_NL.po b/langs/cost-of-goods-for-woocommerce-nl_NL.po index 1a64607..d109683 100644 --- a/langs/cost-of-goods-for-woocommerce-nl_NL.po +++ b/langs/cost-of-goods-for-woocommerce-nl_NL.po @@ -3187,3 +3187,27 @@ msgstr "" #: includes/pro/reports/class-wc-report-alg-cog.php:359 msgid "Average profit" msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:39 +msgid "handling" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:40 +msgid "handling fee" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:43 +msgid "shipping" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:44 +msgid "shipping fee" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:47 +msgid "payment" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:48 +msgid "payment fee" +msgstr "" diff --git a/langs/cost-of-goods-for-woocommerce-tr_TR.po b/langs/cost-of-goods-for-woocommerce-tr_TR.po index 8c547d1..529c6b0 100644 --- a/langs/cost-of-goods-for-woocommerce-tr_TR.po +++ b/langs/cost-of-goods-for-woocommerce-tr_TR.po @@ -3225,3 +3225,27 @@ msgstr "" #: includes/settings/class-alg-wc-cog-settings-products.php:121 msgid "Inventory > SKU" msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:39 +msgid "handling" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:40 +msgid "handling fee" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:43 +msgid "shipping" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:44 +msgid "shipping fee" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:47 +msgid "payment" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:48 +msgid "payment fee" +msgstr "" diff --git a/langs/cost-of-goods-for-woocommerce-zh_CN.po b/langs/cost-of-goods-for-woocommerce-zh_CN.po index 3cdfd6e..7a3f76f 100644 --- a/langs/cost-of-goods-for-woocommerce-zh_CN.po +++ b/langs/cost-of-goods-for-woocommerce-zh_CN.po @@ -3187,3 +3187,27 @@ msgstr "" #: includes/settings/class-alg-wc-cog-settings-products.php:121 msgid "Inventory > SKU" msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:39 +msgid "handling" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:40 +msgid "handling fee" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:43 +msgid "shipping" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:44 +msgid "shipping fee" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:47 +msgid "payment" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:48 +msgid "payment fee" +msgstr "" diff --git a/langs/cost-of-goods-for-woocommerce.pot b/langs/cost-of-goods-for-woocommerce.pot index 9e75c27..7a8643f 100644 --- a/langs/cost-of-goods-for-woocommerce.pot +++ b/langs/cost-of-goods-for-woocommerce.pot @@ -2,14 +2,14 @@ # This file is distributed under the GNU General Public License v3.0. msgid "" msgstr "" -"Project-Id-Version: cost-of-goods-for-woocommerce 3.5.9\n" +"Project-Id-Version: cost-of-goods-for-woocommerce 3.6.0\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cost-of-goods-for-woocommerce\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-12-06T18:16:54+01:00\n" +"POT-Creation-Date: 2024-12-10T23:39:13+01:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.7.1\n" "X-Domain: cost-of-goods-for-woocommerce\n" @@ -163,6 +163,30 @@ msgstr "" msgid "N/A" msgstr "" +#: includes/class-alg-wc-cog-extra-costs-labels.php:39 +msgid "handling" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:40 +msgid "handling fee" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:43 +msgid "shipping" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:44 +msgid "shipping fee" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:47 +msgid "payment" +msgstr "" + +#: includes/class-alg-wc-cog-extra-costs-labels.php:48 +msgid "payment fee" +msgstr "" + #: includes/class-alg-wc-cog-orders-meta-boxes.php:116 #: includes/class-alg-wc-cog-orders-meta-boxes.php:219 #: includes/class-alg-wc-cog.php:165 diff --git a/readme.txt b/readme.txt index 5651f9f..1b38cec 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: wpcodefactory, omardabbas, karzin, anbinder, algoritmika, kousikmu Tags: woocommerce, cost, cost of goods, profit, profit calculator Requires at least: 6.1 Tested up to: 6.7 -Stable tag: 3.5.9 +Stable tag: 3.6.0 License: GNU General Public License v3.0 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -344,8 +344,12 @@ Once activated, access the plugin's settings by navigating to “WooCommerce > S == Changelog == += 3.6.0 - 10/12/2024 = +* Fix - Resolved an issue where some strings were not translatable. + = 3.5.9 - 06/12/2024 = * Fix - Some translation domains fixed. +* Dev - Added Dutch translation. * Dev - Key manager updated. = 3.5.8 - 26/11/2024 = diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index d180c4b..41c2a89 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '20cb52491ffc736a580754689acb5e6e542333ec', + 'reference' => '60fc865d1e2f1203aec0c89187751f3eaf01d475', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '20cb52491ffc736a580754689acb5e6e542333ec', + 'reference' => '60fc865d1e2f1203aec0c89187751f3eaf01d475', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(),