How To Hide Retail Categories From Wholesale Users

add_filter(‘get_terms’, function ($terms, $tax, $qvars, $term_query) { if (is_shop() || is_product_category()) { global $wc_wholesale_prices_premium; if (!isset($wc_wholesale_prices_premium)) { return $terms; } $user_wholesale_role = $wc_wholesale_prices_premium->wwpp_wholesale_roles->getUserWholesaleRole(); $wholesale_role = isset($user_wholesale_role[0]) ? $user_wholesale_role[0] : ”; foreach ($terms as $key => $term) { // Ensure $term…Continue reading

How To Change The Add To Cart Label

function filterAddToCartLabel($actionHtml , $product , $alternate) { $actionHtml = str_replace(‘Add To Cart’, ‘Add To Order’, $actionHtml); return $actionHtml; } add_filter(‘wwof_filter_product_item_action_controls’, ‘filterAddToCartLabel’, 10, 3);Continue reading

How To Change The Wholesale Price Text On The Front End

add_filter(‘wwp_filter_wholesale_price_title_text’, ‘override_wholesale_text’, 10, 1); function override_wholesale_text($wholesaletext) { global $current_user; if (isset($current_user) && class_exists(‘WWP_Wholesale_Roles’)) { $wwp_wholesale_roles = WWP_Wholesale_Roles::getInstance(); $wwp_wholesale_role = $wwp_wholesale_roles->getUserWholesaleRole(); if (!empty($wwp_wholesale_role) && in_array(‘wholesale_customer’, $wwp_wholesale_role)) { // Where ‘wholesale_customer’ is the name of the wholesale role you want to target…Continue reading

Single product – Show size description

add_action( ‘woocommerce_before_single_variation’, function() { if ( ! is_product() ) return; global $product; if ( ! $product ) return; $field_name = ‘uitleg_maten’; // ACF field name $taxonomy = ‘pa_merk’; // jouw attribute taxonomy $terms = taxonomy_exists( $taxonomy ) ? wp_get_post_terms( $product->get_id(),…Continue reading

Disable Legacy CSS

add_filter( ‘show_recent_comments_widget_style’, ‘__return_false’ ); add_filter( ‘use_default_gallery_style’, ‘__return_false’ );Continue reading