Skip to main content
Notice removed Draw attention by n-develop
Bounty Ended with Andrei Paliakou's answer chosen by n-develop
Notice added Draw attention by n-develop
Bounty Started worth 50 reputation by n-develop
Added more details
Source Link
n-develop
  • 275
  • 1
  • 10

I'm using Sitecore 9.0 Update 1 and XC9 Update 1 in a project for a European customer.

We created our own environment based on the OOTB Habitat-environment. In the config-file we set EUR to be the default currency. USD was always just added as an option.

In my "Currency Configuration" I use the currency set "Default", which has "EUR" assigned as default currency.

Also all prices, that are assigned to the sellable items (wether list prices or price cards / price card snapshots), use just EUR as currency.

But when I try to add a product to the cart, that does not have a USD-price assigned, I get the following error in the commerce engine log:

ERROR CtxMsg.Error.LineIsNotPurchasable: Text=Item 'My Product' is not purchasable.

But if I add a price with currency "USD", it works fine. I assume, I'm doing something wrong, sadly I wasn't able to figure out what it is.

I use the CartServiceProvider from the Sitecore.Commerce.Connect.Core.dll and use it's AddCartLines method.

Here is a simplified version of the code:

var currency = "EUR";
var cartLine = new CommerceCartLine(catalog, product.ProductId, null, product.Quantity);
var request = new AddCartLinesRequest(cart, new[] { cartLine })
{
    CurrencyCode = currency,
    Shop = new Shop { Name = Consts.ShopName }
};

_cartServiceProvider.AddCartLines(request);

UPDATE: I also noticed, that the cart always uses the list price to calculate the totals. That's a weird, because the price is calculated correctly based on the price card snapshots, when I use the PricingServiceProvider and it's GetProductPrices method. To assign price card snapshots to sellable items, we use tags. Maybe it's a problem when the cart tries to calculate the prices based on tags?

I'm using Sitecore 9.0 Update 1 and XC9 Update 1 in a project for a European customer.

We created our own environment based on the OOTB Habitat-environment. In the config-file we set EUR to be the default currency. USD was always just added as an option.

In my "Currency Configuration" I use the currency set "Default", which has "EUR" assigned as default currency.

Also all prices, that are assigned to the sellable items (wether list prices or price cards / price card snapshots), use just EUR as currency.

But when I try to add a product to the cart, that does not have a USD-price assigned, I get the following error in the commerce engine log:

ERROR CtxMsg.Error.LineIsNotPurchasable: Text=Item 'My Product' is not purchasable.

But if I add a price with currency "USD", it works fine. I assume, I'm doing something wrong, sadly I wasn't able to figure out what it is.

I use the CartServiceProvider from the Sitecore.Commerce.Connect.Core.dll and use it's AddCartLines method.

Here is a simplified version of the code:

var currency = "EUR";
var cartLine = new CommerceCartLine(catalog, product.ProductId, null, product.Quantity);
var request = new AddCartLinesRequest(cart, new[] { cartLine })
{
    CurrencyCode = currency,
    Shop = new Shop { Name = Consts.ShopName }
};

_cartServiceProvider.AddCartLines(request);

I'm using Sitecore 9.0 Update 1 and XC9 Update 1 in a project for a European customer.

We created our own environment based on the OOTB Habitat-environment. In the config-file we set EUR to be the default currency. USD was always just added as an option.

In my "Currency Configuration" I use the currency set "Default", which has "EUR" assigned as default currency.

Also all prices, that are assigned to the sellable items (wether list prices or price cards / price card snapshots), use just EUR as currency.

But when I try to add a product to the cart, that does not have a USD-price assigned, I get the following error in the commerce engine log:

ERROR CtxMsg.Error.LineIsNotPurchasable: Text=Item 'My Product' is not purchasable.

But if I add a price with currency "USD", it works fine. I assume, I'm doing something wrong, sadly I wasn't able to figure out what it is.

I use the CartServiceProvider from the Sitecore.Commerce.Connect.Core.dll and use it's AddCartLines method.

