add_action( ‘gform_after_submission_5’, ‘wcv_dynamic_bol_capture’, 10, 2 ); function wcv_dynamic_bol_capture( $entry, $form ) { $order_id = null; $bol_file_url = null; foreach ( $form[‘fields’] as $field ) { $label = strtolower( trim( $field->adminLabel ?: $field->label ) ); if ( in_array( $label, array( ‘order…Continue reading
add_filter( ‘woocommerce_coupon_is_valid’, function( $valid, $coupon, $discount ) { $excluded_channels = $coupon->get_meta( ‘_excluded_og_channels’, true ); if ( empty( $excluded_channels ) ) { return $valid; } // Handle both a single stored string and a serialized array if ( ! is_array( $excluded_channels…Continue reading
add_filter( ‘woocommerce_countries_tax_or_vat’, function( $label ) { if ( ! ( is_cart() || is_checkout() ) ) { return $label; } global $wc_wholesale_prices_premium; $user_wholesale_role = $wc_wholesale_prices_premium->wwpp_wholesale_roles->getUserWholesaleRole(); if ( empty( $user_wholesale_role ) ) { return $label; } return ”; // Leave blank, or…Continue reading
/** * WWPP & Elementor: show correct wholesale prices in Elementor side cart. */ add_filter( ‘woocommerce_cart_item_price’, function ( $price_html, $cart_item, $cart_item_key ) { if ( is_cart() || is_checkout() ) { return $price_html; } global $wc_wholesale_prices_premium, $wc_wholesale_prices; if ( ! isset(…Continue reading
/** * Route logout through home URL to prevent exposing the hidden login path. */ add_filter( ‘logout_url’, function ( $logout_url, $redirect ) { $redirect_to = $redirect ?: home_url( ‘/’ ); return add_query_arg( [ ‘do_logout’ => ‘1’, ‘_wpnonce’ => wp_create_nonce( ‘safe-logout’…Continue reading
// WooCommerce Wholesale Prices Premium × WPML — bulk sync wholesale prices to translated products. // Add to functions.php. Visit: /wp-admin/?wwp_wpml_sync=1 as admin. Remove after use. add_action( ‘init’, function () { if ( ! current_user_can( ‘manage_options’ ) || empty( $_GET[‘wwp_wpml_sync’]…Continue reading
/** * Suppress WWP’s per-item cart recalculation during Wholesale Order Form batch adds. * Defers to a single recalculation at the end of each batch request instead. * * Add to functions.php or a mu-plugin. * Requires: Wholesale Prices 2.2.8+,…Continue reading