We have a Litium 7.0.1 solution with Acclerator 7.0.1 and we will be using one domain with multiple channels.
domain.com (Channel 1) (culture sv-se, currency, SEK, connected to pricelist)
Website Domain Names, Online Stores & Hosting - Domain.com (Channel 2) (culture en-us, currenct EUR, no connected pricelists)
This setup result is both channels sharing the same shoppingcart and the cart isn’t updated switching between the channels. The first visited channels defines the shoppingcart so if i visit channel 1 first i get the prices for channel 1 also on channel 2 and with $ currensy symbol (for some reason not EUR symbol). If i instead first visit channel 2 after cleraring cookie i get no prices on channel 2 or channel 1.
I know this was a issue in previous accelerators also but not sure how it was solved then.
Is this going to be fixed in the accelerator or do we need to fix this in the project?
Perhapps this is already fixed in 7.1.0 Accelerator?
Litium version: 7.0.1
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.
@Spotonkastebo was the above example to any help?
Inte hunnit testa riktigt pga VAB men ser vi en snabbtitt att cart.Setchannel körs men jag har fortfarnade svenska priserna med $ framför när jag surfar i kanalen som saknar prislistor och har € som valuta.
For the currency with wrong symbols you need to deselect the Use default from website culture
. Otherwise it will use the culture information from the website together with the currency that will be displayed strange.