-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b747fb
commit 9983fd9
Showing
12 changed files
with
249 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
<?php | ||
/** | ||
* Cost of Goods for WooCommerce - Extra costs labels. | ||
* | ||
* @version 3.6.0 | ||
* @since 3.6.0 | ||
* @author WPFactory | ||
*/ | ||
|
||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
} // Exit if accessed directly | ||
|
||
if ( ! class_exists( 'Alg_WC_Cost_of_Goods_Extra_Costs_Labels' ) ) { | ||
|
||
class Alg_WC_Cost_of_Goods_Extra_Costs_Labels { | ||
|
||
/** | ||
* Labels. | ||
* | ||
* @since 3.6.0 | ||
* | ||
* @var array | ||
*/ | ||
protected $labels = array(); | ||
|
||
/** | ||
* Init. | ||
* | ||
* @version 3.6.0 | ||
* @since 3.6.0 | ||
* | ||
* @return void | ||
*/ | ||
function init() { | ||
add_action( 'init', function () { | ||
$this->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; | ||
} | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters