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
/** * Disable and Redirect the Wholesale Suite Dashboard to reduce admin bloat and improve load times. */ // 1. Remove the Dashboard submenu page from the admin menu add_action( ‘admin_menu’, ‘wws_remove_dashboard_submenu’, 9999 ); function wws_remove_dashboard_submenu() { // Parent slug…Continue reading
add_action(‘woocommerce_order_status_completed’, ‘send_order_to_google_sheets’, 10, 1); function send_order_to_google_sheets($order_id) { $order = wc_get_order($order_id); if (!$order) return; $line_items = $order->get_items(); $product_ids = array(); $product_names = array(); foreach ($line_items as $item) { $product_ids[] = $item->get_product_id(); $product_names[] = $item->get_name(); } $data = array( ‘id’ => $order->get_id(),…Continue reading