[WordPress] 外掛分享: Hide Categories On Shop Page

前言介紹

  • 這款 WordPress 外掛「Hide Categories On Shop Page」是 2018-05-08 上架。
  • 目前有 2000 個安裝啟用數。
  • 上一次更新是 2022-11-28,距離現在已有 1186 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.0.1 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 7.0 以上。
  • 有 14 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

wmeric |

外掛標籤

WordPress | e-commerce | woocommerce |

內容簡介

這個免費的 WooCommerce 外掛允許您在商店的主頁面上隱藏類別。

為此,您需要在 WooCommerce > 設置 > 產品選項標籤部分中使用“,”分隔的方式保存類別。

為了使其工作,您必須在主頁中顯示商品類別。這可以通過自訂器進行設置。外觀 > 自訂 > WooCommerce > 產品目錄。

“選擇在主商店頁面上顯示什麼。”請選擇如下屏幕截圖所示的顯示類別。

附加信息

對於有不同/自定義頁面的商店用戶,您可以編輯 wc-hide-categories.php 文件。

找到第127行,並刪除 //

//$mwd_opt4 = in_array( 'product_cat', $taxonomies ) && ! is_admin() && is_page('YOUR_PAGE_SLUG'),

然後找到第129行 /*|| $mwd_opt4*/

更改為
|| $mwd_opt4

要從這些類別中刪除產品,請找到第160行

// Uncomment the function below if you also want those products hidden
/*
add_action( 'woocommerce_product_query', 'mwd_hwcosp_remove_product_in_cat' );

function mwd_hwcosp_remove_product_in_cat( $q ) {
//hwcosp_global is the databse row entry
$opt_terms = get_option('hwcosp_global');

// Processes our users data to the way we want it from above
$data = mwd_hwcosp_comma_separated_to_array($opt_terms);

$tax_query = (array) $q->get('tax_query');
$tax_query[] = array(
'taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => $data, // Set Category Slug which products not show on the shop and Archieve page.
'operator' => 'NOT IN'
);
$q->set( 'tax_query', $tax_query );
}
*/

代碼有很好的文檔,因此易於找到所需部分。

如果您有任何問題,請在支援論壇中提問。謝謝。

原文外掛簡介

This free WooCommerce extension permits you to hide categories on your shops main page.
For this you have to save the categories with ‘,’ seperated in woocommerce > settings > products tab section.
In order for this to work you have to have Categories displayed. This can be set via Customizer. Appearance > Customize > WooCommerce > Product Catalog.
“Choose what to display on the main shop page.” Select Show categories as seen in the Screenshot below.
Additional Information
For users who has a different/custom page for their shop you can edit the wc-hide-categories.php file
Find line # 127 and remove //
//$mwd_opt4 = in_array( 'product_cat', $taxonomies ) && ! is_admin() && is_page('YOUR_PAGE_SLUG'),

Then find line #129 /*|| $mwd_opt4*/
Change to
|| $mwd_opt4
To remove products from those categories find line 160
// Uncomment the function below if you also want those products hidden
/*
add_action( 'woocommerce_product_query', 'mwd_hwcosp_remove_product_in_cat' );

function mwd_hwcosp_remove_product_in_cat( $q ) {
//hwcosp_global is the databse row entry
$opt_terms = get_option('hwcosp_global');

// Processes our users data to the way we want it from above
$data = mwd_hwcosp_comma_separated_to_array($opt_terms);

$tax_query = (array) $q->get('tax_query');
$tax_query[] = array(
'taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => $data, // Set Category Slug which products not show on the shop and Archieve page.
'operator' => 'NOT IN'
);
$q->set( 'tax_query', $tax_query );
}
*/

The code is well documented so its easy to find what part you are looking for
If you have any question please ask in the support forum, Thanks

各版本下載點

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

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


