Changeset 3840331
- Timestamp:
- 12/02/2026 02:55:40 PM (13 hours ago)
- Location:
- trackless
- Files:
-
- 6 edited
- 1 copied
-
tags/1.1.34 (copied) (copied from trackless/trunk )
-
tags/1.1.34/includes/class-trackless-batch.php (modified) (8 diffs)
-
tags/1.1.34/readme.txt (modified) (3 diffs)
-
tags/1.1.34/trackless.php (modified) (2 diffs)
-
trunk/includes/class-trackless-batch.php (modified) (8 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/trackless.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trackless/tags/1.1.34/includes/class-trackless-batch.php
r3839077 r3840331 631 631 $catId = 0; 632 632 $sku = ''; 633 $cost = '';634 633 if ($product) { 635 634 $sku = $product->get_sku(); … … 648 647 } 649 648 } 650 $cost = self::wholesale_price($product, $item);651 649 } 650 // Also without the product: a line of an older order whose product or variation was deleted since 651 // still carries the cost it kept when the order was placed (#272). 652 $cost = self::wholesale_price($product, $item); 652 653 653 654 $outItems[] = array( … … 726 727 * The `trackless_wholesale_price` filter gets the result and the product last, for a shop that stores cost 727 728 * elsewhere. Without a cost the price stays '' (never 0): the margin of the line is then unknown. 729 * A line whose product or variation was deleted since ($product false, #272) has only what the line itself kept 730 * when the order was placed, from the same two sources in the same order. The filter is not called for it: its 731 * second argument has always been a product and a callback reads it. 728 732 */ 729 733 protected static function wholesale_price($product, $item = null) … … 732 736 if ($cost === '') { 733 737 $cost = self::native_cogs($product, $item); 738 } 739 if (!$product) { 740 return $cost; 734 741 } 735 742 … … 745 752 * without its own takes its parent's the way each plugin does: SkyVerge the default cost of the variable product 746 753 * (`_wc_cog_cost_variable`; the parent's `_wc_cog_cost` is the lowest cost of its variations), WPFactory the parent's 747 * `_alg_wc_cog_cost`. 754 * `_alg_wc_cog_cost`. A deleted product ($product false, #272) has no meta: only the cost kept on the line. 748 755 */ 749 756 protected static function addon_cost($product, $item) … … 756 763 } 757 764 } 765 } 766 if (!$product) { 767 return ''; 758 768 } 759 769 $parentId = (int) $product->get_parent_id(); … … 782 792 * Only with the feature turned on: off, the methods return dummy zeros and log "doing it wrong" on every call. 783 793 * Below WooCommerce 9.5 the feature does not exist and the methods are missing. 794 * A deleted product ($product false, #272) has no current value: only the value the line kept, and a line of 795 * quantity 0 then stays without a price. 784 796 */ 785 797 protected static function native_cogs($product, $item) … … 795 807 } 796 808 } 797 if ( method_exists($product, 'get_cogs_total_value')) {809 if ($product && method_exists($product, 'get_cogs_total_value')) { 798 810 $unit = round((float) $product->get_cogs_total_value(), 6); 799 811 if ($unit > 0) { -
trackless/tags/1.1.34/readme.txt
r3839696 r3840331 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.1.3 37 Stable tag: 1.1.34 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 113 113 114 114 == Changelog == 115 116 = 1.1.34 = 117 * Orders whose product or variation has been deleted since now send the purchase price the order line kept when the order was placed (Cost of Goods Sold in WooCommerce, or the SkyVerge or WPFactory Cost of Goods plugin), so their margin and profit are no longer missing. A line that never kept a cost still has no margin. 115 118 116 119 = 1.1.33 = … … 264 267 == Upgrade Notice == 265 268 269 = 1.1.34 = 270 Orders whose product or variation has since been deleted keep the purchase price their order line stored, so their margin and profit are no longer missing. 271 266 272 = 1.1.33 = 267 273 Margin also uses the purchase price from Cost of Goods Sold in WooCommerce 9.5 or newer. With a multi-currency plugin the reports stay in the shop's base currency. A cancelled, failed or refunded order no longer counts as a first purchase. -
trackless/tags/1.1.34/trackless.php
r3839077 r3840331 4 4 * Plugin URI: https://woomoduly.cz/produkt/trackless/ 5 5 * Description: Cookieless server-side analytics for WordPress. Traffic analytics on any site; with WooCommerce it also sends orders, revenue and margin to Trackless. 6 * Version: 1.1.3 36 * Version: 1.1.34 7 7 * Requires PHP: 7.4 8 8 * Requires at least: 6.2 … … 25 25 } 26 26 27 define('TRACKLESS_VERSION', '1.1.3 3');27 define('TRACKLESS_VERSION', '1.1.34'); 28 28 define('TRACKLESS_FILE', __FILE__); 29 29 define('TRACKLESS_DIR', plugin_dir_path(__FILE__)); -
trackless/trunk/includes/class-trackless-batch.php
r3839077 r3840331 631 631 $catId = 0; 632 632 $sku = ''; 633 $cost = '';634 633 if ($product) { 635 634 $sku = $product->get_sku(); … … 648 647 } 649 648 } 650 $cost = self::wholesale_price($product, $item);651 649 } 650 // Also without the product: a line of an older order whose product or variation was deleted since 651 // still carries the cost it kept when the order was placed (#272). 652 $cost = self::wholesale_price($product, $item); 652 653 653 654 $outItems[] = array( … … 726 727 * The `trackless_wholesale_price` filter gets the result and the product last, for a shop that stores cost 727 728 * elsewhere. Without a cost the price stays '' (never 0): the margin of the line is then unknown. 729 * A line whose product or variation was deleted since ($product false, #272) has only what the line itself kept 730 * when the order was placed, from the same two sources in the same order. The filter is not called for it: its 731 * second argument has always been a product and a callback reads it. 728 732 */ 729 733 protected static function wholesale_price($product, $item = null) … … 732 736 if ($cost === '') { 733 737 $cost = self::native_cogs($product, $item); 738 } 739 if (!$product) { 740 return $cost; 734 741 } 735 742 … … 745 752 * without its own takes its parent's the way each plugin does: SkyVerge the default cost of the variable product 746 753 * (`_wc_cog_cost_variable`; the parent's `_wc_cog_cost` is the lowest cost of its variations), WPFactory the parent's 747 * `_alg_wc_cog_cost`. 754 * `_alg_wc_cog_cost`. A deleted product ($product false, #272) has no meta: only the cost kept on the line. 748 755 */ 749 756 protected static function addon_cost($product, $item) … … 756 763 } 757 764 } 765 } 766 if (!$product) { 767 return ''; 758 768 } 759 769 $parentId = (int) $product->get_parent_id(); … … 782 792 * Only with the feature turned on: off, the methods return dummy zeros and log "doing it wrong" on every call. 783 793 * Below WooCommerce 9.5 the feature does not exist and the methods are missing. 794 * A deleted product ($product false, #272) has no current value: only the value the line kept, and a line of 795 * quantity 0 then stays without a price. 784 796 */ 785 797 protected static function native_cogs($product, $item) … … 795 807 } 796 808 } 797 if ( method_exists($product, 'get_cogs_total_value')) {809 if ($product && method_exists($product, 'get_cogs_total_value')) { 798 810 $unit = round((float) $product->get_cogs_total_value(), 6); 799 811 if ($unit > 0) { -
trackless/trunk/readme.txt
r3839696 r3840331 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.1.3 37 Stable tag: 1.1.34 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 113 113 114 114 == Changelog == 115 116 = 1.1.34 = 117 * Orders whose product or variation has been deleted since now send the purchase price the order line kept when the order was placed (Cost of Goods Sold in WooCommerce, or the SkyVerge or WPFactory Cost of Goods plugin), so their margin and profit are no longer missing. A line that never kept a cost still has no margin. 115 118 116 119 = 1.1.33 = … … 264 267 == Upgrade Notice == 265 268 269 = 1.1.34 = 270 Orders whose product or variation has since been deleted keep the purchase price their order line stored, so their margin and profit are no longer missing. 271 266 272 = 1.1.33 = 267 273 Margin also uses the purchase price from Cost of Goods Sold in WooCommerce 9.5 or newer. With a multi-currency plugin the reports stay in the shop's base currency. A cancelled, failed or refunded order no longer counts as a first purchase. -
trackless/trunk/trackless.php
r3839077 r3840331 4 4 * Plugin URI: https://woomoduly.cz/produkt/trackless/ 5 5 * Description: Cookieless server-side analytics for WordPress. Traffic analytics on any site; with WooCommerce it also sends orders, revenue and margin to Trackless. 6 * Version: 1.1.3 36 * Version: 1.1.34 7 7 * Requires PHP: 7.4 8 8 * Requires at least: 6.2 … … 25 25 } 26 26 27 define('TRACKLESS_VERSION', '1.1.3 3');27 define('TRACKLESS_VERSION', '1.1.34'); 28 28 define('TRACKLESS_FILE', __FILE__); 29 29 define('TRACKLESS_DIR', plugin_dir_path(__FILE__));
Note:
See TracChangeset
for help on using the changeset viewer.