File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Catalog/Model/ProductLink
GroupedProduct/Model/Product/Initialization/Helper/ProductLinks/Plugin Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1010use Magento \Catalog \Api \Data \ProductLinkExtensionFactory ;
1111use Magento \Catalog \Model \Product \Initialization \Helper \ProductLinks as LinksInitializer ;
1212use Magento \Catalog \Model \Product \LinkTypeProvider ;
13+ use Magento \Framework \Api \SimpleDataObjectConverter ;
1314use Magento \Framework \Exception \CouldNotSaveException ;
1415use Magento \Framework \Exception \NoSuchEntityException ;
1516use Magento \Framework \EntityManager \MetadataPool ;
@@ -170,7 +171,7 @@ public function getList(\Magento\Catalog\Api\Data\ProductInterface $product)
170171 foreach ($ item ['custom_attributes ' ] as $ option ) {
171172 $ name = $ option ['attribute_code ' ];
172173 $ value = $ option ['value ' ];
173- $ setterName = 'set ' . ucfirst ($ name );
174+ $ setterName = 'set ' . SimpleDataObjectConverter:: snakeCaseToUpperCamelCase ($ name );
174175 // Check if setter exists
175176 if (method_exists ($ productLinkExtension , $ setterName )) {
176177 call_user_func ([$ productLinkExtension , $ setterName ], $ value );
Original file line number Diff line number Diff line change 88use Magento \Catalog \Api \Data \ProductLinkExtensionFactory ;
99use Magento \Catalog \Api \Data \ProductLinkInterfaceFactory ;
1010use Magento \Catalog \Api \ProductRepositoryInterface ;
11+ use Magento \Framework \Api \SimpleDataObjectConverter ;
1112use Magento \Framework \Exception \NoSuchEntityException ;
1213use Magento \GroupedProduct \Model \Product \Type \Grouped as TypeGrouped ;
1314
@@ -111,7 +112,7 @@ public function beforeInitializeLinks(
111112 foreach ($ linkRaw ['custom_attributes ' ] as $ option ) {
112113 $ name = $ option ['attribute_code ' ];
113114 $ value = $ option ['value ' ];
114- $ setterName = 'set ' . ucfirst ($ name );
115+ $ setterName = 'set ' . SimpleDataObjectConverter:: snakeCaseToUpperCamelCase ($ name );
115116 // Check if setter exists
116117 if (method_exists ($ productLinkExtension , $ setterName )) {
117118 call_user_func ([$ productLinkExtension , $ setterName ], $ value );
You can’t perform that action at this time.
0 commit comments