Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
118 views
in Technique[技术] by (71.8m points)

php - How to use the custom plugin with the priority order number?

I am learning WooCommerce development. I installed the pin checker plugin and that displays above the add to cart button. Screenshot here https://prnt.sc/xftmpn

Now I have displayed the paragraph below of the pin checker and I used the below code but it's displaying above the pin checker.

function action_woocommerce_single_product_pinchecker_content() {
    echo "<span>Please enter PIN code to check delivery time & other more</span>";
}
 add_action( 'woocommerce_single_product_summary', 'action_woocommerce_single_product_pinchecker_content', 28, 0 );

I can do it with jQuery and it's working but I don't want to do it with jQuery.

$('.pin_div').append("<span>Please enter PIN code to check delivery time & other more</span>");
question from:https://stackoverflow.com/questions/65843843/how-to-use-the-custom-plugin-with-the-priority-order-number

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
add_action( 'woocommerce_after_add_to_cart_form', 'mujuonly_before_add_to_cart_btn' );

function mujuonly_before_add_to_cart_btn() {
    echo "<span>" . __( 'Please enter PIN code to check delivery time & other more<', 'woocommerce' ) . "/span>";
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...