BLL Admin Panel configuration

/** * Add “BLL Admin Panel” to the WordPress admin menu */ add_action(‘admin_menu’, ‘admin_config_panel_register_menu’); /** Creating Menu Structure **/ function admin_config_panel_register_menu() { // Check current user role if (!current_user_can(‘administrator’) && !current_user_can(‘shop_manager’) && !current_user_can(‘affiliate_manager’)) { return; // Do not add menu…Continue reading

Customize Email field label on Reset Password form

function fw_custom_reset_password_label($translated_text, $text, $domain) { // Check if the current domain matches your theme or plugin if ($domain === ‘default’) { // Change the text from “Username or Email Address” to “Username” if ($text === __(‘Username or Email Address’, ‘default’))…Continue reading

Rally Registration Info for Profile

/** * Name: fw_rallyRegistrations * Description: Outputs HTML for a view, regarding the registration(s) the user is signed up for * **/ add_shortcode(‘fw-rally-registrations’, ‘fw_rallyRegistrations’); function fw_rallyRegistrations($atts) { $past_or_future = isset($atts[“timeframe”]) ? $atts[“timeframe”] : “all”; $todays_date = date(“Y-m-d”); $html = “”;…Continue reading

Global – FacetWP

/** Adds script to header ** Scroll to top of page – only on Pager facet interaction ** For more info see: ** https://facetwp.com/help-center/facets/facet-types/pager/#how-to-add-pagination-scrolling **/ add_action( ‘wp_head’, function() { ?>Continue reading

Enable ‘Quanity’ label in woocommerce

add_action( ‘woocommerce_before_add_to_cart_quantity’, ‘bbloomer_echo_qty_front_add_cart’ ); function bbloomer_echo_qty_front_add_cart() { global $product; if ( $product->get_min_purchase_quantity() == $product->get_max_purchase_quantity() ) return; echo ‘ Quantity: ‘; }Continue reading

Concatenate Author

// Function to concatenate author names (brands) and save them in a meta field function save_concatenated_authors_meta($post_id) { // Check if this is a product post type if (get_post_type($post_id) !== ‘product’) { return; } // Retrieve the list of authors (brands)…Continue reading

Update concat authors for all products

function update_concatenated_authors_for_all_products() { // Get all products $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => -1, // Get all products ‘post_status’ => ‘publish’, ); $products = get_posts($args); foreach ($products as $product) { // Reuse the function to update the concatenated…Continue reading

Add discount for non zero store credit

add_action(‘woocommerce_cart_calculate_fees’, ‘apply_subscriber_discount’, 10, 1); function apply_subscriber_discount($cart) { if (is_admin() && !defined(‘DOING_AJAX’)) return; // Ensure it only runs on the front-end $user = wp_get_current_user(); // Apply 10% discount only if the user has the role ‘subscriber’ if (in_array(‘subscriber’, (array) $user->roles)) {…Continue reading

Shipping in Backend

add_action(‘woocommerce_admin_order_data_after_order_details’, ‘add_custom_shipping_method_backend’); function add_custom_shipping_method_backend($order_id) { // Manually get the order object $order = wc_get_order($order_id); if (!$order || !is_a($order, ‘WC_Order’)) { echo ‘ Error: Order is invalid. Please reload the page or check your setup. ‘; return; } ?> Royal Mail…Continue reading