有關的文章: 官網設計

【官網設計】如何隱藏「商品價格」和「加入購物車按鈕」(新版主題:Aroma 及其後發佈之佈景主題)

EasyStore 目前不提供客製化程式碼的修改及維護服務,以下代碼僅供參考。自訂代碼可能因系統更新、頁面結構調整或其他設定而影響顯示及功能,建議使用前評估相關風險,並自行確認修改後的效果。EasyStore 不保證代碼的持續相容性,亦不提供後續維護服務。


此教學僅適用於新版主題:Aroma 及其後發佈之佈景主題


如果希望官網僅展示商品資訊,暫時不顯示商品價格或加入購物車按鈕,可以透過 Insert Code(插入代碼) 擴充功能,使用自訂 CSS 隱藏相關內容。


商家可以依照需求,選擇只隱藏商品價格、加入購物車按鈕,或同時隱藏兩者。



步驟一:安裝 Insert Code 擴充功能


  1. 前往 EasyStore 後台的擴充功能頁面。
  2. 搜尋並安裝 Insert Code。


  1. 安裝完成後,進入 Insert Code 設定頁面。


步驟二:新增自訂代碼


  1. 在 Insert Code 中新增一組代碼。


  1. 在「代碼名稱」輸入方便辨識的名稱,例如「隱藏商品價格和購物車」。
  2. 找到 「此處的代碼將打印到 <body> 部分上方」 的輸入欄位。



  1. 根據需求,複製以下對應的代碼並貼入。
  2. 點擊「儲存」。


方式一:隱藏商品價格


如只需要隱藏商品價格,可以使用以下代碼:


<style>
/* Hide regular product prices */
.price-container,
div.price {
display: none !important;
}

/* Hide variant prices */
.card-variants__price {
display: none !important;
}
</style>


此代碼用於隱藏:


  • 一般商品價格
  • 商品規格選擇區塊中的價格
  • 商品規格對應的優惠價及原價


方式二:隱藏加入購物車按鈕


如只需要隱藏加入購物車按鈕,可以使用以下代碼:


<style>
/* Hide add-to-cart elements */
.cart-drawer-button,
#AddToCart,
#AddToCartModal,
.quick-add__button,
add-to-cart-button,
.addToClassList {
display: none !important;
}

/* Hide quantity selector */
.product-form__input.product-form__quantity {
display: none !important;
}
</style>


此代碼會隱藏符合上述 CSS 選擇器的加入購物車相關元素。


方式三:同時隱藏商品價格及加入購物車按鈕


如需要同時隱藏兩者,可以使用以下完整代碼:


<style>
/* Hide regular product prices */
.price-container,
div.price {
display: none !important;
}

/* Hide variant prices */
.card-variants__price {
display: none !important;
}

/* Hide add-to-cart elements */
.cart-drawer-button,
#AddToCart,
#AddToCartModal,
.quick-add__button,
add-to-cart-button,
.addToClassList {
display: none !important;
}

/* Hide quantity selector */
.product-form__input.product-form__quantity {
display: none !important;
}
</style>


圖片:Insert Code 設定頁面


步驟三:確認官網顯示效果


儲存設定後,前往商店官網,確認商品價格及加入購物車按鈕是否已依照設定隱藏。


建議檢查以下位置:


  1. 官網首頁的商品展示區塊。
  2. 商品分類及商品列表頁面。
  3. 商品詳細頁面。
  4. 具有不同規格的商品,包含滑鼠移入後出現的規格選擇區塊。




如何恢復顯示商品價格或加入購物車按鈕?


如果日後需要恢復顯示,可以返回 Insert Code 設定頁面,移除對應的 CSS 設定並儲存。


恢復商品價格:


移除包含以下選擇器的價格隱藏設定:


 /* Hide regular product prices */
.price-container,
div.price {
display: none !important;
}

/* Hide variant prices */
.card-variants__price {
display: none !important;
}


恢復加入購物車按鈕:


移除以下設定:


 /* Hide add-to-cart elements */
.cart-drawer-button,
#AddToCart,
#AddToCartModal,
.quick-add__button,
add-to-cart-button,
.addToClassList {
display: none !important;
}

/* Hide quantity selector */
.product-form__input.product-form__quantity {
display: none !important;
}


如果使用的是「方式三」的完整代碼,只需要於 Insert Code 擴充刪除或關閉代碼




注意事項


  • 此方式僅透過 CSS 隱藏頁面上的指定元素,不會修改商品原本的價格、庫存或銷售設定。
  • 隱藏商品價格或加入購物車按鈕,不代表商品已停止販售,也不會停用購物車或結帳功能。
  • 代碼的實際效果可能因商店使用的佈景主題、頁面結構及其他自訂設定而有所不同,部分元素可能無法完整隱藏。
  • 如商店使用立即購買(Buy Now)、其他購物車功能或第三方擴充功能,建議另外確認相關按鈕是否受到影響。
  • 建議修改前先備份原有代碼,並於儲存後使用電腦及手機確認實際顯示效果。

更新時間: 17/11/2026

這篇說明對您有幫助嗎?

分享您的反饋

取消

感謝!