YS FluentCart Order Statuses

FluentCart × 自訂訂單流程:下生產、排定出貨等自訂狀態,付款後不被覆寫,狀態變更自動寄信,從 More Action 直接變更訂單狀態,附流程報表與防呆。

v0.8.1 Fluent Cart fluentcart 免費下載

FluentCart 內建的訂單狀態只有處理中、保留中、已完成、已取消這幾種,但代購、客製生產、預購型的店家需要的是「已付款 → 下生產 → 排定出貨 → 已出貨」這種自己的流程。這支外掛讓你在後台新增自訂的訂單狀態與出貨狀態——名稱、顏色、說明、付款條件都可設定——FluentCart 的訂單列表(每個自訂狀態都有已存檢視)、「變更出貨狀態」對話框(英文介面為 Change Shipping Status)與顧客的訂單頁都會直接吃到,FluentCart Pro 的進階篩選也會列出自訂訂單狀態。完全不動 FluentCart 核心,全部透過公開的 filter 與 REST 完成。

付款後不會被 FluentCart 覆寫

FluentCart 在收到款項時會把訂單狀態改寫成「處理中」,這段是核心寫死的、沒有 filter。外掛會在付款的同一個流程裡把你的自訂狀態寫回去,並在訂單的活動紀錄留下一行說明;每個狀態都可以在「進階」裡選擇「保留此狀態」或「交由 FluentCart 改成處理中」(限定「僅未付款訂單」的狀態一律交給 FluentCart),也有一個總開關。營收報表看的是付款狀態,所以自訂訂單狀態完全不影響營收數字。

狀態變更自動寄信給顧客

每一個自訂狀態都可以開啟電子郵件通知——顧客一封、管理員副本一封,各自獨立開關。通知直接註冊進 FluentCart 自己的「Email 通知」設定頁:用 FluentCart 的開關、主旨欄、預覽功能與寄件者設定,郵件外框、頁首頁尾也和 FluentCart 內建信件一致;標題與內文段落可以直接在同一個編輯頁填寫,支援 {{order.invoice_no}}、{{order.customer.full_name}} 等 FluentCart 短碼。全部預設關閉,開了才會寄。

訂單狀態在 More Action 裡變更

FluentCart 的後台本身沒有可以自由選擇訂單狀態的控制項——不論訂單是否付款,More Action 裡都只有「標記為完成」、「退回處理中」、「取消訂單」這類固定按鈕(1.6.0 與 1.6.3 實測)。外掛在同一個 More Action 選單最上面加上「變更訂單狀態」(Change Order Status),打開的「更新訂單狀態」(Update Order Status)對話框操作方式和 FluentCart 的「變更出貨狀態」對話框一樣,但只會依流程順序列出這筆訂單可以移動到的狀態;出貨狀態照舊在 FluentCart 的「變更出貨狀態」裡選,自訂的出貨狀態會直接列在裡面。寫入走 FluentCart 自己的訂單 API,活動紀錄、狀態變更事件與品項履行都和手動改狀態完全一樣。

「訂單流程」卡片:看進度、一鍵推進

訂單頁側欄的「訂單流程」(Order workflow)卡片同時顯示訂單狀態與出貨狀態:目前狀態、流程第幾步、不能變更時的原因,以及一鍵推進的「下一步」(Next step)按鈕,下方再提示其他狀態要到 More Action 的哪個選項變更。萬一這個頁面無法從 More Action 使用「變更訂單狀態」(例如日後 FluentCart 改版),卡片會自動改為直接列出可選的訂單狀態;已取消的訂單在 FluentCart 裡沒有「變更出貨狀態」,卡片也會直接列出可改的出貨狀態。

兩種流程樣板,一鍵建立

「訂單狀態」分頁的「建立標準流程」與「工具」分頁的「建立出貨流程(出貨狀態軸)」,都能一鍵建立「下生產 → 排定出貨 → 已出貨」的流程。我們推薦把流程放在出貨狀態,因為 FluentCart 永遠不會自動改寫出貨狀態,而且自訂的出貨狀態會直接出現在 FluentCart 自己的「變更出貨狀態」對話框。樣板不會改動 FluentCart 內建狀態的名稱,也不會覆寫你已經設定好的內容,套用兩次也不會重複。需要的話可以在「工具」分頁開啟「嚴格流程」,讓訂單狀態一次只能前進或後退一步(只管訂單狀態這條流程,出貨狀態不受限;改成已完成、已取消或保留中則隨時可以)。

防呆與紀錄:改設定、改狀態都不怕手滑

