• Resolved rasmus1835

    (@rasmus1835)


    Hello, is it possible to only show the progress bar on the default language of a site (since we do not offer free shipping to all countries).
    We have set the zone to DK but still the progress bar is shown on all other destinations / zones ?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Marin Matosevic

    (@marinmatosevic)


    Of course, it works right out of the box. But have you set up the custom threshold in the General settings? If you have, keep in mind that this custom threshold overrides all the free shipping settings you might have set for individual zones. It’s best to use the custom threshold only if you’re using a different shipping plugin, and ours can’t find the free shipping info.

    I’ve put together a simple piece of code for you to use in your child theme’s functions.php file or with the Code Snippets plugin. This code will prevent the progress bar from showing up for countries other than Denmark.

    add_filter('fsl_min_amount', function ($amount) {
    
    	if ($cart = WC()->cart) {
    
    		$packages = $cart->get_shipping_packages();
    		$package  = reset($packages);
    
    		$country = $package['destination']['country'] ?? '';
    
    		if ($country !== 'DK') {
    			$amount = null;
    		}
    	}
    
    	return $amount;
    });

    Let me know if that helped.

    Plugin Author Marin Matosevic

    (@marinmatosevic)

    We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please feel free to start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show only on default language’ is closed to new replies.