How to invoice Woocommerce customer the remainder balance amount for additional items to an already paid order

I think you can detect order status change and store the current order total to be used as negative fee so that it can be deducted from order total before calculating total. To make it less confusing the code should be something like this: add_action(‘woocommerce_order_status_changed’, ‘add_credit_fee_if_editing’, 10,3); function add_credit_fee_if_editing($order_id, $old_status, $new_status) { $order = wc_get_order( … Read more

Remove username and account password field from checkout page

Here is my answer and it’s working perfectly. function conditionally_remove_checkout_fields( $fields ) { // HERE the defined product Categories $categories = array(‘age-defying-skincare’,’az-brand-accessories’,’az-healthy-supplements’,’az-other-natural-products’,’Not available mwb_wgm_giftcard’,’little-geniuses-children’); $found = false; // CHECK CART ITEMS: search for items from our defined product category foreach ( WC()->cart->get_cart() as $cart_item ){ if( has_term( $categories, ‘product_cat’, $cart_item[‘product_id’] ) ) { $found = … Read more