還有訂單在用的狀態,儲存時不能移除,畫面會直接說明是哪個狀態、還有幾筆訂單;已儲存的狀態也不能再改代碼,要停用還有訂單在用的狀態時也會先提醒。「搬移訂單」會先確認筆數與去向、不寄信,也不能直接搬到「已完成」、「已取消」這類終點狀態,每筆搬移都會留下紀錄。若有訂單停在已不存在的狀態,設定頁最上方會提醒,並可到「工具」分頁直接搬移。匯入前會先列出會變更的內容,匯入後還能「復原上一次匯入」;兩個人同時編輯設定時,畫面已過時的一方儲存會被擋下並提示重新載入,不會蓋掉對方的修改。訂單頁改成「已完成」或「已取消」一律先確認,「已完成」只出現在已付款訂單;改成「已取消」時,也會像 FluentCart 的「取消訂單」一樣把庫存加回去。

流程報表與卡單清單

「訂單狀態報表」分頁把整條流程攤開來看:各狀態的訂單數與金額(分已付款/未付款)、流程漏斗、每個步驟的平均與最長停留時間、以及在同一步卡超過 N 天的訂單清單,每張表都能下載 CSV(Excel 直接開中文不亂碼)。可選每日摘要信。訂單列表多了每個自訂狀態的已存檢視,訂單頁的「狀態歷程」把兩軸合併在同一條時間軸上,最新的變更排在最前面。

相容性與更新

FluentCart 1.6.0 起可用(1.6.0 與 1.6.3 都實測通過),PHP 7.4 以上,在 PHP 8.4、8.5 上也不會產生棄用警告。設定可整份匯出/匯入 JSON。停用外掛不會改動任何訂單資料。已內建 YS Plugin Hub 更新機制,安裝後可在 WordPress 外掛頁直接收到新版通知並一鍵更新。介面提供英文與繁體中文。

功能特色

自訂狀態與一鍵流程樣板

名稱、顏色、說明、排序與付款條件都可設定;一鍵建立「下生產 → 排定出貨 → 已出貨」,可放在訂單狀態或出貨狀態。

付款後保留自訂狀態

FluentCart 收款時會改寫成「處理中」,外掛自動寫回並在活動紀錄留下說明。

狀態變更 email 通知

每個狀態可開啟顧客通知與管理員副本,直接在 FluentCart 的「Email 通知」設定頁編輯主旨、標題與內文。

More Action 變更訂單狀態

訂單頁 More Action 多了「變更訂單狀態」,只列這筆訂單能去的狀態;側欄「訂單流程」卡片顯示目前步驟,一鍵「下一步」。

防呆、留紀錄、可復原

使用中的狀態不會被誤刪;搬移訂單先確認並留紀錄;匯入先看差異、可復原;兩人同時編輯不互相覆蓋。

流程報表與卡單清單

各狀態訂單數與金額、漏斗、停留時間、卡住的訂單,每張表可下載 CSV,可選每日摘要信。

螢幕截圖

更新日誌(最新版)

Follow-ups from an independent review of 0.8.0. A cancel made after a refund

returns stock only when it should, and the order page no longer asks about a

refund the payment gateway refused. On a site whose Stock Management module is

off, only that question changes.

For shop staff

  • A refund's own restock choice stands. When the refund itself decided what

went back to stock — *Restock* ticked in FluentCart's Refund dialog, or a

payment plugin such as YS Helcim returning items with the refund — the

automatic cancel that follows returns nothing more, and with *ask* the restock

choice starts unticked. Before, refunding an order of 3 items with 1

restocked and letting it cancel returned the other 2 as well.

  • An order FluentCart holds no stock for returns nothing when canceled. An

order placed while the Stock Management module was off never took its items

out of stock, but FluentCart's cancel adds them to stock all the same. A

cancel made by this plugin — after a refund, from the order page's question,

or from *Change Order Status* — now leaves stock alone for such an order, and

the activity log says why. With *ask*, such an order is asked about without a

restock choice.

  • A refund the gateway refused is not asked about. With a full refund set to

*ask*, a refund FluentCart recorded although the payment gateway refused it no

longer brings up *Cancel the refunded order?*; the activity log says the

gateway did not confirm it, as before.

  • The setting is named for what it does: *Return the items to stock when a

refund cancels the order*. It never governed a cancel made by hand.

  • The question's dialog no longer reloads the page, or closes a dialog opened

since, when the operator moves to another order before *Cancel order* or *Keep

the current status* has been answered.

Changed (technical)

  • `Payment\RefundStatusHandler::onRefunded()` on `fluent_cart/order_refunded`

(priority 5) marks `_ys_fct_refund_restock_decided` on the order when the

