function custom_hide_shipping_when_free_shipping_is_available( $rates, $package ) { $free_shipping_exists = false; $local_pickup_exists = false; // Check if Free Shipping and/or Local Pickup exist foreach ( $rates as $rate_key => $rate ) { if ( ‘free_shipping’ === $rate->get_method_id() ) { $free_shipping_exists = true;…Continue reading
// Display regular price excluding tax for specific user role add_filter(‘woocommerce_get_price_html’, ‘custom_display_regular_price_ex_tax_for_role’, 100, 2); function custom_display_regular_price_ex_tax_for_role($price_html, $product) { // Only run on frontend and for logged-in users if (is_admin() || !is_user_logged_in()) return $price_html; // Get current user and their roles…Continue reading
/* WCV – Show and save product brand taxonomy on the product edit form */ add_action( ‘wcv_after_product_details’, ‘wcv_product_brand_select2’ ); /** * Add the Brands taxonomy to the vendor product edit form. * * @param int $object_id The post ID. */…Continue reading
function shortcode_categorie_principali_wc() { $args = array( ‘taxonomy’ => ‘product_cat’, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ‘hide_empty’ => false, ‘parent’ => 0, ‘pad_counts’ => true, ‘hierarchical’ => true, ); $categories = get_terms($args); if (empty($categories) || is_wp_error($categories)) { return ‘ Nessuna categoria…Continue reading
#== Remove Express Checkout Button for Wholesale Users ==# function remove_express_checkout_button() { global $wp_filter, $wc_wholesale_prices; $user_wholesale_role = $wc_wholesale_prices->wwp_wholesale_roles->getUserWholesaleRole(); if( empty( $user_wholesale_role ) ) { return; } $hooks_to_clean = [ ‘woocommerce_after_add_to_cart_form’ => 1, ‘woocommerce_proceed_to_checkout’ => 21, ‘woocommerce_checkout_before_customer_details’ => 1, ‘woocommerce_pay_order_before_payment’ =>…Continue reading