Skip to content

Commit

Permalink
v3.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kousikmukherjee committed Oct 27, 2023
1 parent 0813018 commit 9afea6e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cost-of-goods-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.1
Version: 3.1.2
Author: WPFactory
Author URI: https://wpfactory.com
Text Domain: cost-of-goods-for-woocommerce
Expand Down
9 changes: 7 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.0.8
* @version 3.1.2
* @since 2.1.0
* @author WPFactory
*/
Expand Down Expand Up @@ -1219,7 +1219,7 @@ function get_shipping_total_for_percentage_fees( $order ) {
/**
* update_order_items_costs.
*
* @version 3.0.2
* @version 3.1.2
* @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 @@ -1389,6 +1389,11 @@ function update_order_items_costs( $args ) {
( 'per_shipping_class' === $shipping_classes_fixed_cost_calculation && ! in_array( $product_shipping_class_term->term_id, $shipping_classes_term_ids_used ) )
) {
$shipping_class_cost_fixed_total += (float) apply_filters( 'alg_wc_cog_order_shipping_class_cost_fixed', $shipping_class_cost, $order, $product_shipping_class_term->term_id );
} else if ( 'per_item_in_shipping_class' === $shipping_classes_fixed_cost_calculation ) {

$shipping_class_cost_per_item = $shipping_class_cost * $item->get_quantity();
$shipping_class_cost_fixed_total += (float) apply_filters( 'alg_wc_cog_order_shipping_class_cost_fixed', $shipping_class_cost_per_item, $order, $product_shipping_class_term->term_id );

}
}
// Percent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Cost of Goods for WooCommerce - Shipping classes Settings.
*
* @version 2.6.2
* @version 3.1.2
* @since 2.4.3
* @author WPFactory
*/
Expand All @@ -28,7 +28,7 @@ function __construct() {
/**
* get_settings.
*
* @version 2.6.2
* @version 3.1.2
* @since 2.4.3
* @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 @@ -62,6 +62,7 @@ function get_settings() {
'options' => array(
'per_product' => __( 'Per product', 'cost-of-goods-for-woocommerce' ),
'per_shipping_class' => __( 'Per shipping class', 'cost-of-goods-for-woocommerce' ),
'per_item_in_shipping_class' => __( 'Per item', 'cost-of-goods-for-woocommerce' ),
)
),
array(
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.3
Stable tag: 3.1.1
Stable tag: 3.1.2
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html

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

== Changelog ==

= 3.1.2 - 28/10/2023 =
* Dev - New Option "Per Item" Under Extra shipping classes costs > Fixed cost calculation.

= 3.1.1 - 20/10/2023 =
* Fix - Alg_WC_Cost_of_Goods_WP_List_Bulk_Edit_Tool->fix_paged_query_string_on_search_change() with cookies.

Expand Down

0 comments on commit 9afea6e

Please sign in to comment.