Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Product Attribute value not found while it has value #7169

Closed
deathgore opened this issue May 2, 2024 · 3 comments
Closed

Product Attribute value not found while it has value #7169

deathgore opened this issue May 2, 2024 · 3 comments

Comments

@deathgore
Copy link
Contributor

nopCommerce version: 4.70

With upgrade to 4.70 logic for GetShoppingCartItemAttributeWarningsAsync in ShoppingCartService.cs was changed a bit.

Line 865-867
var attributeValuesStr = _productAttributeParser.ParseValues(attributesXml, a1.Id);:

if (productAttributeValues.Any() && !productAttributeValues.Any(x => attributeValuesStr.Contains(x.Id.ToString())))

attributeValuesStr has the value of the attribute and not the Id

Shouldn't it check here that productAttributeValues contains all selected values?

@AndreiMaz
Copy link
Member

@skoshelev Probably related to 647e103 and bf5a97f

@skoshelev
Copy link
Contributor

Hi @deathgore. I don't quite understand the problem you describe.
The attributesXml parameter at the input has this format

<Attributes>
    <ProductAttribute ID="9">
        <ProductAttributeValue>
            <Value>21</Value>
        </ProductAttributeValue>
    </ProductAttribute>
    <ProductAttribute ID="10">
        <ProductAttributeValue>
            <Value>25</Value>
        </ProductAttributeValue>
    </ProductAttribute>
</Attributes>

after parsing, attributeValuesStr will always contain the value from the Value tag, which contains not a value, but an identifier

@skoshelev
Copy link
Contributor

Closed #7169

@skoshelev skoshelev closed this as not planned Won't fix, can't repro, duplicate, stale May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants