Need to suppress the shipping calculator in the checkout process since I have Free Shipping

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
In my customer roles, I have set up all "Registered" members to have free shipping.  Additionally, I have set it up so that each product has the "Free Shipping" checkbox selected.  My problem is that the shipping estimator still appears on the order summary page.  Is there a way to hide this in the Admin tool?  If I'm doing free shipping for all my products, there's no need to have the estimator.  As a quick fix, I've commented out the code in the View, but would rather not do it that way.  Thanks!
11 years ago
Go to admin area > Configuration > Settings > Shipping settings. Untick "Estimate shipping enabled". But this will disable it for all users
11 years ago
You can also change the source code in order to disable it only for registered customers:
1. Open \src\Presentation\Nop.Web\Controllers\ShoppingCartController.cs file
2. Find PrepareShoppingCartModel method
3. Replace
model.EstimateShipping.Enabled = cart.Count > 0 && cart.RequiresShipping() && _shippingSettings.EstimateShippingEnabled;

with
model.EstimateShipping.Enabled = cart.Count > 0 && cart.RequiresShipping() && _shippingSettings.EstimateShippingEnabled && !_workContext.CurrentCustomer.IsRegistered();

4. Recompile the solution
11 years ago
thanks!  Would I be able to enable the shipping estimator only for a non-system customer role that I defined?  I navigated to the code, and I see that in the Intellisense, if I type:

!_workContext.CurrentCustomer.

There is a "CustomerRoles" collection.  Is that populated with the all the roles for me to check against?
11 years ago
JVandy wrote:
Is that populated with the all the roles for me to check against?

Yes
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.