refund decided what went back to stock: inside FluentCart's Refund route when

`manage_stock` is true, elsewhere when a row has a `restore_quantity` above 0.

The automatic cancel then uses restock=false (`CancelRestock::WHY_DECIDED`),

and `prompt()['restock']` is false.

  • `Support\CancelRestock::before()` returns the items only while `holdsStock()`

— FluentCart's `stock_movement` order meta has a positive `on_hold` or

`committed` — and otherwise detaches the listener (`WHY_NOT_HELD`); it looks

only while the listener is on its hook. `prompt()['stock']` needs the same.

The activity line names which of the three reasons applied.

  • A full refund FluentCart's Refund route recorded although the gateway refused

it sets `_ys_fct_refund_prompt` to `gateway_failed`; `prompt()` asks only

while that meta is empty.

  • `order-changer.js`: an answer that comes back after the page moved to another

order closes only its own dialog and does not reload the page.

  • Uninstalling with data removal opted in also deletes

`_ys_fct_refund_restock_decided`.

Tests

  • Unit 619; refund scenarios 130 on FluentCart 1.6.0 and 1.6.3 — orders now hold

stock the way FluentCart records it; R14, R15 and R17 expect the refund's own

decision to stand; new R20 (no stock held), R21 (*ask* after a refused

refund), R22 (the setting and a cancel made by hand), R23 (a status change

that fails half-way still puts the listener back) and R24 (partial, then full,

then *keep*). Browser 92 — a page that moved to another order before the

answer came back; that case fails against the 0.8.0 script. Ten mutations of

the new checks each fail the refund scenarios; PHP 8.2 and 8.5.

常見問題

會改到 FluentCart 核心嗎?

不會。全部透過 FluentCart 公開的 filter(order_statuses、editable_order_statuses、shipping_statuses、email_notifications 等)與 REST 完成;More Action 裡的「變更訂單狀態」也是選單打開時才由外掛加入,更新 FluentCart 不會蓋掉任何東西。

為什麼付款後訂單狀態會變成「處理中」?

這是 FluentCart 核心的行為(寫死、沒有 filter)。外掛會在同一個流程裡把自訂狀態寫回去;每個狀態可設定「保留此狀態」或「交由 FluentCart 改成處理中」,限定「僅未付款訂單」的狀態則一律交給 FluentCart。

通知信在哪裡設定?免費版 FluentCart 能改內文嗎?

在 FluentCart → 設定(Settings)→ Email Configuration → Notifications(Email 通知),會多一組「自訂訂單狀態」。開關、主旨、預覽都是 FluentCart 自己的;標題與內文段落是外掛加在同一個編輯頁的欄位,免費版也能填。完整的區塊編輯器仍需 FluentCart Pro。

為什麼 FluentCart 原生後台不能直接選我的自訂訂單狀態?

FluentCart 後台本來就沒有自由選擇訂單狀態的控制項(1.6.0 與 1.6.3 實測),不論是否付款,More Action 裡只有「標記為完成」、「退回處理中」、「取消訂單」這類固定按鈕。所以外掛在同一個選單加上「變更訂單狀態」,只列出這筆訂單可以移動到的狀態。出貨狀態則不同:自訂的出貨狀態會直接出現在 FluentCart 自己的「變更出貨狀態」對話框裡。

流程該放在訂單狀態還是出貨狀態?

如果流程是從顧客付款之後才開始(生產、包裝、排單、出貨),建議放出貨狀態:FluentCart 永遠不會自動改寫它,而且內建的「變更出貨狀態」在每張未取消、需要出貨的實體訂單上都能用。狀態確實屬於訂單本身、或希望顧客在訂單狀態上看到時,再放訂單狀態。

停用或移除外掛會影響訂單嗎?

停用不會改動任何訂單資料,重新啟用後設定與歷史都還在。移除預設也保留設定與歷史表,除非在 wp-config.php 定義 YS_FCT_STATUS_REMOVE_DATA。

還有訂單在用的狀態,可以直接移除嗎?

不行。儲存時會被擋下,並說明是哪個狀態、還有幾筆訂單;請先用該狀態列上的「搬移訂單」把訂單搬走再移除。已儲存的狀態也不能改代碼,要換代碼請新增狀態再搬移訂單。若是以前就被移除、還留著訂單的狀態,設定頁最上方會提醒,「工具」分頁可以直接搬移。

匯入設定後發現不對,可以復原嗎?

可以。匯入只接受本外掛匯出的檔案,寫入前會先列出會新增、移除、變更哪些內容;匯入後「工具」分頁會出現「復原上一次匯入」,狀態、設定與郵件文字都會回到匯入之前。

0