• Resolved winsa27

    (@winsa27)


    Hello,

    We need help setting up your plugins.

    On our Ecommerce, customers can have 2 roles:

    – Customer
    – Professional

    We also have two free delivery options depending on the role:

    – Customer >> free delivery from 100€
    – Pro >> free delivery from 150€

    We manage to display these two different delivery methods depending on the role.

    However at the level of your plugin it does not work.

    If both free shipping methods are enabled, for the customer role it will show free shipping for 150€ and not for 100€.

    How can we make it work?

    Thank you in advance for your help.

    Julian

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

    (@marinmatosevic)

    HI,

    please answer the following questions:

    1. Do you use some other shipping plugin?
    2. How many shipping zones do you have?
    3. Do users must be logged in to make a purchase?

    Best regards,
    Marin

    Thread Starter winsa27

    (@winsa27)

    Hello,

    1. Do you use some other shipping plugin?

    We use the following two plugins:

    – Shipping Zones by Drawing for WooCommerce
    – Table Rate Shipping for WooCommerce

    2. How many shipping zones do you have?

    We only have one shipping zone.

    Do users must be logged in to make a purchase?

    Basic users can order without being connected. However for Pro users benefiting from preferential rates, it is important for them to connect before placing an order.

    Plugin used for the management of specific prices according to the role of the user:

    – Role Based Pricing for WooCommerce

    Thanks for your help.

    Julian

    Plugin Author Marin Matosevic

    (@marinmatosevic)

    Ok, I think I understand. Since you have only one shipping zone, it makes things easier for us.

    Not sure how you have set up your shipping methods, but if you have multiple Free Shipping methods, the last Free Shipping method on the list will be considered the default one (see screenshot).

    In your case, this should be for the Customer user role.

    Then this snippet could work for you:
    This is aiming only Professional user role, others will get default amount.

    add_filter('fsl_min_amount', function ($amount) {
    
    	if (is_user_logged_in()) {
    
    		$user = wp_get_current_user();
    
    		$roles = (array) $user->roles;		
    
    		if ('professional' === $roles[0]) {
    			$amount = 150;
    		}
    	}
    
    	return $amount;
    });

    Let me know if it works as expected

    Best regards.

    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 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Free delivery progress bar depending on the role’ is closed to new replies.