[WordPress] 外掛分享: Easy Digital Downloads – Coming Soon

首頁外掛目錄 › Easy Digital Downloads – Coming Soon
100+
安裝啟用
★★★★
4.5/5 分(4 則評價)
3109 天前
最後更新
問題解決
WordPress 3.3+ v1.3.3 上架:2013-04-20

內容簡介

此外掛需要 Easy Digital Downloads 外掛。它允許下載文件展示為「即將推出」或自訂狀態文字,並防止添加到購物車。它有以下幾個功能:

新增核取方塊至下載配置,可設置下載為「即將推出 / 自訂狀態」。
新增文字欄位至下載配置,可設置展示的文字(預設為「即將推出」)。
在管理後台的定價欄位下方,展示「即將推出」或自訂狀態文字。
使用 [downloads] 短碼時,以及任何呼叫 edd_price() 函式的地方,展示「即將推出」或自訂狀態文字,替代價格顯示。
防止「即將推出」的下載商品被購買。此外掛會刪除購買按鈕,並透過 edd_action(例如:?edd_action=add_to_cart&download_id=XXX)停止將該下載添加到購物車。
允許客戶對指定的下載進行投票。一個下載的投票結果會顯示在編輯 / 發佈頁面和管理後台。

** 篩選器範例 **

此為如何變更預設「即將推出」文字的篩選器範例。將此函式複製到 functions.php 檔案中:

function edd_coming_soon_modify_default_status_text() {
return 'Not long now!';
}
add_filter( 'edd_cs_coming_soon_text', 'edd_coming_soon_modify_default_status_text' );

此為如何修改管理欄位中「即將推出」文字標記的篩選器範例。將此函式複製到 functions.php 檔案中:

function edd_coming_soon_modify_admin_column_text( $custom_text ) {
return '<h2>' . $custom_text . '</h2>';
}
add_filter( 'edd_coming_soon_display_admin_text', 'edd_coming_soon_modify_admin_column_text' );

此為如何修改前端「即將推出」文字標記的篩選器範例。將此函式複製到 functions.php 檔案中:

function edd_coming_soon_modify_text( $custom_text ) {
return '<h2>' . $custom_text . '</h2>';
}
add_filter( 'edd_coming_soon_display_text', 'edd_coming_soon_modify_text' );

此為如何修改當有人嘗試購買尚未推出的下載時所顯示的訊息範例。
此訊息可透過在 URL 中附加 ?edd_action=add_to_cart&download_id=XXX,將 XXX 替換成您的下載 ID 進行測試。

function edd_coming_soon_modify_prevent_download_message( $download_id ) {
return __( 'This item cannot be purchased just yet, hang tight!', 'edd-coming-soon' );
}
add_filter( 'edd_coming_soon_pre_add_to_cart', 'edd_coming_soon_modify_prevent_download_message' );

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.3.3) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Easy Digital Downloads – Coming Soon」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

This plugin requires Easy Digital Downloads. It allows downloads to be “Coming Soon” or have Custom Status text, and prevents them from being added to the cart. It does a few things:

Adds a checkbox to the download configuration so you can set the download to Coming Soon / Custom Status.
Adds a text field to the download configuration so you can set the text to show (default “Coming Soon”).
Adds “Coming Soon” or your custom status text underneath the price on the admin pricing column
Displays “Coming Soon” or the Custom Status text instead of the price when using the [downloads] shortcode, and anywhere else where the edd_price() function has been called.
Prevents the coming soon download from being purchased. The plugin will remove the purchase button and stop the download from being added to cart via the edd_action. Eg ?edd_action=add_to_cart&download_id=XXX
Allows customers to vote on a specific download. A download’s votes are listed on the edit/publish page and on the admin dashboard

** Filter examples **
Example filter of how you can change the default coming soon text. Copy this function to your functions.php
function edd_coming_soon_modify_default_status_text() {
return 'Not long now!';
}
add_filter( 'edd_cs_coming_soon_text', 'edd_coming_soon_modify_default_status_text' );

Example filter of how you can modify the markup of the coming soon text in the admin columns. Copy this function to your functions.php
function edd_coming_soon_modify_admin_column_text( $custom_text ) {
return '

' . $custom_text . '

';
}
add_filter( 'edd_coming_soon_display_admin_text', 'edd_coming_soon_modify_admin_column_text' );

Example filter of how you can modify the markup of the coming soon text on the front end. Copy this function to your functions.php
function edd_coming_soon_modify_text( $custom_text ) {
return '

' . $custom_text . '

';
}
add_filter( 'edd_coming_soon_display_text', 'edd_coming_soon_modify_text' );

Example filter of how you can modify the message that displays when someone tries to purchase a download that is coming soon.
This message can be tested by appending ?edd_action=add_to_cart&download_id=XXX to your URL, substituting XXX with your download ID
function edd_coming_soon_modify_prevent_download_message( $download_id ) {
return __( 'This item cannot be purchased just yet, hang tight!', 'edd-coming-soon' );
}
add_filter( 'edd_coming_soon_pre_add_to_cart', 'edd_coming_soon_modify_prevent_download_message' );

延伸相關外掛

文章
Filter
Apply Filters
Mastodon