[WordPress] 外掛分享: Additional Order Costs for WooCommerce

前言介紹

  • 這款 WordPress 外掛「Additional Order Costs for WooCommerce」是 2020-07-21 上架。
  • 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
  • 上一次更新是 2024-05-29,距離現在已有 340 天。
  • 外掛最低要求 WordPress 4.0 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 5.6 以上。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

theritesites |

外掛標籤

reporting | Order costs | Additional costs | WooCommerce costs |

內容簡介

無論是額外的發票還是與訂單相關的商戶信用。有時您只需要為店面的報告添加幾個額外的費用字段。動態為您的訂單添加任意數量的成本!

安裝此外掛後,您可以在 WooCommerce 編輯訂單頁面上手動添加或調整標籤額外成本。這始於 5 個額外成本字段,可在外掛的設置頁面中更改。5 個太多?將其設置為 2!太少了,設置為 9!
未來,我們將考慮將它們變成可重複使用的字段,而不是一個固定的數量,但我們也希望用戶考慮其他拓展選項!

一旦您開始跟踪關聯的額外訂單成本,您就會想使用我們的WooCommerce 凈利潤插件,它將為您提供美觀,功能齊全的報告,以分析您的利潤。
此外,還可以設置我們的另一個成本跟踪插件,WooCommerce 運費成本。
當使用WooCommerce凈利潤插件時,您將能夠單獨跟踪額外成本,運費成本和貨物成本。最近更新的 Net Profit 插件還可以從任何第三方插件關聯到自定義成本,但需要編程。

此外,此外掛還是與 WooCommerce 凈利潤動態集成的第一個示例。
WooCommerce 凈利潤在版本 1.5 中現在有一個活動篩選器

add_filter( 'trs_wc_np_order_cost_extension', 'callback_function', 10, 1 )

如何實現濾波器可以在additional-oprder-costs-for-woocommerce/includes/class-aoc-wc.php中找到。
該篩選器允許修改 PHP 對象數組。陣列中的每個對象表示需要擴展到成本計算的插件。數組中的密鑰應該是在數據庫中找到的 meta_key。對象的其餘部分應該結構如下:

$array[$meta_key] = new StdClass();
$array[$meta_key]->key = $meta_key;
$array[$meta_key]->category = 'additional_costs'; // 可以是 cost_of_goods,additional_costs,cost_of_shipping
$array[$meta_key]->function = 'aoc_wc_calculate_addition_costs_on_order'; // 這應該是一個可呼叫的非類保護函數。

上面列出的功能應該在類似於主題中的 functions.php 的文件中找到。執行此功能時,該功能在個別 meta key 的值上應用。例如:此外掛存儲有多個訂單成本行和關聯的標籤。篩選器中的“函數”部分會選出重要值並返回單一的非純量(非複雜)值。然後,可以將此值減去任何其他簡單(浮點數,整數,雙精度)數據格式。

原文外掛簡介

Whether it’s an extra invoice, or a credit from a merchant related to an order. Sometimes you just need a couple extra cost fields for your store’s reporting. Dynamically add as many costs to your order as you would like!
After installing this plugin you’ll be able to manually add or adjust and label additional costs for each order on the WooCommerce Edit Order page. This starts with 5 additional cost fields that can be changed in the settings page with the plugin. 5 fields too much? Set it to 2! Not enough, set it to 9!
In the future we will be looking at making these a repeatable field rather than a set number, but we wanted to get users thinking of other expansions as well!
Once you start tracking the additional order costs you associate, you’ll want to use our WooCommerce Net Profit plugin that will give you beautiful, functional reports to fully analyze your profitability.
This also pairs well with our other cost tracking plugin, WooCommerce Cost of Shipping.
While using the WooCommerce Net Profit plugin, you will individually be able to track Additional Costs, Cost of Shipping, and Cost of Goods. The Net Profit plugin has recently been expanded to allow for custom costs to be associated from any other third party plugin as well, though coding is necessary.
This plugin also serves as the first ever example of how to integrate with WooCommerce Net Profit in a dynamic fashion.
WooCommerce Net Profit as of version 1.5 now has an active filter
add_filter( 'trs_wc_np_order_cost_extension', 'callback_function', 10, 1 )

How the filter is implemented can be found in additional-oprder-costs-for-woocommerce/includes/class-aoc-wc.php
The filter allows for a PHP array of objects to be modified. Each object in the array represents a plugin that needs to extend to a cost calculation. The key in the array should be the meta_key found in the database. The rest of the object should be structured as follows:
$array[$meta_key] = new StdClass();
$array[$meta_key]->key = $meta_key;
$array[$meta_key]->category = 'additional_costs'; // could be cost_of_goods, additional_costs, cost_of_shipping
$array[$meta_key]->function = 'aoc_wc_calculate_addition_costs_on_order'; // This should be a callable non-class protected function.

The function listed above should be found in a file of similar structure to functions.php in themes. This function is called when doing data/reporting queries. The function is only applied to the individual meta keys value.
For example: this plugin stores multiple order cost lines with associated labels. The “function” portion of the filter plucks out the important values and returns a singular non-scalar (non-complex) value. This value can then be subtracted from any other simple (float, integer, double) data format.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Additional Order Costs for WooCommerce」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


v1.0.3 | v1.0.4 | v1.0.5 |

延伸相關外掛(你可能也想知道)

暫無相關外掛推薦。

文章
Filter
Apply Filters
Mastodon