dongluxin6711 2017-10-11 02:36
浏览 458

在WooCommerce单个产品页面的“添加到购物车”按钮下添加自定义文本

So I have attached an image of my issue.

The code is right up on the button

Basically I followed the instructions on this Stack Overflow question thread right here:
Text under Add to cart (woocommerce)

I posted my question there 5 times and someone kept removing it, so I'm posting it again here. Please advise.

Update: I have already tried the paragraph tag, the break tag, and the pre tag.

  • 写回答

1条回答 默认 最新

  • doujiang1913 2017-10-11 03:13
    关注

    You could try this (as you will see this is a CSS styling issue with the margin-top):

    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>';
    }
    

    Code goes in function.php file of your active child theme (active theme or in any plugin file).

    Tested and works. You will get that:

    enter image description here

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算