If I am logged in as admin, I would like to get a additional field in the checkout process to type in a discount (%).
Why though? Since you’re already logged in as admin – you could just create a manual order in the “backend” under WooCommerce > Order > Add New and skip the costing altogether.
If you’re like to stick with the front-end though, you could setup automatic discounts by using a plugin like https://www.woocommerce.com/products/dynamic-pricing/
Because I have a function that triggers if a order is placed. This just works through the frontend. And this function is required for something else.
Automatic discount doesnt work, beacuse there is no regularity/rules for them to be applied.
Is there no “if user = admin; create field”? Thats everything I need. Then in the backend I could simply get the variable from this field and calculate the total.
I solved it:
I installed the Plugin “Woo Discount Admin Backoffice”.
It allows you to give discoint in the WooCommerce Order Admin Panel.
In my case, I use the Hook one the “Save Order” Button to trigger my function.