Skip to content

Commit 9983fd9

Browse files
v3.6.0
1 parent 4b747fb commit 9983fd9

12 files changed

+249
-12
lines changed

Diff for: cost-of-goods-for-woocommerce.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Cost of Goods: Product Cost & Profit Calculator for WooCommerce
44
Plugin URI: https://wpfactory.com/item/cost-of-goods-for-woocommerce/
55
Description: Save product purchase costs (cost of goods) in WooCommerce. Beautifully.
6-
Version: 3.5.9
6+
Version: 3.6.0
77
Author: WPFactory
88
Author URI: https://wpfactory.com
99
Text Domain: cost-of-goods-for-woocommerce

Diff for: includes/class-alg-wc-cog-core.php

+14-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Cost of Goods for WooCommerce - Core Class.
44
*
5-
* @version 3.4.6
5+
* @version 3.6.0
66
* @since 1.0.0
77
* @author WPFactory
88
*/
@@ -96,6 +96,15 @@ class Alg_WC_Cost_of_Goods_Core {
9696
*/
9797
public $analytics;
9898

99+
/**
100+
* $extra_costs_labels.
101+
*
102+
* @since 3.6.0
103+
*
104+
* @var Alg_WC_Cost_of_Goods_Extra_Costs_Labels
105+
*/
106+
public $extra_costs_labels;
107+
99108
/**
100109
* Constructor.
101110
*
@@ -119,6 +128,10 @@ class Alg_WC_Cost_of_Goods_Core {
119128
function __construct() {
120129
require_once( 'class-alg-wc-cog-options.php' );
121130
$this->options = new Alg_WC_Cost_of_Goods_Options();
131+
// Extra costs labels.
132+
require_once( 'class-alg-wc-cog-extra-costs-labels.php' );
133+
$this->extra_costs_labels = new Alg_WC_Cost_of_Goods_Extra_Costs_Labels();
134+
$this->extra_costs_labels->init();
122135
// Background process.
123136
$this->init_bkg_process();
124137
// Analytics.

Diff for: includes/class-alg-wc-cog-extra-costs-labels.php

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<?php
2+
/**
3+
* Cost of Goods for WooCommerce - Extra costs labels.
4+
*
5+
* @version 3.6.0
6+
* @since 3.6.0
7+
* @author WPFactory
8+
*/
9+
10+
if ( ! defined( 'ABSPATH' ) ) {
11+
exit;
12+
} // Exit if accessed directly
13+
14+
if ( ! class_exists( 'Alg_WC_Cost_of_Goods_Extra_Costs_Labels' ) ) {
15+
16+
class Alg_WC_Cost_of_Goods_Extra_Costs_Labels {
17+
18+
/**
19+
* Labels.
20+
*
21+
* @since 3.6.0
22+
*
23+
* @var array
24+
*/
25+
protected $labels = array();
26+
27+
/**
28+
* Init.
29+
*
30+
* @version 3.6.0
31+
* @since 3.6.0
32+
*
33+
* @return void
34+
*/
35+
function init() {
36+
add_action( 'init', function () {
37+
$this->set_labels( array(
38+
'handling' => array(
39+
'short' => __( 'handling', 'cost-of-goods-for-woocommerce' ),
40+
'long' => __( 'handling fee', 'cost-of-goods-for-woocommerce' )
41+
),
42+
'shipping' => array(
43+
'short' => __( 'shipping', 'cost-of-goods-for-woocommerce' ),
44+
'long' => __( 'shipping fee', 'cost-of-goods-for-woocommerce' )
45+
),
46+
'payment' => array(
47+
'short' => __( 'payment', 'cost-of-goods-for-woocommerce' ),
48+
'long' => __( 'payment fee', 'cost-of-goods-for-woocommerce' )
49+
),
50+
) );
51+
} );
52+
}
53+
54+
/**
55+
* Get label.
56+
*
57+
* @version 3.6.0
58+
* @since 3.6.0
59+
*
60+
* @param $cost_type
61+
* @param $label_type
62+
*
63+
* @return string
64+
*/
65+
function get_label( $cost_type, $label_type = 'short' ) {
66+
$label = '';
67+
if ( isset( $this->get_labels()[ $cost_type ] ) && isset( $this->get_labels()[ $cost_type ][ $label_type ] ) ) {
68+
$label = $this->get_labels()[ $cost_type ][ $label_type ];
69+
}
70+
71+
return $label;
72+
}
73+
74+
/**
75+
* get_labels.
76+
*
77+
* @version 3.6.0
78+
* @since 3.6.0
79+
*
80+
* @return array
81+
*/
82+
public function get_labels(): array {
83+
return $this->labels;
84+
}
85+
86+
/**
87+
* set_labels.
88+
*
89+
* @version 3.6.0
90+
* @since 3.6.0
91+
*
92+
* @param array $labels
93+
*/
94+
public function set_labels( array $labels ): void {
95+
$this->labels = $labels;
96+
}
97+
98+
99+
}
100+
}

Diff for: includes/class-alg-wc-cog-orders.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Cost of Goods for WooCommerce - Orders Class.
44
*
5-
* @version 3.5.8
5+
* @version 3.6.0
66
* @since 2.1.0
77
* @author WPFactory
88
*/
@@ -847,7 +847,7 @@ function get_shop_order_screen_id() {
847847
/**
848848
* add_order_columns.
849849
*
850-
* @version 2.3.4
850+
* @version 3.6.0
851851
* @since 1.0.0
852852
* @todo [next] add more columns (i.e. not only cost, per order fees, profit, profit percent and profit margin)
853853
*/
@@ -862,7 +862,7 @@ function add_order_columns( $columns ) {
862862
if ( $this->is_columns_extra_cost_per_order && in_array( true, $this->is_order_extra_cost_per_order ) ) {
863863
foreach ( $this->is_order_extra_cost_per_order as $fee_type => $is_enabled ) {
864864
if ( $is_enabled ) {
865-
$this->order_columns[ $fee_type ] = ucfirst( $fee_type );
865+
$this->order_columns[ $fee_type ] = ucfirst( alg_wc_cog()->core->extra_costs_labels->get_label( $fee_type ) );
866866
}
867867
}
868868
}

Diff for: includes/class-alg-wc-cog.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class Alg_WC_Cost_of_Goods {
3535
* @since 1.0.0
3636
* @var string
3737
*/
38-
public $version = '3.5.9';
38+
public $version = '3.6.0';
3939

4040
/**
4141
* @since 1.0.0
@@ -97,7 +97,7 @@ function init() {
9797
// Move WC Settings tab to WPFactory menu.
9898
$this->move_wc_settings_tab_to_wpfactory_menu();
9999

100-
// Localization
100+
// Localization.
101101
add_action( 'init', array( $this, 'localize' ) );
102102

103103
// Adds compatibility with HPOS.

Diff for: langs/cost-of-goods-for-woocommerce-de_DE.po

+24
Original file line numberDiff line numberDiff line change
@@ -3189,3 +3189,27 @@ msgstr ""
31893189
#: includes/settings/class-alg-wc-cog-settings-products.php:121
31903190
msgid "Inventory > SKU"
31913191
msgstr ""
3192+
3193+
#: includes/class-alg-wc-cog-extra-costs-labels.php:39
3194+
msgid "handling"
3195+
msgstr ""
3196+
3197+
#: includes/class-alg-wc-cog-extra-costs-labels.php:40
3198+
msgid "handling fee"
3199+
msgstr ""
3200+
3201+
#: includes/class-alg-wc-cog-extra-costs-labels.php:43
3202+
msgid "shipping"
3203+
msgstr ""
3204+
3205+
#: includes/class-alg-wc-cog-extra-costs-labels.php:44
3206+
msgid "shipping fee"
3207+
msgstr ""
3208+
3209+
#: includes/class-alg-wc-cog-extra-costs-labels.php:47
3210+
msgid "payment"
3211+
msgstr ""
3212+
3213+
#: includes/class-alg-wc-cog-extra-costs-labels.php:48
3214+
msgid "payment fee"
3215+
msgstr ""

Diff for: langs/cost-of-goods-for-woocommerce-nl_NL.po

+24
Original file line numberDiff line numberDiff line change
@@ -3187,3 +3187,27 @@ msgstr ""
31873187
#: includes/pro/reports/class-wc-report-alg-cog.php:359
31883188
msgid "Average profit"
31893189
msgstr ""
3190+
3191+
#: includes/class-alg-wc-cog-extra-costs-labels.php:39
3192+
msgid "handling"
3193+
msgstr ""
3194+
3195+
#: includes/class-alg-wc-cog-extra-costs-labels.php:40
3196+
msgid "handling fee"
3197+
msgstr ""
3198+
3199+
#: includes/class-alg-wc-cog-extra-costs-labels.php:43
3200+
msgid "shipping"
3201+
msgstr ""
3202+
3203+
#: includes/class-alg-wc-cog-extra-costs-labels.php:44
3204+
msgid "shipping fee"
3205+
msgstr ""
3206+
3207+
#: includes/class-alg-wc-cog-extra-costs-labels.php:47
3208+
msgid "payment"
3209+
msgstr ""
3210+
3211+
#: includes/class-alg-wc-cog-extra-costs-labels.php:48
3212+
msgid "payment fee"
3213+
msgstr ""

Diff for: langs/cost-of-goods-for-woocommerce-tr_TR.po

+24
Original file line numberDiff line numberDiff line change
@@ -3225,3 +3225,27 @@ msgstr ""
32253225
#: includes/settings/class-alg-wc-cog-settings-products.php:121
32263226
msgid "Inventory > SKU"
32273227
msgstr ""
3228+
3229+
#: includes/class-alg-wc-cog-extra-costs-labels.php:39
3230+
msgid "handling"
3231+
msgstr ""
3232+
3233+
#: includes/class-alg-wc-cog-extra-costs-labels.php:40
3234+
msgid "handling fee"
3235+
msgstr ""
3236+
3237+
#: includes/class-alg-wc-cog-extra-costs-labels.php:43
3238+
msgid "shipping"
3239+
msgstr ""
3240+
3241+
#: includes/class-alg-wc-cog-extra-costs-labels.php:44
3242+
msgid "shipping fee"
3243+
msgstr ""
3244+
3245+
#: includes/class-alg-wc-cog-extra-costs-labels.php:47
3246+
msgid "payment"
3247+
msgstr ""
3248+
3249+
#: includes/class-alg-wc-cog-extra-costs-labels.php:48
3250+
msgid "payment fee"
3251+
msgstr ""

Diff for: langs/cost-of-goods-for-woocommerce-zh_CN.po

+24
Original file line numberDiff line numberDiff line change
@@ -3187,3 +3187,27 @@ msgstr ""
31873187
#: includes/settings/class-alg-wc-cog-settings-products.php:121
31883188
msgid "Inventory > SKU"
31893189
msgstr ""
3190+
3191+
#: includes/class-alg-wc-cog-extra-costs-labels.php:39
3192+
msgid "handling"
3193+
msgstr ""
3194+
3195+
#: includes/class-alg-wc-cog-extra-costs-labels.php:40
3196+
msgid "handling fee"
3197+
msgstr ""
3198+
3199+
#: includes/class-alg-wc-cog-extra-costs-labels.php:43
3200+
msgid "shipping"
3201+
msgstr ""
3202+
3203+
#: includes/class-alg-wc-cog-extra-costs-labels.php:44
3204+
msgid "shipping fee"
3205+
msgstr ""
3206+
3207+
#: includes/class-alg-wc-cog-extra-costs-labels.php:47
3208+
msgid "payment"
3209+
msgstr ""
3210+
3211+
#: includes/class-alg-wc-cog-extra-costs-labels.php:48
3212+
msgid "payment fee"
3213+
msgstr ""

Diff for: langs/cost-of-goods-for-woocommerce.pot

+26-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
# This file is distributed under the GNU General Public License v3.0.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: cost-of-goods-for-woocommerce 3.5.9\n"
5+
"Project-Id-Version: cost-of-goods-for-woocommerce 3.6.0\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cost-of-goods-for-woocommerce\n"
77
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
88
"Language-Team: LANGUAGE <[email protected]>\n"
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=UTF-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"POT-Creation-Date: 2024-12-06T18:16:54+01:00\n"
12+
"POT-Creation-Date: 2024-12-10T23:39:13+01:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1414
"X-Generator: WP-CLI 2.7.1\n"
1515
"X-Domain: cost-of-goods-for-woocommerce\n"
@@ -163,6 +163,30 @@ msgstr ""
163163
msgid "N/A"
164164
msgstr ""
165165

166+
#: includes/class-alg-wc-cog-extra-costs-labels.php:39
167+
msgid "handling"
168+
msgstr ""
169+
170+
#: includes/class-alg-wc-cog-extra-costs-labels.php:40
171+
msgid "handling fee"
172+
msgstr ""
173+
174+
#: includes/class-alg-wc-cog-extra-costs-labels.php:43
175+
msgid "shipping"
176+
msgstr ""
177+
178+
#: includes/class-alg-wc-cog-extra-costs-labels.php:44
179+
msgid "shipping fee"
180+
msgstr ""
181+
182+
#: includes/class-alg-wc-cog-extra-costs-labels.php:47
183+
msgid "payment"
184+
msgstr ""
185+
186+
#: includes/class-alg-wc-cog-extra-costs-labels.php:48
187+
msgid "payment fee"
188+
msgstr ""
189+
166190
#: includes/class-alg-wc-cog-orders-meta-boxes.php:116
167191
#: includes/class-alg-wc-cog-orders-meta-boxes.php:219
168192
#: includes/class-alg-wc-cog.php:165

Diff for: readme.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: wpcodefactory, omardabbas, karzin, anbinder, algoritmika, kousikmu
33
Tags: woocommerce, cost, cost of goods, profit, profit calculator
44
Requires at least: 6.1
55
Tested up to: 6.7
6-
Stable tag: 3.5.9
6+
Stable tag: 3.6.0
77
License: GNU General Public License v3.0
88
License URI: http://www.gnu.org/licenses/gpl-3.0.html
99

@@ -344,8 +344,12 @@ Once activated, access the plugin's settings by navigating to “WooCommerce > S
344344

345345
== Changelog ==
346346

347+
= 3.6.0 - 10/12/2024 =
348+
* Fix - Resolved an issue where some strings were not translatable.
349+
347350
= 3.5.9 - 06/12/2024 =
348351
* Fix - Some translation domains fixed.
352+
* Dev - Added Dutch translation.
349353
* Dev - Key manager updated.
350354

351355
= 3.5.8 - 26/11/2024 =

Diff for: vendor/composer/installed.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
'name' => '__root__',
44
'pretty_version' => 'dev-master',
55
'version' => 'dev-master',
6-
'reference' => '20cb52491ffc736a580754689acb5e6e542333ec',
6+
'reference' => '60fc865d1e2f1203aec0c89187751f3eaf01d475',
77
'type' => 'library',
88
'install_path' => __DIR__ . '/../../',
99
'aliases' => array(),
@@ -13,7 +13,7 @@
1313
'__root__' => array(
1414
'pretty_version' => 'dev-master',
1515
'version' => 'dev-master',
16-
'reference' => '20cb52491ffc736a580754689acb5e6e542333ec',
16+
'reference' => '60fc865d1e2f1203aec0c89187751f3eaf01d475',
1717
'type' => 'library',
1818
'install_path' => __DIR__ . '/../../',
1919
'aliases' => array(),

0 commit comments

Comments
 (0)