Archives: Snippets
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
Test
echo “test”;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
dd the “MSRP” or “MAP” label to the regular price for wholesale customers
/* WWPP – Add the “MSRP” or “MAP” label to the regular price for wholesale customers */ add_action( ‘wp_head’, function() { global $wc_wholesale_prices_premium; $user_wholesale_role = $wc_wholesale_prices_premium->wwpp_wholesale_roles->getUserWholesaleRole(); if ( !empty( $user_wholesale_role ) ) { echo ‘ ‘; } });Continue reading
CSS Hide regular price
.original-computed-price ins:first-of-type{ display:none; }Continue reading