From 9cc0ab21981ac5aee9fa7815cdda96437ed59087 Mon Sep 17 00:00:00 2001 From: Pablo Pacheco Date: Tue, 19 Dec 2023 12:25:51 -0300 Subject: [PATCH] v3.1.9 --- cost-of-goods-for-woocommerce.php | 2 +- includes/class-alg-wc-cog-cost-inputs.php | 23 +- includes/class-alg-wc-cog-orders.php | 6 +- includes/class-alg-wc-cog.php | 2 +- ...lass-alg-wc-cog-settings-compatibility.php | 35 ++- .../class-alg-wc-cog-settings-products.php | 22 +- .../class-alg-wc-cog-settings-shortcodes.php | 4 +- langs/cost-of-goods-for-woocommerce.pot | 223 ++++++++++-------- readme.txt | 7 +- 9 files changed, 203 insertions(+), 121 deletions(-) diff --git a/cost-of-goods-for-woocommerce.php b/cost-of-goods-for-woocommerce.php index e4d9f3f..922ba8a 100644 --- a/cost-of-goods-for-woocommerce.php +++ b/cost-of-goods-for-woocommerce.php @@ -3,7 +3,7 @@ Plugin Name: Cost of Goods 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.1.8 +Version: 3.1.9 Author: WPFactory Author URI: https://wpfactory.com Text Domain: cost-of-goods-for-woocommerce diff --git a/includes/class-alg-wc-cog-cost-inputs.php b/includes/class-alg-wc-cog-cost-inputs.php index 8b41cb4..8f83caf 100644 --- a/includes/class-alg-wc-cog-cost-inputs.php +++ b/includes/class-alg-wc-cog-cost-inputs.php @@ -2,7 +2,7 @@ /** * Cost of Goods for WooCommerce - Costs input. * - * @version 2.9.4 + * @version 3.1.9 * @since 2.6.4 * @author WPFactory */ @@ -67,7 +67,7 @@ function add_hooks(){ /** * add_cost_input. * - * @version 2.3.4 + * @version 3.1.9 * @since 1.0.0 * @todo [later] rethink `$product_id` (and search all code for `get_the_ID()`) * @todo [maybe] min_profit @@ -78,11 +78,12 @@ function add_cost_input() { } $product_id = get_the_ID(); if ( apply_filters( 'alg_wc_cog_add_cost_input_validation', true, $product_id ) ) { + $label_from_to = $this->get_cost_input_label_placeholders( $product_id ); woocommerce_wp_text_input( array( 'id' => '_alg_wc_cog_cost', 'value' => wc_format_localized_price( alg_wc_cog()->core->products->get_product_cost( $product_id ) ), 'data_type' => 'price', - 'label' => str_replace( '%currency_symbol%', alg_wc_cog()->core->get_default_shop_currency_symbol(), $this->cost_field_template ), + 'label' => str_replace( array_keys( $label_from_to ), $label_from_to, $this->cost_field_template ), 'description' => sprintf( __( 'Profit: %s', 'cost-of-goods-for-woocommerce' ), ( '' != ( $profit = alg_wc_cog()->core->products->get_product_profit_html( $product_id, alg_wc_cog()->core->products->product_profit_html_template ) ) ? $profit : __( 'N/A', 'cost-of-goods-for-woocommerce' ) ) ), ) ); @@ -90,6 +91,22 @@ function add_cost_input() { do_action( 'alg_wc_cog_cost_input', $product_id ); } + /** + * get_cost_input_label_placeholders. + * + * @version 3.1.9 + * @since 3.1.9 + * + * @param $product_id + * + * @return mixed|null + */ + function get_cost_input_label_placeholders( $product_id = null ) { + return apply_filters( 'alg_wc_cog_cost_input_label_placeholders', array( + '%currency_symbol%' => alg_wc_cog()->core->get_default_shop_currency_symbol() + ), $product_id ); + } + /** * add_cost_input_variable. * diff --git a/includes/class-alg-wc-cog-orders.php b/includes/class-alg-wc-cog-orders.php index 6eda0d7..88dab21 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.1.6 + * @version 3.1.9 * @since 2.1.0 * @author WPFactory */ @@ -1243,7 +1243,7 @@ function get_shipping_total_for_percentage_fees( $order ) { /** * update_order_items_costs. * - * @version 3.1.2 + * @version 3.1.9 * @since 1.1.0 * @todo [maybe] filters: add more? * @todo [maybe] `$total_price`: customizable calculation method (e.g. `$order->get_subtotal()`) (this will affect `_alg_wc_cog_order_profit_margin`) @@ -1328,7 +1328,7 @@ function update_order_items_costs( $args ) { if ( $is_new_order ) { if ( ! $is_no_costs_only || '' === wc_get_order_item_meta( $item_id, '_alg_wc_cog_item_cost' ) ) { $product_id = ( ! empty( $item['variation_id'] ) ? $item['variation_id'] : $item['product_id'] ); - $cost = apply_filters( 'alg_wc_cog_order_item_cost', alg_wc_cog()->core->products->get_product_cost( $product_id ), $product_id ); + $cost = apply_filters( 'alg_wc_cog_order_item_cost', alg_wc_cog()->core->products->get_product_cost( $product_id ), $product_id, $item_id, $item ); $do_update = ( 0 !== $cost ); } else { $do_update = false; diff --git a/includes/class-alg-wc-cog.php b/includes/class-alg-wc-cog.php index 8195c20..ccb2fd8 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.1.8'; + public $version = '3.1.9'; /** * @since 1.0.0 diff --git a/includes/settings/class-alg-wc-cog-settings-compatibility.php b/includes/settings/class-alg-wc-cog-settings-compatibility.php index c8c03bc..20f3df2 100644 --- a/includes/settings/class-alg-wc-cog-settings-compatibility.php +++ b/includes/settings/class-alg-wc-cog-settings-compatibility.php @@ -2,7 +2,7 @@ /** * Cost of Goods for WooCommerce - Compatibility Settings. * - * @version 2.8.7 + * @version 3.1.9 * @since 2.4.6 * @author WPFactory */ @@ -36,7 +36,7 @@ function __construct() { /** * get_settings. * - * @version 2.8.7 + * @version 3.1.9 * @since 2.4.6 */ function get_settings() { @@ -280,6 +280,34 @@ function get_settings() { 'id' => 'alg_wc_cog_compatibility_wc_food_options', ), ); + $wc_measurement_price_calculator_opts = array( + array( + 'title' => __( 'WooCommerce Measurement Price Calculator', 'cost-of-goods-for-woocommerce' ), + 'type' => 'title', + 'desc' => sprintf( __( 'Compatibility with %s plugin.', 'cost-of-goods-for-woocommerce' ), '' . __( 'WooCommerce Measurement Price Calculator', 'cost-of-goods-for-woocommerce' ) . '' ), + 'id' => 'alg_wc_cog_compatibility_wc_measurement_price_calc_options', + ), + array( + 'title' => __( 'Cost', 'cost-of-goods-for-woocommerce' ), + 'desc' => __( 'Adjust the cost of goods sold according to the product measurement', 'cost-of-goods-for-woocommerce' ), + 'id' => 'alg_wc_cog_comp_wcmpc_adjust_cost_by_measure', + 'default' => 'no', + 'type' => 'checkbox', + 'custom_attributes' => apply_filters( 'alg_wc_cog_settings', array( 'disabled' => 'disabled' ) ), + ), + array( + 'title' => __( 'Cost field label placeholder', 'cost-of-goods-for-woocommerce' ), + 'desc' => sprintf(__( 'Add the placeholder %s to the %s option', 'cost-of-goods-for-woocommerce' ), '%measurement_unit%',''.__('cost field label').''), + 'id' => 'alg_wc_cog_comp_wcmpc_add_measurement_unit_placeholder_to_cost_label', + 'default' => 'no', + 'type' => 'checkbox', + 'custom_attributes' => apply_filters( 'alg_wc_cog_settings', array( 'disabled' => 'disabled' ) ), + ), + array( + 'type' => 'sectionend', + 'id' => 'alg_wc_cog_compatibility_wc_measurement_price_calc_options', + ), + ); return array_merge( $compatibility_opts, $curcy_multicurrency_opts, @@ -288,7 +316,8 @@ function get_settings() { $wp_all_import_opts, $wpc_product_bundle_opts, $atum_opts, - $wc_food_opts + $wc_food_opts, + $wc_measurement_price_calculator_opts ); } diff --git a/includes/settings/class-alg-wc-cog-settings-products.php b/includes/settings/class-alg-wc-cog-settings-products.php index 618f7c7..1d283b7 100644 --- a/includes/settings/class-alg-wc-cog-settings-products.php +++ b/includes/settings/class-alg-wc-cog-settings-products.php @@ -2,7 +2,7 @@ /** * Cost of Goods for WooCommerce - Products Section Settings. * - * @version 3.1.7 + * @version 3.1.9 * @since 1.7.0 * @author WPFactory */ @@ -28,7 +28,7 @@ function __construct() { /** * get_settings. * - * @version 3.1.7 + * @version 3.1.9 * @since 1.7.0 * @todo [later] Cost field label: use in quick and bulk edit * @todo [later] `alg_wc_cog_products_add_stock`: better description @@ -89,13 +89,17 @@ function get_settings() { 'id' => 'alg_wc_cog_cost_field_options', ), array( - 'title' => __( 'Cost field label', 'cost-of-goods-for-woocommerce' ), - 'desc' => sprintf( __( 'Available placeholders: %s.', 'cost-of-goods-for-woocommerce' ), - '' . implode( ', ', array( '%currency_symbol%' ) ) . '' ), - 'desc_tip' => __( 'Customizes the cost field input label added to admin product pages.', 'cost-of-goods-for-woocommerce' ), - 'id' => 'alg_wc_cog_product_cost_field_template', - 'default' => sprintf( __( 'Cost (excl. tax) (%s)', 'cost-of-goods-for-woocommerce' ), '%currency_symbol%' ), - 'type' => 'text', + 'title' => __( 'Cost field label', 'cost-of-goods-for-woocommerce' ), + 'desc' => __( 'Placeholders:', 'cost-of-goods-for-woocommerce' ) . ' ' . alg_wc_cog_array_to_string( + alg_wc_cog()->core->cost_inputs->get_cost_input_label_placeholders( null ), array( + 'item_template' => '{key}', + 'glue' => ',' + ) + ) . '.', + 'desc_tip' => __( 'Customizes the cost field input label added to admin product pages.', 'cost-of-goods-for-woocommerce' ), + 'id' => 'alg_wc_cog_product_cost_field_template', + 'default' => sprintf( __( 'Cost (excl. tax) (%s)', 'cost-of-goods-for-woocommerce' ), '%currency_symbol%' ), + 'type' => 'text', 'wpfse_data' => array( 'description' => '{desc_tip}' ), diff --git a/includes/settings/class-alg-wc-cog-settings-shortcodes.php b/includes/settings/class-alg-wc-cog-settings-shortcodes.php index 5773f87..45d4f73 100644 --- a/includes/settings/class-alg-wc-cog-settings-shortcodes.php +++ b/includes/settings/class-alg-wc-cog-settings-shortcodes.php @@ -62,7 +62,7 @@ function get_settings() { array( 'title' => '[alg_wc_cog_product_profit]', 'desc' => __( 'Displays the product profit', 'cost-of-goods-for-woocommerce' ), - 'desc_tip' => 'Params:
' . alg_wc_cog_array_to_string( array( + 'desc_tip' => __( 'Params:', 'cost-of-goods-for-woocommerce' ) . '' . '
' . alg_wc_cog_array_to_string( array( 'product_id' => __( 'Product ID.', 'cost-of-goods-for-woocommerce' ) . ' ' . __( 'If empty, will try to get the current product id.', 'cost-of-goods-for-woocommerce' ), 'profit_template' => __( 'Profit template.', 'cost-of-goods-for-woocommerce' ) . ' ' . __( 'Default:', 'cost-of-goods-for-woocommerce' ) . ' ' . _wp_specialchars( get_option( 'alg_wc_cog_product_profit_html_template', '%profit% (%profit_percent%)' ) ) . '.', 'html_template' => __( 'HTML template.', 'cost-of-goods-for-woocommerce' ) . ' ' . __( 'Default:', 'cost-of-goods-for-woocommerce' ) . ' ' . _wp_specialchars( '{content}' ) . '.', @@ -74,7 +74,7 @@ function get_settings() { array( 'title' => '[alg_wc_cog_product_cost]', 'desc' => __( 'Displays the product cost', 'cost-of-goods-for-woocommerce' ), - 'desc_tip' => 'Params:
' . alg_wc_cog_array_to_string( array( + 'desc_tip' => __( 'Params:', 'cost-of-goods-for-woocommerce' ) . '' . '
' . alg_wc_cog_array_to_string( array( 'product_id' => __( 'Product ID.', 'cost-of-goods-for-woocommerce' ) . ' ' . __( 'If empty, will try to get the current product id.', 'cost-of-goods-for-woocommerce' ), 'html_template' => __( 'HTML template.', 'cost-of-goods-for-woocommerce' ) . ' ' . __( 'Default:', 'cost-of-goods-for-woocommerce' ) . ' ' . _wp_specialchars( '{content}' ) . '.', ), array( 'item_template' => '
  • {key} - {value}', 'glue' => '
  • ' ) ), diff --git a/langs/cost-of-goods-for-woocommerce.pot b/langs/cost-of-goods-for-woocommerce.pot index dfbc8d0..06ab844 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.1.8\n" +"Project-Id-Version: cost-of-goods-for-woocommerce 3.1.9\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: 2023-12-13T13:29:25+01:00\n" +"POT-Creation-Date: 2023-12-19T16:25:09+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" @@ -86,6 +86,7 @@ msgstr "" #: includes/pro/class-alg-wc-cog-pro.php:461 #: includes/pro/class-alg-wc-cog-pro.php:818 #: includes/pro/reports/class-wc-report-alg-cog-stock.php:121 +#: includes/settings/class-alg-wc-cog-settings-compatibility.php:291 #: includes/tools/class-alg-wc-cog-wplist-bulk-edit-tool.php:368 #: includes/analytics/build/index.js:1 #: includes/analytics/src/modules/categories.js:32 @@ -142,18 +143,18 @@ msgid "Cost of Goods for WooCommerce - Bulk update variation costs" msgstr "" #: includes/class-alg-wc-cog-cost-inputs.php:47 -#: includes/settings/class-alg-wc-cog-settings-products.php:97 +#: includes/settings/class-alg-wc-cog-settings-products.php:101 msgid "Cost (excl. tax) (%s)" msgstr "" -#: includes/class-alg-wc-cog-cost-inputs.php:86 -#: includes/class-alg-wc-cog-cost-inputs.php:141 +#: includes/class-alg-wc-cog-cost-inputs.php:87 +#: includes/class-alg-wc-cog-cost-inputs.php:158 #: includes/tools/class-alg-wc-cog-wplist-bulk-edit-tool.php:308 msgid "Profit: %s" msgstr "" -#: includes/class-alg-wc-cog-cost-inputs.php:87 -#: includes/class-alg-wc-cog-cost-inputs.php:142 +#: includes/class-alg-wc-cog-cost-inputs.php:88 +#: includes/class-alg-wc-cog-cost-inputs.php:159 #: includes/tools/class-alg-wc-cog-wplist-bulk-edit-tool.php:308 msgid "N/A" msgstr "" @@ -162,7 +163,7 @@ msgstr "" #: includes/class-alg-wc-cog-orders-meta-boxes.php:213 #: includes/pro/class-alg-wc-cog-pro.php:810 #: includes/settings/class-alg-wc-cog-settings-orders.php:407 -#: includes/settings/class-alg-wc-cog-settings-products.php:248 +#: includes/settings/class-alg-wc-cog-settings-products.php:252 #: includes/settings/class-alg-wc-settings-cog.php:24 msgid "Cost of Goods" msgstr "" @@ -298,15 +299,15 @@ msgid "Enter values and \"Update\" the product." msgstr "" #: includes/class-alg-wc-cog-products-add-stock.php:71 -#: includes/settings/class-alg-wc-cog-settings-products.php:240 +#: includes/settings/class-alg-wc-cog-settings-products.php:244 msgid "\"Stock\" will be added to your inventory, and \"Cost\" will be used to calculate new average cost of goods for the product." msgstr "" #: includes/class-alg-wc-cog-products-add-stock.php:73 #: includes/pro/class-alg-wc-cog-pro.php:810 -#: includes/settings/class-alg-wc-cog-settings-products.php:238 -#: includes/settings/class-alg-wc-cog-settings-products.php:245 -#: includes/settings/class-alg-wc-cog-settings-products.php:248 +#: includes/settings/class-alg-wc-cog-settings-products.php:242 +#: includes/settings/class-alg-wc-cog-settings-products.php:249 +#: includes/settings/class-alg-wc-cog-settings-products.php:252 msgid "Add stock" msgstr "" @@ -324,7 +325,7 @@ msgid "History" msgstr "" #: includes/class-alg-wc-cog-products-add-stock.php:402 -#: includes/settings/class-alg-wc-cog-settings-products.php:204 +#: includes/settings/class-alg-wc-cog-settings-products.php:208 msgid "Date" msgstr "" @@ -346,8 +347,8 @@ msgid "Update variation(s)" msgstr "" #: includes/class-alg-wc-cog-products-cost-archive.php:53 -#: includes/settings/class-alg-wc-cog-settings-products.php:184 -#: includes/settings/class-alg-wc-cog-settings-products.php:190 +#: includes/settings/class-alg-wc-cog-settings-products.php:188 +#: includes/settings/class-alg-wc-cog-settings-products.php:194 msgid "Cost archive" msgstr "" @@ -924,6 +925,7 @@ msgstr "" #: includes/settings/class-alg-wc-cog-settings-compatibility.php:187 #: includes/settings/class-alg-wc-cog-settings-compatibility.php:226 #: includes/settings/class-alg-wc-cog-settings-compatibility.php:265 +#: includes/settings/class-alg-wc-cog-settings-compatibility.php:287 msgid "Compatibility with %s plugin." msgstr "" @@ -1117,12 +1119,29 @@ msgstr "" msgid "For now, all the options costs will be \"quantity based\" calculated." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-compatibility.php:311 +#: includes/settings/class-alg-wc-cog-settings-compatibility.php:285 +#: includes/settings/class-alg-wc-cog-settings-compatibility.php:287 +msgid "WooCommerce Measurement Price Calculator" +msgstr "" + +#: includes/settings/class-alg-wc-cog-settings-compatibility.php:292 +msgid "Adjust the cost of goods sold according to the product measurement" +msgstr "" + +#: includes/settings/class-alg-wc-cog-settings-compatibility.php:299 +msgid "Cost field label placeholder" +msgstr "" + +#: includes/settings/class-alg-wc-cog-settings-compatibility.php:300 +msgid "Add the placeholder %s to the %s option" +msgstr "" + +#: includes/settings/class-alg-wc-cog-settings-compatibility.php:340 #: includes/settings/class-alg-wc-cog-settings-tools.php:54 msgid "Please, reload the page to see the next scheduled event info." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-compatibility.php:315 +#: includes/settings/class-alg-wc-cog-settings-compatibility.php:344 #: includes/settings/class-alg-wc-cog-settings-tools.php:59 msgid "Next event scheduled to %s" msgstr "" @@ -1338,7 +1357,7 @@ msgid "Adds handling fees inputs for each order item to admin order edit page." msgstr "" #: includes/settings/class-alg-wc-cog-settings-orders.php:143 -#: includes/settings/class-alg-wc-cog-settings-products.php:197 +#: includes/settings/class-alg-wc-cog-settings-products.php:201 msgid "Meta box" msgstr "" @@ -1360,7 +1379,6 @@ msgstr "" #: includes/settings/class-alg-wc-cog-settings-orders.php:160 #: includes/settings/class-alg-wc-cog-settings-products.php:45 -#: includes/settings/class-alg-wc-cog-settings-products.php:93 msgid "Available placeholders: %s." msgstr "" @@ -1750,286 +1768,290 @@ msgstr "" msgid "Cost field label" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:95 +#: includes/settings/class-alg-wc-cog-settings-products.php:93 +msgid "Placeholders:" +msgstr "" + +#: includes/settings/class-alg-wc-cog-settings-products.php:99 msgid "Customizes the cost field input label added to admin product pages." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:129 +#: includes/settings/class-alg-wc-cog-settings-products.php:133 msgid "Admin products list columns" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:131 +#: includes/settings/class-alg-wc-cog-settings-products.php:135 msgid "This section lets you add custom columns to WooCommerce admin %s." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:132 +#: includes/settings/class-alg-wc-cog-settings-products.php:136 msgid "products list" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:136 +#: includes/settings/class-alg-wc-cog-settings-products.php:140 msgid "Product cost" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:137 +#: includes/settings/class-alg-wc-cog-settings-products.php:141 msgid "Add product cost column" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:143 -#: includes/settings/class-alg-wc-cog-settings-products.php:160 +#: includes/settings/class-alg-wc-cog-settings-products.php:147 +#: includes/settings/class-alg-wc-cog-settings-products.php:164 msgid "Column width (%s)." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:144 -#: includes/settings/class-alg-wc-cog-settings-products.php:161 +#: includes/settings/class-alg-wc-cog-settings-products.php:148 +#: includes/settings/class-alg-wc-cog-settings-products.php:165 msgid "Zero or empty values will disable width." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:149 +#: includes/settings/class-alg-wc-cog-settings-products.php:153 msgid "Customize the product cost column width" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:153 +#: includes/settings/class-alg-wc-cog-settings-products.php:157 msgid "Product profit" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:154 +#: includes/settings/class-alg-wc-cog-settings-products.php:158 msgid "Add product profit column" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:166 +#: includes/settings/class-alg-wc-cog-settings-products.php:170 msgid "Customize the product profit column width" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:170 +#: includes/settings/class-alg-wc-cog-settings-products.php:174 msgid "Width unit" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:171 +#: includes/settings/class-alg-wc-cog-settings-products.php:175 msgid "Any CSS unit can be used, like px, %, ch, and so on..." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:185 +#: includes/settings/class-alg-wc-cog-settings-products.php:189 msgid "Save a history of product costs each time they get updated." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:191 +#: includes/settings/class-alg-wc-cog-settings-products.php:195 msgid "Save cost archive" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:198 +#: includes/settings/class-alg-wc-cog-settings-products.php:202 msgid "Enable a cost archive meta box on admin product page" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:205 +#: includes/settings/class-alg-wc-cog-settings-products.php:209 msgid "Date format." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:206 -#: includes/settings/class-alg-wc-cog-settings-products.php:290 +#: includes/settings/class-alg-wc-cog-settings-products.php:210 +#: includes/settings/class-alg-wc-cog-settings-products.php:294 msgid "Example:" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:207 -#: includes/settings/class-alg-wc-cog-settings-products.php:291 +#: includes/settings/class-alg-wc-cog-settings-products.php:211 +#: includes/settings/class-alg-wc-cog-settings-products.php:295 msgid "See format options." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:213 +#: includes/settings/class-alg-wc-cog-settings-products.php:217 msgid "Date order." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:215 -#: includes/settings/class-alg-wc-cog-settings-products.php:299 +#: includes/settings/class-alg-wc-cog-settings-products.php:219 +#: includes/settings/class-alg-wc-cog-settings-products.php:303 msgid "Ascending" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:216 -#: includes/settings/class-alg-wc-cog-settings-products.php:300 +#: includes/settings/class-alg-wc-cog-settings-products.php:220 +#: includes/settings/class-alg-wc-cog-settings-products.php:304 msgid "Descending" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:223 +#: includes/settings/class-alg-wc-cog-settings-products.php:227 msgid "MySQL" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:224 +#: includes/settings/class-alg-wc-cog-settings-products.php:228 msgid "Use %s function to get the dates" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:225 +#: includes/settings/class-alg-wc-cog-settings-products.php:229 msgid "Disable if the archive does not work. Note: If disabled, the performance will be slower." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:239 +#: includes/settings/class-alg-wc-cog-settings-products.php:243 msgid "Calculate new average cost of goods for the product based on new \"Stock\" and \"Cost\" values you enter." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:246 +#: includes/settings/class-alg-wc-cog-settings-products.php:250 msgid "Enable \"Add stock\" feature" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:247 +#: includes/settings/class-alg-wc-cog-settings-products.php:251 msgid "A meta box \"%s\" will be added to the product edit page." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:254 +#: includes/settings/class-alg-wc-cog-settings-products.php:258 msgid "Cost calculation expression" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:255 +#: includes/settings/class-alg-wc-cog-settings-products.php:259 msgid "Available placeholders: " msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:263 +#: includes/settings/class-alg-wc-cog-settings-products.php:267 msgid "The expression used to calculate the new average cost of the product." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:273 +#: includes/settings/class-alg-wc-cog-settings-products.php:277 msgid "Empty cost field" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:274 +#: includes/settings/class-alg-wc-cog-settings-products.php:278 msgid "The cost value considered when the field is empty." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:275 +#: includes/settings/class-alg-wc-cog-settings-products.php:279 msgid "Use this option if you want to Add stock without worrying about filling the cost value." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:282 +#: includes/settings/class-alg-wc-cog-settings-products.php:286 msgid "Prevents calculation" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:283 +#: includes/settings/class-alg-wc-cog-settings-products.php:287 msgid "Uses last cost value from \"Add stock\" history" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:284 +#: includes/settings/class-alg-wc-cog-settings-products.php:288 msgid "Uses current cost" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:288 +#: includes/settings/class-alg-wc-cog-settings-products.php:292 msgid "History date" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:289 +#: includes/settings/class-alg-wc-cog-settings-products.php:293 msgid "History date format." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:297 +#: includes/settings/class-alg-wc-cog-settings-products.php:301 msgid "History date order." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:307 +#: includes/settings/class-alg-wc-cog-settings-products.php:311 msgid "Negative stock" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:308 +#: includes/settings/class-alg-wc-cog-settings-products.php:312 msgid "Allow negative stock values" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:309 +#: includes/settings/class-alg-wc-cog-settings-products.php:313 msgid "If enabled, the stock may also be reduced." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:322 +#: includes/settings/class-alg-wc-cog-settings-products.php:326 msgid "Quick and Bulk Edit" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:327 +#: includes/settings/class-alg-wc-cog-settings-products.php:331 msgid "Cost field" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:328 -#: includes/settings/class-alg-wc-cog-settings-products.php:337 +#: includes/settings/class-alg-wc-cog-settings-products.php:332 +#: includes/settings/class-alg-wc-cog-settings-products.php:341 msgid "Add \"Cost\" field to product \"%s\"" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:329 -#: includes/settings/class-alg-wc-cog-settings-products.php:356 +#: includes/settings/class-alg-wc-cog-settings-products.php:333 +#: includes/settings/class-alg-wc-cog-settings-products.php:360 msgid "Quick Edit" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:338 -#: includes/settings/class-alg-wc-cog-settings-products.php:365 +#: includes/settings/class-alg-wc-cog-settings-products.php:342 +#: includes/settings/class-alg-wc-cog-settings-products.php:369 msgid "Bulk Actions" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:338 -#: includes/settings/class-alg-wc-cog-settings-products.php:365 +#: includes/settings/class-alg-wc-cog-settings-products.php:342 +#: includes/settings/class-alg-wc-cog-settings-products.php:369 msgid "Edit" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:346 +#: includes/settings/class-alg-wc-cog-settings-products.php:350 msgid "Replace all variations from the main variable product" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:347 +#: includes/settings/class-alg-wc-cog-settings-products.php:351 msgid "The cost field from the main variable product will replace the cost of all variations." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:354 +#: includes/settings/class-alg-wc-cog-settings-products.php:358 msgid "\"Add stock\" fields" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:355 -#: includes/settings/class-alg-wc-cog-settings-products.php:364 +#: includes/settings/class-alg-wc-cog-settings-products.php:359 +#: includes/settings/class-alg-wc-cog-settings-products.php:368 msgid "Add \"Add stock\" fields to product \"%s\"" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:380 +#: includes/settings/class-alg-wc-cog-settings-products.php:384 msgid "Cost sanitization" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:385 +#: includes/settings/class-alg-wc-cog-settings-products.php:389 msgid "Cost update" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:386 +#: includes/settings/class-alg-wc-cog-settings-products.php:390 msgid "Replace comma by dots when updating cost meta" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:392 +#: includes/settings/class-alg-wc-cog-settings-products.php:396 msgid "Cost import" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:393 +#: includes/settings/class-alg-wc-cog-settings-products.php:397 msgid "Get only the cost number when using the %s" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:393 +#: includes/settings/class-alg-wc-cog-settings-products.php:397 msgid "WooCommerce Importer" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:394 +#: includes/settings/class-alg-wc-cog-settings-products.php:398 msgid "Useful if you want to ignore price symbols from the CSV when importing." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:400 +#: includes/settings/class-alg-wc-cog-settings-products.php:404 msgid "Product export" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:401 +#: includes/settings/class-alg-wc-cog-settings-products.php:405 msgid "Convert cost to number" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:402 +#: includes/settings/class-alg-wc-cog-settings-products.php:406 msgid "If disabled it will be parsed as string." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:408 +#: includes/settings/class-alg-wc-cog-settings-products.php:412 msgid "Dots and commas operation when exporting the product cost." msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:413 +#: includes/settings/class-alg-wc-cog-settings-products.php:417 msgid "Convert commas to dots" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:414 +#: includes/settings/class-alg-wc-cog-settings-products.php:418 msgid "Convert dots to commas" msgstr "" -#: includes/settings/class-alg-wc-cog-settings-products.php:415 +#: includes/settings/class-alg-wc-cog-settings-products.php:419 msgid "None" msgstr "" @@ -2147,6 +2169,11 @@ msgstr "" msgid "Displays the product profit" msgstr "" +#: includes/settings/class-alg-wc-cog-settings-shortcodes.php:65 +#: includes/settings/class-alg-wc-cog-settings-shortcodes.php:77 +msgid "Params:" +msgstr "" + #: includes/settings/class-alg-wc-cog-settings-shortcodes.php:66 #: includes/settings/class-alg-wc-cog-settings-shortcodes.php:78 msgid "Product ID." diff --git a/readme.txt b/readme.txt index 1034d93..4a1bfc3 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.4 -Stable tag: 3.1.8 +Stable tag: 3.1.9 License: GNU General Public License v3.0 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -365,6 +365,11 @@ Once activated, access the plugin's settings by navigating to “WooCommerce > S == Changelog == += 3.1.9 - 19/12/2023 = +* Dev - Compatibility - Measurement Price Calculator - Add option to adjust the cost of goods sold according to the product measurement. +* Dev - Compatibility - Measurement Price Calculator - Create option to add the placeholder `%measurement_unit%` to the cost field label option. +* Dev - Add filter hook `alg_wc_cog_cost_input_label_placeholders`. + = 3.1.8 - 13/12/2023 = * Fix - Uncaught Error: Call to a member function is_type() on bool in `Alg_WC_Cost_of_Goods_Products_Add_Stock`. * WC tested up to: 8.4.