Skip to content

Commit

Permalink
v3.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo-sg-pacheco committed Dec 17, 2024
1 parent 9983fd9 commit f472e69
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 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.6.0
Version: 3.6.1
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.4
WC tested up to: 9.5
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
Expand Down
10 changes: 5 additions & 5 deletions includes/class-alg-wc-cog-products.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Cost of Goods for WooCommerce - Products Class.
*
* @version 3.3.4
* @version 3.6.1
* @since 2.1.0
* @author WPFactory
*/
Expand Down Expand Up @@ -550,7 +550,7 @@ function get_product_profit_html( $product_id, $template = '%profit% (%profit_pe
/**
* get_variable_product_html.
*
* @version 2.9.4
* @version 3.6.1
* @since 1.0.0
* @todo [maybe] use `get_available_variations()` instead of `get_children()`?
*/
Expand Down Expand Up @@ -579,8 +579,8 @@ function get_variable_product_html( $product_id, $profit_or_cost, $template ) {
$cost_max = (float) $this->get_product_cost( $product_id_max );
$profit_min = ( 0 != $cost_min ? $min / $cost_min * 100 : '' );
$profit_max = ( 0 != $cost_max ? $max / $cost_max * 100 : '' );
$price_min = $this->get_product_price( wc_get_product( $product_id_min ), array( 'return_zero_if_empty' => true ) );
$price_max = $this->get_product_price( wc_get_product( $product_id_max ), array( 'return_zero_if_empty' => true ) );
$price_min = (float) $this->get_product_price( wc_get_product( $product_id_min ), array( 'return_zero_if_empty' => true ) );
$price_max = (float) $this->get_product_price( wc_get_product( $product_id_max ), array( 'return_zero_if_empty' => true ) );
$margin_min = ( 0 != $price_min && '' !== $min ? $min / $price_min * 100 : '' );
$margin_max = ( 0 != $price_max && '' !== $max ? $max / $price_max * 100 : '' );
$placeholders['%profit_percent%'] = sprintf( '%0.2f%% – %0.2f%%', $profit_min, $profit_max );
Expand All @@ -590,7 +590,7 @@ function get_variable_product_html( $product_id, $profit_or_cost, $template ) {
$placeholders[ "%{$profit_or_cost}%" ] = wc_price( $min );
if ( 'profit' === $profit_or_cost ) {
$cost = (float) $this->get_product_cost( $product_id_min );
$price = $this->get_product_price( wc_get_product( $product_id_min ) );
$price = (float) $this->get_product_price( wc_get_product( $product_id_min ) );
$placeholders['%profit_percent%'] = sprintf( '%0.2f%%', ( 0 != $cost ? $min / $cost * 100 : '' ) );
$placeholders['%profit_margin%'] = sprintf( '%0.2f%%', ( 0 != $price && '' !== $min ? $min / $price * 100 : '' ) );
}
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.6.0';
public $version = '3.6.1';

/**
* @since 1.0.0
Expand Down
4 changes: 2 additions & 2 deletions langs/cost-of-goods-for-woocommerce.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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.6.0\n"
"Project-Id-Version: cost-of-goods-for-woocommerce 3.6.1\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-10T23:39:13+01:00\n"
"POT-Creation-Date: 2024-12-17T21:31:58+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"
Expand Down
6 changes: 5 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.7
Stable tag: 3.6.0
Stable tag: 3.6.1
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,10 @@ Once activated, access the plugin's settings by navigating to “WooCommerce > S

== Changelog ==

= 3.6.1 - 17/12/2024 =
* Fix - Fixed possible "Unsupported operand types" issue.
* WC tested up to: 9.5.

= 3.6.0 - 10/12/2024 =
* Fix - Resolved an issue where some strings were not translatable.

Expand Down

0 comments on commit f472e69

Please sign in to comment.