0

When calling AddCartLine in Postman

{
    "cartId":"{ee79d65c-631e-4c96-9dfe-031af910bed1}",
    "itemId": "Entity-Catalog-MyCat|20023_0000118|00889918331075",
    "quantity": 1
}

I get the following errors:

25 13:54:27 ERROR Inventory.block.PopulateItemAvailability-No ProductArgument in Context
21 13:54:27 ERROR CtxMsg.Error.EntityNotFound: Text=Entity '|0000118|00889918331075' was not found.
4 13:54:27 ERROR PipelineAbort:Entity '|0000118|00889918331075' was not found.
4 13:54:27 ERROR Availability.PopulateDefaultItemAvailabilityComponentBlock.InventoryItemNotFound.|0000118|00889918331075

This same error occur from the Sitecore.Commerce.Console:

 public static string AddCartLineWithVariant(string cartId)
 {
     var commandResult = Proxy.DoCommand(
         ShopsContainer.AddCartLine(cartId, EnvironmentConstants.Bzees_Catalog + "|20023_0000118|00889918331075", 1));

    return commandResult.Models.OfType<LineAdded>().FirstOrDefault()?.LineId;
}

2 Answers 2

1

It looks like it might having problems with the underscore in the Product ID? The item id you sent is |20023_0000118|00889918331075, however the error only lists |0000118|00889918331075. It's seems to have dropped the values before the underscore.

Can you try a product id without an underscore and see if you get the same issue. If not then you may have found a bug.

0

We created a support ticket with Sitecore: When adding a sellable item (Product) to a cart, the Sitecore Commerce Engine will throw an error if the product's 'FriendlyId' is not the same as the 'ProductId' that is in the Sellable Item Entity JSON. We desired these to be different values. For example, we would like to have the following:

FriendlyId = "0000118" ProductId = "20030_0000118"

If we do not make the FriendlyId = "20030_0000118", then commerce engine cannot find the product's availability when we are trying to add it to the cart. This happens when we call the 'AddCartLine' method

Here is the error message from the Log:

31 15:57:38 ERROR Inventory.block.PopulateItemAvailability-No ProductArgument in Context
31 15:57:38 ERROR CtxMsg.Error.EntityNotFound: Text=Entity '|0000118|00889918331075' was not found.
31 15:57:38 ERROR PipelineAbort:Entity '|0000118|00889918331075' was not found.
31 15:57:38 ERROR Availability.PopulateDefaultItemAvailabilityComponentBlock.InventoryItemNotFound.|0000118|00889918331075
50 15:57:38 WARN CtxMsg.Warning.EntityNotFound: Text=EntityBzees-20023_0000118 was not found.
12 15:57:38 WARN CtxMsg.Warning.EntityNotFound: Text=EntityBzees-20023_0000118 was not found.
14 15:57:38 ERROR Inventory.block.PopulateItemAvailability-No ProductArgument in Context
12 15:57:38 ERROR CtxMsg.Error.EntityNotFound: Text=Entity '|0000118|00889918331075' was not found.
50 15:57:38 ERROR PipelineAbort:Entity '|0000118|00889918331075' was not found.
50 15:57:38 ERROR Availability.PopulateDefaultItemAvailabilityComponentBlock.InventoryItemNotFound.|0000118|00889918331075

We we notified by Sitecore that it turns out this is a bug. This is a partial response we received on our Sitecore support ticket:

"After checking with developers, there is no requirement for the ProductId and FriendlyId to have the same value. Unfortunately due the current implementation of the product, having different values between the FriendlyId and ProductId will cause other unexpected issues such as the one you are experiencing (Not only for AddCartLine). Therefore, the behavior you reported was registered as a bug in our bug tracking system in order to have a more consistent use of these values throughout the engine. Thank you for reporting the problem."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.