GSL Publication Auto-Tagger

/** * GSL Publication Auto-Tagger for WPCode * * Extracts keywords from teachPress publication titles and creates tags * for the tag cloud. Adds an admin page under the teachPress menu. * * WPCode Settings: * Code Type: PHP Snippet…Continue reading

Add images to order emails

add_filter( ‘woocommerce_email_order_items_args’, ‘bll_order_with_product_images’, 9999 ); function bll_order_with_product_images( $args ) { $args[‘show_image’] = true; return $args; }Continue reading

How To Translate Wholesale Price Text

add_filter( ‘wwp_filter_wholesale_price_title_text’ , ‘my_filter_wholesale_price’, 99 , 1 ); function my_filter_wholesale_price ( $titleText ) { $settingTitleText = __(‘Wholesale Price:’, ‘woocommerce-wholesale-prices-premium’); return $settingTitleText; }Continue reading

How To Allow Shop Managers To Edit Wholesale Users

/** * Allow Shop Managers to edit and promote wholesale users. */ function wws_add_shop_manager_user_editing_capability() { $shop_manager = get_role(‘shop_manager’); if ( ! $shop_manager ) { return; } // Only add capabilities if they don’t already exist if ( ! $shop_manager->has_cap(‘edit_users’) )…Continue reading

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