Is there a helper for pulling SelectedAttributeIDs?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 anos atrás
Greetings. I'm working on a simple recalculate upgrade for a client which auto-updates the price based upon selected attributes. It looks like between Versions 1.2 and 1.4 of NopCommerce the SelectedAttributeIDs <List> has changed over to a single string returned from SelectedAttributes. Is there a helper in the 1.4 version libraries to pull the individual SelectedAttributes "ProductVariantAttributeValueID", or will I have to write a simple parser myself. I'm trying to figure out what the benefit is of returning a single string is over a list of ID integers. I don't see where it is re-used in the project to any benefit. Perhaps I'm just missing the point of the change.

Anyhoo, any help would be appreciated. I know I can write my own parser of SelectedAttributes on the ProductAttributes contol, but I didn't want to have to write anything if a library helper is available.

Many thanks. No biggie, but just checking if I'm missing something due to coding blindness.
14 anos atrás
Just as a slight update, I see how where SelectedAttributes is used in ProductVariantAttributeCollection definition. I should be able to re-used the ProductVariantAttributeCollection object. If anyone still has a suggestion, of course, reply. I'll let you know the final result in case anyone else needs to do similar in their own code. I may post the updated ProductAttributes control that I'm working on once I get it 1.4 compliant.
14 anos atrás
I have a strange fetish for answering my own questions :)

I was able to store an array of integers for the selected attributes as follows -

int[] MySelectedAttribs = ProductAttributeHelper.ParseProductVariantAttributeIDs(ctrlProductAttributes.SelectedAttributes).ToArray();
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.