-
Notifications
You must be signed in to change notification settings - Fork 71
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
[FEATURE] display attribute value of child product in cart #214
base: develop
Are you sure you want to change the base?
[FEATURE] display attribute value of child product in cart #214
Conversation
@@ -42,8 +43,34 @@ public function __construct(GetVisibleCheckoutAttributesServiceInterface $getVis | |||
public function afterGetCustomOptions(Configuration $configuration, array $customOptions, ItemInterface $item) | |||
{ | |||
$attributes = $this->getVisibleCheckoutAttributesService->execute(); | |||
|
|||
$configurableAttributes = $item->getOptionByCode('attributes') ? $item->getOptionByCode('attributes')->getValue() : []; | |||
$configurableAttributes = $configurableAttributes ? array_keys(json_decode($configurableAttributes, true)) : []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not check how this is encoded, but most probably, we should use \Magento\Framework\Serialize\Serializer\Json
instead of directly using json_decode
?
...Catalog/Helper/Product/Configuration/AddVisibleInCheckoutAttributesToCustomOptionsPlugin.php
Outdated
Show resolved
Hide resolved
Thanks for your contribution, @rommelfreddy! Could you check my comments and the failing pipeline? I think the change makes sense, but I would love to get a second opinion from e.g. @frostblogNet :) |
@rommelfreddy thanks for the contribution. It would be nice if you could change the line metioned by @sprankhub. Sorry for the late response. |
…utAttributesToCustomOptionsPlugin.php Make comparison stricter Co-authored-by: Simon Sprankel <[email protected]>
@roman204, if you want to push this forward, feel free to send a new PR with the changes fixed. Since I don't need this at the moment and my time is very limited, I cannot just work on this. |
Please make sure these boxes are checked before submitting your PR - thank you!
Issue
none
Proposed changes
this PR prints the child-attribute value in the cart instead of the configurable attribute value.
This makes more sense, cause the admin would change the value in the child below. E.g. the SKU.