Shapes Posted March 16, 2022 Share Posted March 16, 2022 (edited) Hello, I built a module to display extra fields on product page which is working quite fine. But my issue is that I can not display multiple extra fields in one position. In public function hookDisplayProductAdditionalInfo($params) I have a foreach loop returning content. public function hookDisplayProductAdditionalInfo($params) { ... foreach($available_extra_fields as $available_extra_field) { if($available_extra_field['location'] == 'additional_info') { return $this->displayProductExtraFieldContent($id_lang, $available_extra_field, $product_extra_fields); } } } Only one extra field shows up. Surely because of the "return" statement..? I tried to return an array, but can't get this right. Any idea on how I could get this solved please? Edited March 16, 2022 by Shapes (see edit history) Link to comment Share on other sites More sharing options...
Shapes Posted March 16, 2022 Author Share Posted March 16, 2022 (edited) OK sorry, this was quite simple finally. In case this can help someone spare some time, all I did was : public function hookDisplayProductAdditionalInfo($params) { ... $html = ''; foreach($available_extra_fields as $available_extra_field) { if($available_extra_field['location'] == 'additional_info') { $html .= $this->displayProductExtraFieldContent($id_lang, $available_extra_field, $product_extra_fields); } } return $html; } Edited March 28, 2022 by Shapes (see edit history) 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now