[英]Replace Add to cart button on Woocommerce Single Product Pages for a product category
[英]Add custom text below Add To Cart button in WooCommerce single product pages
所以我附上了我的問題的圖片。
基本上我按照這里的堆棧溢出問題線程的說明進行操作:
添加到購物車 (woocommerce) 下的文本
我在那里發布了 5 次我的問題,有人一直在刪除它,所以我再次發布在這里。 請指教。
更新:我已經嘗試了段落標記、中斷標記和預標記。
你可以試試這個(你會看到這是一個帶有margin-top
的CSS樣式問題):
add_action( 'woocommerce_after_add_to_cart_button', 'custom_content_after_addtocart_button', 100 );
function custom_content_after_addtocart_button() {
// custom content.
echo '<br/><div><p style="font-size:10px; font-style=italic; margin-top:20px;">(*Contact us for bulk purchase enquiry)</p></div>';
}
代碼位於活動子主題(活動主題或任何插件文件)的 function.php 文件中。
測試和工作。 你會得到:
此代碼將它很好地放置在“添加到購物車”按鈕下方:
add_action( 'woocommerce_after_add_to_cart_form','content_after_addtocart', 100 );
function content_after_addtocart() {
// place your content below.
echo 'Hello There !!';
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.