Here is a simplified version of the code:

var currency = "EUR";
var cartLine = new CommerceCartLine(catalog, product.ProductId, null, product.Quantity);
var request = new AddCartLinesRequest(cart, new[] { cartLine })
{
    CurrencyCode = currency,
    Shop = new Shop { Name = Consts.ShopName }
};

_cartServiceProvider.AddCartLines(request);

UPDATE: I also noticed, that the cart always uses the list price to calculate the totals. That's a weird, because the price is calculated correctly based on the price card snapshots, when I use the PricingServiceProvider and it's GetProductPrices method. To assign price card snapshots to sellable items, we use tags. Maybe it's a problem when the cart tries to calculate the prices based on tags?

Updated information about my configuration
Source Link
n-develop
  • 275
  • 1
  • 10

I'm using Sitecore 9.0 Update 1 and XC9 Update 1 in a project for a European customer.

We created our own environment based on the OOTB Habitat-environment. In the config-file we set EUR to be the default currency. USD was always just added as an option.

In my "Currency Configuration" I use the currency set "Default", which has "EUR" assigned as default currency.

Also all prices, that are assigned to the sellable items (wether list prices or price cards / price card snapshots), use just EUR as currency.

But when I try to add a product to the cart, that does not have a USD-price assigned, I get the following error in the commerce engine log:

ERROR CtxMsg.Error.LineIsNotPurchasable: Text=Item 'My Product' is not purchasable.

But if I add a price with currency "USD", it works fine. I assume, I'm doing something wrong, sadly I wasn't able to figure out what it is.

I use the CartServiceProvider from the Sitecore.Commerce.Connect.Core.dll and use it's AddCartLines method.

Here is a simplified version of the code:

var currency = "EUR";
var cartLine = new CommerceCartLine(catalog, product.ProductId, null, product.Quantity);
var request = new AddCartLinesRequest(cart, new[] { cartLine })
{
    CurrencyCode = currency,
    Shop = new Shop { Name = Consts.ShopName }
};

_cartServiceProvider.AddCartLines(request);

I'm using Sitecore 9.0 Update 1 and XC9 Update 1 in a project for a European customer.

We created our own environment based on the OOTB Habitat-environment. In the config-file we set EUR to be the default currency. USD was always just added as an option.

But when I try to add a product to the cart, that does not have a USD-price assigned, I get the following error in the commerce engine log:

ERROR CtxMsg.Error.LineIsNotPurchasable: Text=Item 'My Product' is not purchasable.

But if I add a price with currency "USD", it works fine. I assume, I'm doing something wrong, sadly I wasn't able to figure out what it is.

I use the CartServiceProvider from the Sitecore.Commerce.Connect.Core.dll and use it's AddCartLines method.

Here is a simplified version of the code:

var currency = "EUR";
var cartLine = new CommerceCartLine(catalog, product.ProductId, null, product.Quantity);
var request = new AddCartLinesRequest(cart, new[] { cartLine })
{
    CurrencyCode = currency,
    Shop = new Shop { Name = Consts.ShopName }
};

_cartServiceProvider.AddCartLines(request);

I'm using Sitecore 9.0 Update 1 and XC9 Update 1 in a project for a European customer.

We created our own environment based on the OOTB Habitat-environment. In the config-file we set EUR to be the default currency. USD was always just added as an option.

In my "Currency Configuration" I use the currency set "Default", which has "EUR" assigned as default currency.

Also all prices, that are assigned to the sellable items (wether list prices or price cards / price card snapshots), use just EUR as currency.

But when I try to add a product to the cart, that does not have a USD-price assigned, I get the following error in the commerce engine log:

ERROR CtxMsg.Error.LineIsNotPurchasable: Text=Item 'My Product' is not purchasable.

But if I add a price with currency "USD", it works fine. I assume, I'm doing something wrong, sadly I wasn't able to figure out what it is.

I use the CartServiceProvider from the Sitecore.Commerce.Connect.Core.dll and use it's AddCartLines method.

