This is a known problem in the accelerator and if you update the ControllerBase
with something as below you will check and of needed set the new channel, country, market and currency on the shopping cart.
using System.Linq;
using System.Web.Mvc;
using System.Web.Routing;
using Litium.Accelerator.Builders.Menu;
using Litium.Foundation.Modules.ECommerce.ShoppingCarts;
using Litium.Foundation.Security;
using Litium.Globalization;
using Litium.Runtime.AutoMapper;
using Litium.Web.Routing;
using Litium.Web.Runtime;
namespace Litium.Accelerator.Mvc.Controllers
{
/// <summary>
/// Controller base class that helps out to set correct layout for rendering.
/// </summary>
/// <seealso cref="System.Web.Mvc.Controller" />
public abstract class ControllerBase : Controller
{
[FromService]
public CartAccessor CartAccessor { get; set; }
[FromService]
public RouteRequestLookupInfoAccessor RouteRequestLookupInfoAccessor { get; set; }
protected override void Initialize(RequestContext requestContext)
{
base.Initialize(requestContext);
var cart = CartAccessor.Cart;
if (cart.HasOrderCarrier)
{
var routeRequestLookupInto = RouteRequestLookupInfoAccessor.RouteRequestLookupInfo;
var channel = routeRequestLookupInto.Channel;
if (cart.OrderCarrier.ChannelID != channel.SystemId)
{
cart.SetChannel(
channel,
channel.CountryLinks.FirstOrDefault()?.CountrySystemId.MapTo<Country>(),
SecurityToken.CurrentSecurityToken);
}
}
}
}
}
Note: Remember to merge the changes into the current ControllerBase
to not overwrite the other logic that the file contains.