Skip to content

Commit

Permalink
v3.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo-sg-pacheco committed Nov 28, 2023
1 parent 86939e0 commit f55d4c3
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 35 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 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.3
Version: 3.1.4
Author: WPFactory
Author URI: https://wpfactory.com
Text Domain: cost-of-goods-for-woocommerce
Domain Path: /langs
Copyright: © 2023 WPFactory
WC tested up to: 8.2
WC tested up to: 8.3
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
Expand Down
11 changes: 7 additions & 4 deletions includes/class-alg-wc-cog-orders-meta-boxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Cost of Goods for WooCommerce - Orders Meta Boxes Class.
*
* @version 3.1.3
* @version 3.1.4
* @since 2.2.0
* @author WPFactory
*/
Expand Down Expand Up @@ -123,13 +123,16 @@ function add_order_meta_box() {
/**
* render_order_meta_box.
*
* @version 3.1.3
* @version 3.1.4
* @since 1.4.0
* @todo [maybe] order total
*/
function render_order_meta_box( $post ) {
$order_id = get_the_ID();
$order = wc_get_order( $order_id );
$order_id = ! empty( $post->ID ) ? $post->ID : get_the_ID();
$order = wc_get_order( $order_id );
if ( ! is_a( $order, 'WC_Order' ) ) {
return;
}
$cost = $order->get_meta( '_alg_wc_cog_order_' . 'cost', true );
$handling_fee = $order->get_meta( '_alg_wc_cog_order_' . 'handling_fee', true );
$profit = $order->get_meta( '_alg_wc_cog_order_' . 'profit', true );
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.1.3';
public $version = '3.1.4';

/**
* @since 1.0.0
Expand Down
4 changes: 2 additions & 2 deletions includes/settings/class-alg-wc-cog-settings-advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ function get_settings() {
'options' => alg_wc_cog()->core->orders->get_new_order_hooks_for_cost_updating()
),
array(
'title' => __( 'Meta data', 'cost-of-goods-for-woocommerce' ),
'desc' => __( 'Avoid empty order meta data from being saved to database', 'cost-of-goods-for-woocommerce' ),
'title' => __( 'Metadata', 'cost-of-goods-for-woocommerce' ),
'desc' => __( 'Avoid empty order metadata from being saved to database', 'cost-of-goods-for-woocommerce' ),
'id' => 'alg_wc_cog_avoid_empty_order_metadata_saving',
'default' => 'yes',
'type' => 'checkbox',
Expand Down
50 changes: 25 additions & 25 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.1.3\n"
"Project-Id-Version: cost-of-goods-for-woocommerce 3.1.4\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: 2023-11-16T19:59:13+01:00\n"
"POT-Creation-Date: 2023-11-29T00:02: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"
Expand Down Expand Up @@ -74,7 +74,7 @@ msgstr ""
#: includes/analytics/class-alg-wc-cog-analytics-products.php:78
#: includes/analytics/class-alg-wc-cog-analytics-revenue.php:47
#: includes/analytics/class-alg-wc-cog-analytics-stock.php:88
#: includes/class-alg-wc-cog-orders-meta-boxes.php:148
#: includes/class-alg-wc-cog-orders-meta-boxes.php:151
#: includes/class-alg-wc-cog-orders.php:701
#: includes/class-alg-wc-cog-orders.php:811
#: includes/class-alg-wc-cog-products-add-stock.php:124
Expand All @@ -100,7 +100,7 @@ msgstr ""
#: includes/analytics/class-alg-wc-cog-analytics-products.php:114
#: includes/analytics/class-alg-wc-cog-analytics-revenue.php:48
#: includes/analytics/class-alg-wc-cog-analytics-stock.php:89
#: includes/class-alg-wc-cog-orders-meta-boxes.php:149
#: includes/class-alg-wc-cog-orders-meta-boxes.php:152
#: includes/class-alg-wc-cog-orders.php:702
#: includes/class-alg-wc-cog-orders.php:821
#: includes/class-alg-wc-cog-products.php:387
Expand Down Expand Up @@ -159,89 +159,89 @@ msgid "N/A"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:114
#: includes/class-alg-wc-cog-orders-meta-boxes.php:210
#: includes/class-alg-wc-cog-orders-meta-boxes.php:213
#: includes/pro/class-alg-wc-cog-pro.php:806
#: includes/settings/class-alg-wc-cog-settings-orders.php:407
#: includes/settings/class-alg-wc-cog-settings-products.php:235
#: includes/settings/class-alg-wc-settings-cog.php:24
msgid "Cost of Goods"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:155
#: includes/class-alg-wc-cog-orders-meta-boxes.php:158
#: includes/settings/class-alg-wc-cog-settings-orders.php:114
msgid "Item costs"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:156
#: includes/class-alg-wc-cog-orders-meta-boxes.php:159
#: includes/settings/class-alg-wc-cog-settings-orders.php:128
msgid "Item handling fees"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:157
#: includes/class-alg-wc-cog-orders-meta-boxes.php:160
msgid "Shipping method fee (fixed)"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:158
#: includes/class-alg-wc-cog-orders-meta-boxes.php:161
msgid "Shipping method fee (percent)"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:159
#: includes/class-alg-wc-cog-orders-meta-boxes.php:162
msgid "Shipping class fee (fixed)"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:160
#: includes/class-alg-wc-cog-orders-meta-boxes.php:163
msgid "Shipping class fee (percent)"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:161
#: includes/class-alg-wc-cog-orders-meta-boxes.php:164
msgid "Gateway fee (fixed)"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:162
#: includes/class-alg-wc-cog-orders-meta-boxes.php:165
msgid "Gateway fee (percent)"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:163
#: includes/class-alg-wc-cog-orders-meta-boxes.php:166
msgid "Order fee (fixed)"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:164
#: includes/class-alg-wc-cog-orders-meta-boxes.php:167
msgid "Order fee (percent)"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:165
#: includes/class-alg-wc-cog-orders-meta-boxes.php:168
#: includes/settings/class-alg-wc-cog-settings-orders.php:414
msgid "Handling fee"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:166
#: includes/class-alg-wc-cog-orders-meta-boxes.php:169
#: includes/settings/class-alg-wc-cog-settings-orders.php:422
msgid "Shipping fee"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:167
#: includes/class-alg-wc-cog-orders-meta-boxes.php:170
#: includes/settings/class-alg-wc-cog-settings-orders.php:430
msgid "Payment fee"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:168
#: includes/class-alg-wc-cog-orders-meta-boxes.php:171
msgid "Meta fees"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:178
#: includes/class-alg-wc-cog-orders-meta-boxes.php:181
msgid "Cost details"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:192
#: includes/class-alg-wc-cog-orders-meta-boxes.php:195
msgid "Extra profit details"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:210
#: includes/class-alg-wc-cog-orders-meta-boxes.php:213
#: includes/settings/class-alg-wc-cog-settings-orders.php:407
msgid "Extra costs"
msgstr ""

#: includes/class-alg-wc-cog-orders-meta-boxes.php:234
#: includes/class-alg-wc-cog-orders-meta-boxes.php:237
msgid "fee"
msgstr ""

Expand Down Expand Up @@ -744,11 +744,11 @@ msgid "Hooks from new orders that will trigger cost update."
msgstr ""

#: includes/settings/class-alg-wc-cog-settings-advanced.php:113
msgid "Meta data"
msgid "Metadata"
msgstr ""

#: includes/settings/class-alg-wc-cog-settings-advanced.php:114
msgid "Avoid empty order meta data from being saved to database"
msgid "Avoid empty order metadata from being saved to database"
msgstr ""

#: includes/settings/class-alg-wc-cog-settings-advanced.php:127
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.4
Stable tag: 3.1.3
Stable tag: 3.1.4
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,10 @@ Once activated, access the plugin's settings by navigating to “WooCommerce > S

== Changelog ==

= 3.1.4 - 28/11/2023 =
* Fix - Orders page triggers the error "Call to a member function `get_meta()` on bool in `Alg_WC_Cost_of_Goods_Orders_Meta_Boxes`".
* WC tested up to: 8.3.

= 3.1.3 - 16/11/2023 =
* Tested up to: 6.4.
* Dev - Advanced - Create new option to avoid saving empty order metadata.
Expand Down

0 comments on commit f55d4c3

Please sign in to comment.