What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hey there.. did anyone ever stumbled upon this kind of exception? ```Spryker\Zed\PriceCartConnector\

UPDQFGGM9
UPDQFGGM9 Posts: 29 🧑🏻‍🚀 - Cadet

Hey there..
did anyone ever stumbled upon this kind of exception?

Spryker\Zed\PriceCartConnector\Business\Exception\PriceMissingException - Cart item "..." can not be priced. in "/var/www/spryker/releases/current/vendor/spryker/price-cart-connector/src/Spryker/Zed/PriceCartConnector/Business/Manager/PriceManager.php::127"

I can’t reproduce the issue for the given product.. and it happens randomly not product specific and across multiple stores.
My best guess has been that the productFacade doesn’t return valid prices, but all data seems to be fine. The error happens on quote validation.

Comments

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    Hi Chris, I think it's a known issue. Let me find some details.

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    Steps to Reproduce
    here `\\Spryker\\Zed\\PriceProduct\\Business\\Model
    Reader::resolveProductPriceByPriceProductCriteria` , we use static property static::$resolvedPriceProductTransferCollection as a cache. 
    In some cases, when this Reader is used several times during the session, $priceProductCriteriaIdentifier is duplicated by different objects hash names. 
    
    How to solve:
    Variant 1:
    here `\\Spryker\\Zed\\PriceProduct\\Business\\Model
    Reader::resolveProductPrices` substitude this line
    
    $priceProductCriteriaIdentifier = spl_object_hash($priceProductFilterTransfers[$index]);
    
    with
    
    $priceProductCriteriaIdentifier = spl_object_hash($priceProductFilterTransfers[$index]) . '#' . $priceProductCriteriaTransfer->getSku();
    
    It will make sure, that $priceProductCriteriaIdentifier always uniq for each product
    
    Variant 2:
    here `\\Spryker\\Zed\\PriceProduct\\Business\\Model
    Reader::resolveProductPriceByPriceProductCriteria` do not use static variable as a cache.
    

    The proper fix is on its way. I will try to push it through release process.

  • UPDQFGGM9
    UPDQFGGM9 Posts: 29 🧑🏻‍🚀 - Cadet
    edited January 2021

    thanks for the fast support @valerii.trots! made my day.

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    We had some hard time to debug the problem together with @UQ4B55JLV on this one.