You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes AttributeDecimal could not be converted to float
After the addition of the value, label, etc. functions on the attributes, this change here seems to have been forgotten.
This causes errors on the indexers and PDPs when products do not have their price in the product_price index, which seems to be the case when products are out of stock.
This vs changing this line to always retrieve the value? Might be cleaner that way? Or maybe that's taking away too much in case you want to use the label instead of the value in an Attribute cast?
Both would absolutely work so it'd be a matter of preference.
I personally prefer it like this to make the code more explicit and easier to understand for newcomers and tooling over extending the magic
Both would absolutely work so it'd be a matter of preference. I personally prefer it like this to make the code more explicit and easier to understand for newcomers and tooling over extending the magic
I agree, it's definitely better to keep things explicit to avoid magic.
My only issue with it would be that it means you don't always know when you have to do ->value without first checking whether you're getting an AbstractAttribute (e.g. name) or a direct column/joined value (e.g. sku). I can see this causing some issues in the future. But we'll have to see.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes
AttributeDecimal could not be converted to floatAfter the addition of the value, label, etc. functions on the attributes, this change here seems to have been forgotten.
This causes errors on the indexers and PDPs when products do not have their price in the product_price index, which seems to be the case when products are out of stock.