Here is a simplified version of the code:

var currency = "EUR";
var cartLine = new CommerceCartLine(catalog, product.ProductId, null, product.Quantity);
var request = new AddCartLinesRequest(cart, new[] { cartLine })
{
    CurrencyCode = currency,
    Shop = new Shop { Name = Consts.ShopName }
};

_cartServiceProvider.AddCartLines(request);
added 2 characters in body; edited title
Source Link
Peter Procházka
  • 9.5k
  • 2
  • 30
  • 71

Products needsneed USD price to be added to cart

I'm using Sitecore 9.0 Update 1 and XC9 Update 1 in a project for a europeanEuropean customer.

We created our own environment, based on the OOTB Habitat-environment. In the config-file we set EUR to be the default currency. USD was always just added as an option.

But when I try to add a product to the cart, that does not have a USD-price assigned, I get the following error in the commerce engine log:

ERROR CtxMsg.Error.LineIsNotPurchasable: Text=Item 'My Product' is not purchasable.

ERROR CtxMsg.Error.LineIsNotPurchasable: Text=Item 'My Product' is not purchasable.

But if I add a price with currency "USD", it works fine. I assume, I'm doing something wrong, sadly I wasn't able to figure out what it is.

I use the CartServiceProvider from the Sitecore.Commerce.Connect.Core.dll and use it's AddCartLines method.

Here is a simplified version of the code:

var currency = "EUR";
var cartLine = new CommerceCartLine(catalog, product.ProductId, null, product.Quantity);
var request = new AddCartLinesRequest(cart, new[] { cartLine })
{
    CurrencyCode = currency,
    Shop = new Shop { Name = Consts.ShopName }
};

_cartServiceProvider.AddCartLines(request);

Products needs USD price to be added to cart

I'm using Sitecore 9.0 Update 1 and XC9 Update 1 in a project for a european customer.

We created our own environment, based on the Habitat-environment. In the config-file we set EUR to be the default currency. USD was always just added as an option.

But when I try to add a product to the cart, that does not have a USD-price assigned, I get the following error in the commerce engine log:

ERROR CtxMsg.Error.LineIsNotPurchasable: Text=Item 'My Product' is not purchasable.

But if I add a price with currency "USD", it works fine. I assume, I'm doing something wrong, sadly I wasn't able to figure out what it is.

I use the CartServiceProvider from the Sitecore.Commerce.Connect.Core.dll and use it's AddCartLines method.

Here is a simplified version of the code:

var currency = "EUR";
var cartLine = new CommerceCartLine(catalog, product.ProductId, null, product.Quantity);
var request = new AddCartLinesRequest(cart, new[] { cartLine })
{
    CurrencyCode = currency,
    Shop = new Shop { Name = Consts.ShopName }
};

_cartServiceProvider.AddCartLines(request);

Products need USD price to be added to cart

I'm using Sitecore 9.0 Update 1 and XC9 Update 1 in a project for a European customer.

We created our own environment based on the OOTB Habitat-environment. In the config-file we set EUR to be the default currency. USD was always just added as an option.

But when I try to add a product to the cart, that does not have a USD-price assigned, I get the following error in the commerce engine log:

ERROR CtxMsg.Error.LineIsNotPurchasable: Text=Item 'My Product' is not purchasable.

But if I add a price with currency "USD", it works fine. I assume, I'm doing something wrong, sadly I wasn't able to figure out what it is.

I use the CartServiceProvider from the Sitecore.Commerce.Connect.Core.dll and use it's AddCartLines method.

Here is a simplified version of the code:

var currency = "EUR";
var cartLine = new CommerceCartLine(catalog, product.ProductId, null, product.Quantity);
var request = new AddCartLinesRequest(cart, new[] { cartLine })
{
    CurrencyCode = currency,
    Shop = new Shop { Name = Consts.ShopName }
};

_cartServiceProvider.AddCartLines(request);
Source Link
n-develop
  • 275
  • 1
  • 10
Loading