How show shipping cost without taxes on shopping cart

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 Jahre weitere
Hi,

I'm trying to make this resume of prices on shopping cart:

- Products subtotal: Show without taxes.
- Shipping cost: Show without taxes.
- Taxes: Show taxes.
- Total: Show the total cost with taxes (subtotal + shipping + taxes).

I'm only able to show Shipping cost with taxes and it's confusing:

- Products subtotal: Show without taxes.
- Shipping cost: It's showing whit taxes.!!!!
- Taxes: Show taxes.
- Total: Show the total cost with taxes.

How can I do this? Now, subtotal + shipping + taxes is not really the total and some customers are confused.

Thanks!
7 Jahre weitere
sabueXo wrote:
Hi,

I'm trying to make this resume of prices on shopping cart:

- Products subtotal: Show without taxes.
- Shipping cost: Show without taxes.
- Taxes: Show taxes.
- Total: Show the total cost with taxes (subtotal + shipping + taxes).

I'm only able to show Shipping cost with taxes and it's confusing:

- Products subtotal: Show without taxes.
- Shipping cost: It's showing whit taxes.!!!!
- Taxes: Show taxes.
- Total: Show the total cost with taxes.

How can I do this? Now, subtotal + shipping + taxes is not really the total and some customers are confused.

Thanks!


Hello,

maybe turn off "Shipping is taxable" under tax settings?
7 Jahre weitere
Thanks for suggestion, but no, this not work.

If we set that shipping is not taxable, shipping taxes will not be applied ant this is not correct.

Anybody have is own store working with mentioned configuration?

Thanks!
7 Jahre weitere
There is not way to do this with taxes?

Thanks!
7 Jahre weitere
sabueXo wrote:
There is not way to do this with taxes?

It would be useful if you could post a screenshot of the order totals showing that they don't add up but it looks like it could be an oversight in the code to me. Looking at the PrepareOrderTotalsModel function in the ShoppingCartController you can see this block of code:

//subtotal
decimal orderSubTotalDiscountAmountBase;
List<Discount> orderSubTotalAppliedDiscounts;
decimal subTotalWithoutDiscountBase;
decimal subTotalWithDiscountBase;
var subTotalIncludingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax && !_taxSettings.ForceTaxExclusionFromOrderSubtotal;
_orderTotalCalculationService.GetShoppingCartSubTotal(cart, subTotalIncludingTax,
    out orderSubTotalDiscountAmountBase, out orderSubTotalAppliedDiscounts,
    out subTotalWithoutDiscountBase, out subTotalWithDiscountBase);
decimal subtotalBase = subTotalWithoutDiscountBase;
decimal subtotal = _currencyService.ConvertFromPrimaryStoreCurrency(subtotalBase, _workContext.WorkingCurrency);
model.SubTotal = _priceFormatter.FormatPrice(subtotal, true, _workContext.WorkingCurrency, _workContext.WorkingLanguage, subTotalIncludingTax);

if (orderSubTotalDiscountAmountBase > decimal.Zero)
{
    decimal orderSubTotalDiscountAmount = _currencyService.ConvertFromPrimaryStoreCurrency(orderSubTotalDiscountAmountBase, _workContext.WorkingCurrency);
    model.SubTotalDiscount = _priceFormatter.FormatPrice(-orderSubTotalDiscountAmount, true, _workContext.WorkingCurrency, _workContext.WorkingLanguage, subTotalIncludingTax);
    model.AllowRemovingSubTotalDiscount = model.IsEditable &&
        orderSubTotalAppliedDiscounts.Any(d => d.RequiresCouponCode && !String.IsNullOrEmpty(d.CouponCode));
}


//shipping info
model.RequiresShipping = cart.RequiresShipping();
if (model.RequiresShipping)
{
    decimal? shoppingCartShippingBase = _orderTotalCalculationService.GetShoppingCartShippingTotal(cart);
    if (shoppingCartShippingBase.HasValue)
    {
        decimal shoppingCartShipping = _currencyService.ConvertFromPrimaryStoreCurrency(shoppingCartShippingBase.Value, _workContext.WorkingCurrency);
        model.Shipping = _priceFormatter.FormatShippingPrice(shoppingCartShipping, true);

        //selected shipping method
        var shippingOption = _workContext.CurrentCustomer.GetAttribute<ShippingOption>(SystemCustomerAttributeNames.SelectedShippingOption, _storeContext.CurrentStore.Id);
        if (shippingOption != null)
            model.SelectedShippingMethod = shippingOption.Name;
    }
}

The first line in bold shows where the subtotal calculation is taking the ForceTaxExclusionFromOrderSubtotal setting into account when deciding whether to display the total including or excluding tax. The second line in bold shows that the shipping total calculation doesn't take this setting into account and in fact if you follow the code through the OrderTotalCalculationService you find that it only depends on the TaxDisplayType for the current WorkContext. It might be worth posting in the bugs or suggestions forum where it's likely to get more attention from the nop devs but if you're just looking for a quick fix and don't mind changing core code then it would be relatively easy to fix by changing the second bit of code above to something like this (not tested):

//shipping info
model.RequiresShipping = cart.RequiresShipping();
if (model.RequiresShipping)
{
    var shippingIncludingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax && !_taxSettings.ForceTaxExclusionFromOrderSubtotal;
    decimal? shoppingCartShippingBase =  _orderTotalCalculationService.GetShoppingCartShippingTotal(cart, shippingIncludingTax);
    if (shoppingCartShippingBase.HasValue)
    {
        decimal shoppingCartShipping = _currencyService.ConvertFromPrimaryStoreCurrency(shoppingCartShippingBase.Value, _workContext.WorkingCurrency);
        model.Shipping = _priceFormatter.FormatShippingPrice(shoppingCartShipping, true, , _workContext.WorkingCurrency, _workContext.WorkingLanguage, shippingIncludingTax);

        //selected shipping method
        var shippingOption = _workContext.CurrentCustomer.GetAttribute<ShippingOption>(SystemCustomerAttributeNames.SelectedShippingOption, _storeContext.CurrentStore.Id);
        if (shippingOption != null)
            model.SelectedShippingMethod = shippingOption.Name;
    }
}

I think that would be sufficient to make the display of tax on the shipping amount also depend on the ForceTaxExclusionFromOrderSubtotal setting. It may also require some changes in the MessageTokenProvider service to make sure it gets displayed in the same way in the order confirmation email.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.