[WordPress] 外掛分享: Order Tip for WooCommerce

WordPress 外掛 Order Tip for WooCommerce 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Order Tip for WooCommerce」是 2020-08-17 上架。
  • 目前有 2000 個安裝啟用數。
  • 上一次更新是 2025-02-04,距離現在已有 88 天。
  • 外掛最低要求 WordPress 3.0 以上版本才可以安裝。
  • 有 15 人給過評分。
  • 論壇上目前有 3 個提問,問題解答率 33%

外掛協作開發者

railmedia |

外掛標籤

tip | order | donation | ecommerce | woocommerce |

內容簡介

Order Tip for WooCommerce 是一款外掛,允許顧客為 WooCommerce 訂單添加小費或捐款。小費以 WooCommerce 費用的形式添加。

它允許小費是訂單總額的百分比或固定的自定義金額,還提供現金小費選項,該選項將小費標記為價值為0,但您應該在顧客交付產品或在提取訂單時期望小費。

還有一個添加自定義小費的選項,它會彈出一個文本框,顧客能夠輸入自定義金額,並隨後將其添加到訂單中。

小費可以根據 WooCommerce 中當前的稅務選項設置是否向稅收,它具有6種標準小費率(5,10,15,20,25,30),可以通過篩選器進行擴展-請參見開發人員部分以下內容。

它在 WooCommerce 設置面板的訂單提示選項卡中具有各種配置選項。

外掛的後端已翻譯為德語,瑞士德語,西班牙語,法語,意大利語,羅馬尼亞語。

荷蘭語支持已添加,感謝 Roel Mehlkopf(@mhlkpf)。

此處查看演示:

實時預覽

觀看安裝和使用該插件的視頻

重要提示:

此插件即插即用,基本上不需要任何主題上的編程技能。然而,它使用 JavaScript 添加小費到訂單中。如果由於某些原因它未按預期工作,請檢查您的瀏覽器控制台是否有任何 JS 錯誤或在支持選項卡頁面留下您的網站鏈接。

使用 Astra 或 Neve 主題的網站應該避免使用“客戶詳細信息位置”來顯示小費表單。它可能破壞佈局,導致訂單審核側欄落在客戶詳細信息之下。

開發人員

如果需要擴展或編輯核心功能,可以使用幾個篩選器連接到:

wc_order_tip_title - 接受1個字符串變量,其中包含在表單之前顯示的標題;
wc_order_tip_rates - 接受1個數組變量,其中包含預定義的標準小費率的數值。您應返回一個簡單的數組,其中包含您希望添加的值。例如:array(10, 15, 30);

還有一些用於從不同的插件或活動主題動態更改各種字符串的篩選器:

wc_order_tip_title - 更改小費表單標題;
wc_order_tip_cash_label - 更改現金小費按鈕標籤;
wc_order_tip_custom_label - 更改自定義小費按鈕標籤;
wc_order_tip_custom_enter_tip_placeholder - 更改自定義小費字段占位符;
wc_order_tip_display_form - 防止在頁面上顯示小費表單。

還有一個後台的篩選器:

wc_order_tip_reports_date_time_format - 允許更改報告訂單創建日期/時間的日期格式。格式需要符合 PHP 日期格式,詳見此處:https://www.php.net/manual/en/function.date.php

原文外掛簡介

Order Tip for WooCommerce is a plugin that allows customers to add a tip or donation to a WooCommerce order. The tip is added under the form of a WooCommerce fee.
It allows the tip to be a percentage of the order total or a fixed custom amount. Cash tip is also available which marks the tip as 0 in value, but you should expect a tip on the delivery of your products or on the pickup of the order by the customer.
There is also an option for adding a custom tip which brings up a text field where the customer is able to type in a custom amount and which is subsequently added as a fixed amount to the order.
The tip can also be set to be taxed or not as per your current Tax options set in WooCommerce. It features 6 standard tip rates (5, 10, 15, 20, 25, 30) that can be extended through a filter – see below under the Developers section.
It features various configuration options in the WooCommerce Settings panel under the tab Order Tip.
The plugin’s backend is translated in German, Swiss German, Spanish, French, Italian, Romanian.
Dutch language support was added, thanks to Roel Mehlkopf (@mhlkpf).
Check out a demo here:
Live Preview
Check out a video on installing and using the plugin

Important Notes
The plugin works out of the box, with no coding skills required on basically any theme. However, it uses JavaScript for adding the tip to the order. If for some reason it doesn’t work as expected, please check your browser’s console for any JS errors or drop a line here in the Support tab providing a link to your website.
Websites using the Astra or Neve theme should avoid using the “After customer details position” to display the tip form. It may break the layout causing the order review sidebar to fall under the customer details one.
Developers
There are a couple of filters you can hook into should you need to extend or edit the core functionality:

wc_order_tip_title – takes in 1 string variable which holds the title of the form which appears before the form;
wc_order_tip_rates – takes in 1 array variable which holds the values of the predefined standard tip rates. You should return a simple array containing the values you wish to add. Eg: array( 10, 15, 30 );

And a few other filters for changing various strings dynamically, from a different plugin or the active theme:

wc_order_tip_title – changes the tip form title;
wc_order_tip_cash_label – changes the Cash tip button label;
wc_order_tip_custom_label – changes the Custom tip button label;
wc_order_tip_custom_enter_tip_placeholder – changes the Custom tip field placeholder;
wc_order_tip_display_form – prevents the tip form from being displayed on the page.

And one filter for the backend:

wc_order_tip_reports_date_time_format – allows changing the date format of the reports order created date/time. The format needs to comply with the PHP date format. See more here

CSS classes and IDs that allow customization:

#wooot_order_tip_form – main form container
#wooot_order_tip_form button.woo_order_tip – regular tip buttons
#wooot_order_tip_form button#woo_order_tip_cash – cash tip button
#wooot_order_tip_form button#woo_order_tip_custom – custom tip button
#wooot_order_tip_form p.woo_order_tip_custom_text_field – row for the custom tip input box
#wooot_order_tip_form input.woo_order_tip_custom_text – custom tip input box
#wooot_order_tip_form button.woo_order_tip_apply – tip apply button
#wooot_order_tip_form button.woo_order_tip_remove – tip remove button

各版本下載點

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

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


1.1 | 1.0.0 | 1.0.1 | 1.1.1 | 1.1.2 | 1.2.0 | 1.2.1 | 1.2.2 | 1.3.0 | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.5.1 | 1.5.2 | trunk |

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

文章
Filter
Apply Filters
Mastodon