I want to add a custom button in the page where admin can manually create new order (Admin Order page).
Admin -> Woocommerce -> order -> Add order
After i add product and when clicked edit button can i show a custom button near to Add Meta button
? I cannot find a hook to use.
add_action( 'woocommerce_after_order_itemmeta', 'editable_order_meta_general' );
function editable_order_meta_general(){
?>
<button class="add_values button"><?php _e( 'Add Custom', 'woocommerce' ); ?></button>
<?php
}
I have added the above code. I got the result but the button is displayed soon after i add the product. I only want the button to display when i click edit button.
This is my error
This is my requirement.
#UPDATE
When i added the following code, it worked. Is it the right way ? Since woocommerce button in the same field is set display:none;
initially .
add_action( 'woocommerce_after_order_itemmeta', 'editable_order_meta_general' );
function editable_order_meta_general(){
?>
<div class="edit" style="display: none;">
<button class="add_values button"><?php _e( 'Add Custom', 'woocommerce' ); ?></button>
</div>
<?php
}
#Answer
As mentioned by Loiz in comment, there is no hook in WooCommerce to achieve this requirement. Have to change logic or something else.
html-order-item-meta.php
… So you will have to think differently what you are trying to do. – LoicTheAztec