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 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常
  • ¥15 关于风控系统,如何去选择
  • ¥15 这款软件是什么?需要能满足我的需求
  • ¥15 SpringSecurityOauth2登陆前后request不一致