Skip to content

Commit

Permalink
v3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo-sg-pacheco committed Feb 29, 2024
1 parent a35b2a2 commit da54a0b
Show file tree
Hide file tree
Showing 15 changed files with 1,139 additions and 706 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.2.9
Version: 3.3.0
Author: WPFactory
Author URI: https://wpfactory.com
Text Domain: cost-of-goods-for-woocommerce
Domain Path: /langs
Copyright: © 2024 WPFactory
WC tested up to: 8.4
WC tested up to: 8.6
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
Expand Down
4 changes: 2 additions & 2 deletions includes/background-process/class-alg-wc-cog-bkg-process.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ protected function task( $item ) {
/**
* complete.
*
* @version 2.3.0
* @version 3.3.0
* @since 2.3.0
*/
protected function complete() {
$logger = wc_get_logger();
$logger->info( 'Task complete', array( 'source' => $this->get_logger_context() ) );
$logger->info( sprintf( '%s task complete', $this->get_action_label() ), array( 'source' => $this->get_logger_context() ) );
$this->send_email();
parent::complete(); // TODO: Change the autogenerated stub
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Cost of Goods for WooCommerce - Background Process - Update Cost.
*
* @version 2.9.5
* @version 3.3.0
* @since 2.5.1
* @author WPFactory
*/
Expand Down Expand Up @@ -35,25 +35,17 @@ protected function get_action_label() {
/**
* task.
*
* @version 2.9.5
* @version 3.3.0
* @since 2.5.1
*
* @param mixed $item
* @return bool|mixed
*/
protected function task( $item ) {
parent::task( $item );
$product_id = isset( $item['product_id'] ) ? $item['product_id'] : '';
$percentage = isset( $item['percentage'] ) ? $item['percentage'] : '';
$update_type = isset( $item['update_type'] ) ? $item['update_type'] : '';
$costs_filter = isset( $item['costs_filter'] ) ? $item['costs_filter'] : '';
alg_wc_cog()->core->products->update_product_cost_by_percentage( array(
'product_id' => $product_id,
'percentage' => $percentage,
'update_type' => $update_type, // profit | price
'costs_filter' => $costs_filter,
'update_variations' => true
) );
$function = isset( $item['products_function'] ) ? $item['products_function'] : '';
call_user_func_array( array( alg_wc_cog()->core->products, $function ), array( $item ) );

return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Cost of Goods for WooCommerce - Background Process - Update Price.
*
* @version 2.7.9
* @version 3.3.0
* @since 2.6.3
* @author WPFactory
*/
Expand Down Expand Up @@ -33,15 +33,16 @@ protected function get_action_label() {
/**
* task.
*
* @version 2.7.9
* @version 3.3.0
* @since 2.6.3
*
* @param mixed $item
* @return bool|mixed
*/
protected function task( $item ) {
parent::task( $item );
alg_wc_cog()->core->products->update_product_price_by_profit( $item );
$function = isset( $item['products_function'] ) ? $item['products_function'] : '';
call_user_func_array( array( alg_wc_cog()->core->products, $function ), array( $item ) );
return false;
}
}
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions includes/class-alg-wc-cog-cost-inputs.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function get_options() {
/**
* add_hooks.
*
* @version 2.6.5
* @version 3.3.0
* @since 2.6.4
*/
function add_hooks(){
Expand All @@ -59,7 +59,7 @@ function add_hooks(){
add_action( 'woocommerce_bookings_after_display_cost', array( $this, 'add_cost_input' ) );
add_action( 'save_post_product', array( $this, 'save_cost_input' ), PHP_INT_MAX - 2, 2 );
// Cost input on admin product page (variable product)
add_action( 'woocommerce_variation_options_pricing', array( $this, 'add_cost_input_variation' ), 10, 3 );
add_action( 'woocommerce_variation_options_pricing', array( $this, 'add_cost_input_variation' ), 9, 3 );
add_action( 'woocommerce_save_product_variation', array( $this, 'save_cost_input_variation' ), PHP_INT_MAX, 2 );
add_action( 'woocommerce_product_options_general_product_data', array( $this, 'add_cost_input_variable' ), PHP_INT_MAX );
}
Expand Down
11 changes: 10 additions & 1 deletion 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.2.7
* @version 3.3.0
* @since 2.1.0
* @author WPFactory
*/
Expand Down Expand Up @@ -257,6 +257,15 @@ class Alg_WC_Cost_of_Goods_Orders {
*/
protected $avoid_empty_order_metadata_saving = null;

/**
* $order_extra_cost_from_meta.
*
* @since 3.3.0
*
* @var
*/
public $order_extra_cost_from_meta;

/**
* Constructor.
*
Expand Down
Loading

0 comments on commit da54a0b

Please sign in to comment.