1.0 | 1.0.1 | 1.1.0 | 1.1.1 | 1.1.2 | 1.1.3 | trunk |

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

  • WooCommerce 》p>WooCommerce是全球最受歡迎的開源電子商務解決方案之一,擁有世界上最多的市場份額。, 我們的核心平臺是免費的、靈活的,並擁有全球社區的支持。開源的自由...。
  • Popup Builder & Popup Maker for WordPress – OptinMonster Email Marketing and Lead Generation 》🤩使用這個外掛可以製作彈出視窗和訂閱表單,增加電子郵件訂閱者、銷售和業績–最受歡迎的彈出視窗建構器!🚀, 最佳的 WordPress 彈出視窗建構器和電子報彈窗...。
  • WooCommerce PayPal Payments 》PayPal 最新、功能最完備的付款處理解決方案。除了接受 PayPal 獨有的付款方式,也可接受信用卡/借記卡和本地付款方式。開啟 PayPal 付款選項或處理完整的付...。
  • PrettyLinks – Affiliate Links, Link Branding, Link Tracking, Marketing and Stripe Payments Plugin 》Pretty Links 可以幫助您在 WordPress 網站上或外部網站上縮短、美化、追蹤、管理和分享任何 URL。使用您自己的域名創建您想要的外觀的連結!, Pretty Links ...。
  • Mailchimp for WooCommerce 》加入 Mailchimp 的 1,700 萬客戶,這是全球最大的行銷自動化平台,以發展您的電子商務行銷策略。藉由官方 Mailchimp for WooCommerce 整合,您的客戶及其購買...。
  • WooCommerce PayPal Checkout Payment Gateway 》⚠️ PayPal 結帳功能將於 2022 年 3 月 1 日停止支援,外掛的更新已在 2021 年 9 月 1 日停止。我們建議轉換至 PayPal Payments。, 這是一個用於 WooCommerce ...。
  • Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress 》理 their accounts., , Content Restriction, Restrict content based on membership level, user role, or custom capabilities. With ProfilePress members...。
  • WPML Multilingual & Multicurrency for WooCommerce 》這個外掛包含您需要開始跨國銷售所需的一切。輕鬆地設定和管理多種貨幣下的產品,不論您的商店大小和負責團隊的規模。或者,您可以升級購買 WPML,將您的整個...。
  • Mercado Pago payments for WooCommerce 》官方的 Mercado Pago 外掛可讓您為您的網路商店處理付款,讓使用者以他們喜歡的付款方式完成購買。, 安裝不需要技術知識,您可以從我們的開發者網站上按照整...。
  • WooCommerce Admin 》WooCommerce Admin 已不再被支援, WooCommerce Admin 已經成為 WooCommerce 的一部分!為了確保您的商店繼續順利運行,請確認 WooCommerce 已更新至最新版本...。
  • TI WooCommerce Wishlist 》增加銷售和轉換率, 您是否正在尋找提高您的 WooCommerce 網站銷售量的方法?不用再找了,使用 WooCommerce 愿望清單!我們強大的工具旨在提高轉換率和增加網...。
  • Mollie Payments for WooCommerce 》, 透過 Mollie 的強大外掛,您可以在 WooCommerce 中快速整合所有主要的付款方式,不論您在何處需要它們。只需將它們直接丟入您的 WooCommerce 網店中,Molli...。
  • Matomo Analytics – Ethical Stats. Powerful Insights. 》已經使用 Matomo On-Premise 或 Matomo Cloud 的使用者?您需要使用 WP-Matomo 外掛而非此外掛。, 對於所有想要以更輕鬆的方式獲取顧客洞察資訊以發展自己的...。
  • Download Manager 》WordPress Download Manager 是一款檔案/文件管理外掛程式,可讓您管理、追蹤和控制從您的 WordPress 網站下載的檔案。您可使用密碼、使用者角色來控制檔案的...。
  • SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments 》新的 WordPress 銷售方式!, ★★★★★, 厭倦了過於複雜的設置、糟糕的效能、過多的元素,只得到一般的結果嗎?, 讓我們面對現實,傳統的 WordPress 電子商務外掛...。

文章
Filter
Mastodon