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

心已入冬 提交于 2021-01-28 18:22:40

问题


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>");

回答1:


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


来源:https://stackoverflow.com/questions/65843843/how-to-use-the-custom-plugin-with-the-priority-order-number

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!