Category: eCommerce
GTM Head
WWPP & Elementor – Show correct wholesale prices in the Elementor side cart
/** * 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
WWLC – Route logout through home URL to prevent exposing the hidden login path
/** * 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
WWPP & WPML: bulk sync wholesale prices to translated products
// 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
WWOF – Optimize Wholesale Order Form Bulk Adds by Deferring Cart Recalculation
/** * 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
Payment Link
Submit PaymentContinue reading
WWS – Disable and Redirect the Wholesale Suite Dashboard
/** * 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
WooCommerce to Google Sheets schaahi store
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
Disable Coupon Entry During Manual Subscription Renewal Payment Flows
if ( ! function_exists( ‘rd_wc_subscription_renewal_coupon_locked_context’ ) ) { function rd_wc_subscription_renewal_coupon_locked_context(): bool { if ( is_admin() && ! wp_doing_ajax() ) { return false; } if ( ! function_exists( ‘WC’ ) ) { return false; } if ( function_exists( ‘wcs_cart_contains_renewal’ ) &&…Continue reading