WooCommerce编辑订单页面退款区域复选框位置调整求助
WooCommerce编辑订单页面退款区域复选框位置调整求助
大家好,我最近在给WooCommerce订单编辑页面添加自定义复选框时遇到了位置问题,想请各位帮忙出出主意。
我写了一段代码,原本希望自定义复选框能显示在“Restock refunded items”选项的前面,但实际运行后,它却出现在了Order Total的后面,完全不是我想要的位置:
function add_custom_checkbox_after_restock($order_id) { $order = wc_get_order($order_id); $restock_refunded_items = $order->get_meta('_restock_refunded_items', true); echo '<div class="edit-field"> <label for="custom_checkbox">' . __('Custom Checkbox Label', 'your-theme-textdomain') . '</label> <input type="checkbox" class="checkbox" name="custom_checkbox" id="custom_checkbox" value="1" ' . checked($restock_refunded_items, 'yes', false) . ' /> </div>'; } add_action('woocommerce_admin_order_totals_after_total', 'add_custom_checkbox_after_restock');
有没有朋友知道怎么调整这段代码,让我的自定义复选框能显示在“Restock refunded items”选项的前面呀?麻烦指点一下,谢谢啦!
备注:内容来源于stack exchange,提问作者thecodedeveloper.com
相关产品推荐
相关产品推荐

