Skip to content

Commit

Permalink
v3.5.8
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo-sg-pacheco committed Nov 26, 2024
1 parent f1252c1 commit f50f3c7
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 15 deletions.
4 changes: 2 additions & 2 deletions cost-of-goods-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
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.7
Version: 3.5.8
Author: WPFactory
Author URI: https://wpfactory.com
Text Domain: cost-of-goods-for-woocommerce
Domain Path: /langs
Copyright: © 2024 WPFactory
WC tested up to: 9.3
WC tested up to: 9.4
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
Expand Down
7 changes: 5 additions & 2 deletions includes/class-alg-wc-cog-orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Cost of Goods for WooCommerce - Orders Class.
*
* @version 3.5.6
* @version 3.5.8
* @since 2.1.0
* @author WPFactory
*/
Expand Down Expand Up @@ -1281,7 +1281,7 @@ function get_shipping_total_for_percentage_fees( $order ) {
/**
* update_order_items_costs.
*
* @version 3.5.6
* @version 3.5.8
* @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`)
Expand Down Expand Up @@ -1340,6 +1340,7 @@ function update_order_items_costs( $args ) {
$gateway_cost = 0;
$gateway_cost_fixed = 0;
$gateway_cost_percent = 0;
$gateway_cost_percent_max = alg_wc_cog_get_option( 'alg_wc_cog_gateway_costs_percent_max_value', array() );
// Fees: Order extra cost: all orders
$extra_cost = 0;
$extra_cost_fixed = 0;
Expand Down Expand Up @@ -1569,6 +1570,8 @@ function update_order_items_costs( $args ) {
$order,
$order_gateway
);
$gateway_cost_percent_max_local = $gateway_cost_percent_max[ $order_gateway ];
$gateway_cost_percent = ! empty( $gateway_cost_percent_max_local ) ? min( $gateway_cost_percent_max_local, $gateway_cost_percent ) : $gateway_cost_percent;
}
$gateway_cost = ( $gateway_cost_fixed + $gateway_cost_percent );
$profit -= $gateway_cost;
Expand Down
2 changes: 1 addition & 1 deletion includes/class-alg-wc-cog.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class Alg_WC_Cost_of_Goods {
* @since 1.0.0
* @var string
*/
public $version = '3.5.7';
public $version = '3.5.8';

/**
* @since 1.0.0
Expand Down
15 changes: 13 additions & 2 deletions includes/settings/class-alg-wc-cog-settings-gateways.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Cost of Goods for WooCommerce - Gateways Section Settings
*
* @version 2.4.3
* @version 3.5.8
* @since 1.5.0
* @author WPFactory
*/
Expand All @@ -28,7 +28,7 @@ function __construct() {
/**
* get_settings.
*
* @version 2.4.3
* @version 3.5.8
* @since 1.5.0
* @todo [maybe] better section desc (same for `$order_extra_cost_settings` and "Shipping"): how to recalculate order's profit/cost (i.e. update order or use tool)
*/
Expand Down Expand Up @@ -89,6 +89,17 @@ function get_settings() {
'hide' => true
)
),
array(
'desc' => __( 'Max value.', 'cost-of-goods-for-woocommerce' ),
'desc_tip' => __( 'Maximum absolute value returned for the percent calculation.', 'cost-of-goods-for-woocommerce' ),
'type' => 'number',
'id' => "alg_wc_cog_gateway_costs_percent_max_value[{$key}]",
'default' => 0,
'custom_attributes' => array( 'step' => '0.000001' ),
'wpfse_data' => array(
'hide' => true
)
),
array(
'type' => 'sectionend',
'id' => 'alg_wc_cog_gateway_' . $key,
Expand Down
10 changes: 9 additions & 1 deletion langs/cost-of-goods-for-woocommerce-de_DE.po
Original file line number Diff line number Diff line change
Expand Up @@ -3149,5 +3149,13 @@ msgid "Negative numbers will be converted to positive"
msgstr ""

#. Plugin Name of the plugin
msgid "Cost of Goods: Product Cost & Profit Calculator for WooCommerce"
msgid "Cost of Goods: Product Cost & Profit Calculator for WooCommerce Pro"
msgstr ""

#: includes/settings/class-alg-wc-cog-settings-gateways.php:93
msgid "Max value."
msgstr ""

#: includes/settings/class-alg-wc-cog-settings-gateways.php:94
msgid "Maximum absolute value returned for the percent calculation."
msgstr ""
10 changes: 9 additions & 1 deletion langs/cost-of-goods-for-woocommerce-tr_TR.po
Original file line number Diff line number Diff line change
Expand Up @@ -3185,5 +3185,13 @@ msgid "Negative numbers will be converted to positive"
msgstr ""

#. Plugin Name of the plugin
msgid "Cost of Goods: Product Cost & Profit Calculator for WooCommerce"
msgid "Cost of Goods: Product Cost & Profit Calculator for WooCommerce Pro"
msgstr ""

#: includes/settings/class-alg-wc-cog-settings-gateways.php:93
msgid "Max value."
msgstr ""

#: includes/settings/class-alg-wc-cog-settings-gateways.php:94
msgid "Maximum absolute value returned for the percent calculation."
msgstr ""
10 changes: 9 additions & 1 deletion langs/cost-of-goods-for-woocommerce-zh_CN.po
Original file line number Diff line number Diff line change
Expand Up @@ -3147,5 +3147,13 @@ msgid "Negative numbers will be converted to positive"
msgstr ""

#. Plugin Name of the plugin
msgid "Cost of Goods: Product Cost & Profit Calculator for WooCommerce"
msgid "Cost of Goods: Product Cost & Profit Calculator for WooCommerce Pro"
msgstr ""

#: includes/settings/class-alg-wc-cog-settings-gateways.php:93
msgid "Max value."
msgstr ""

#: includes/settings/class-alg-wc-cog-settings-gateways.php:94
msgid "Maximum absolute value returned for the percent calculation."
msgstr ""
14 changes: 11 additions & 3 deletions langs/cost-of-goods-for-woocommerce.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
# This file is distributed under the GNU General Public License v3.0.
msgid ""
msgstr ""
"Project-Id-Version: cost-of-goods-for-woocommerce 3.5.7\n"
"Project-Id-Version: cost-of-goods-for-woocommerce 3.5.8\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-11-01T14:27:48+01:00\n"
"POT-Creation-Date: 2024-11-27T00:06:10+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"

#. Plugin Name of the plugin
msgid "Cost of Goods: Product Cost & Profit Calculator for WooCommerce"
msgid "Cost of Goods: Product Cost & Profit Calculator for WooCommerce Pro"
msgstr ""

#. Plugin URI of the plugin
Expand Down Expand Up @@ -1478,6 +1478,14 @@ msgstr ""
msgid "Percent from order total."
msgstr ""

#: includes/settings/class-alg-wc-cog-settings-gateways.php:93
msgid "Max value."
msgstr ""

#: includes/settings/class-alg-wc-cog-settings-gateways.php:94
msgid "Maximum absolute value returned for the percent calculation."
msgstr ""

#: includes/settings/class-alg-wc-cog-settings-orders.php:43
msgid "Admin Orders List Columns"
msgstr ""
Expand Down
10 changes: 8 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Contributors: wpcodefactory, omardabbas, karzin, anbinder, algoritmika, kousikmukherjeeli
Tags: woocommerce, cost, cost of goods, profit, profit calculator
Requires at least: 6.1
Tested up to: 6.6
Stable tag: 3.5.7
Tested up to: 6.7
Stable tag: 3.5.8
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -344,6 +344,12 @@ Once activated, access the plugin's settings by navigating to “WooCommerce > S

== Changelog ==

= 3.5.8 - 26/11/2024 =
* Fix - Pro plugin name fixed.
* Dev - Payment gateways - Added new option to set a maximum value for a payment gateway.
* WC tested up to: 9.4.
* Tested up to: 6.7.

= 3.5.7 - 01/11/2024 =
* Fix - Cross-selling fixed.

Expand Down

0 comments on commit f50f3c7

Please sign in to comment.