Jsilva Posted December 24, 2019 Share Posted December 24, 2019 Hi, i have two types of products, father and child. In FO, on Childs pages I want to display the father's features. how can I do it? For example : Product 1 (father) - category: teste; value: 40; Product 1.1 (child) - category: iupi; value: 80; when I see Product 1.1, I want to see Product1's features, (teste - 40) and no Products1.1's feature (iupi - 80) Regards Link to comment Share on other sites More sharing options...
CedCommerce Team Posted December 24, 2019 Share Posted December 24, 2019 13 hours ago, Jsilva said: Hi, i have two types of products, father and child. In FO, on Childs pages I want to display the father's features. how can I do it? For example : Product 1 (father) - category: teste; value: 40; Product 1.1 (child) - category: iupi; value: 80; when I see Product 1.1, I want to see Product1's features, (teste - 40) and no Products1.1's feature (iupi - 80) Regards Hi, You can get parent products feature by their ID on child pages and add feature as per required design, below code will help you to get data of features and add accordingly $id_lang = get it from current context so it lang will same as store lang $id_product = ID of parent product $productObj = new Product($id_product); $features = $productObj->getFrontFeatures($id_lang); foreach($features as $feature) { var_dump($feature); } Link to comment Share on other sites More sharing options...
Jsilva Posted December 26, 2019 Author Share Posted December 26, 2019 Thank you for your answer. i think, I'm almost there. when I put your code do Product.php and call from products-details.tpl this is what I see in FO " fichainformativa2 array(3) { ["name"]=> string(17) "Classe Energetica" ["value"]=> string(7) "8888888" ["id_feature"]=> string(2) "31" } array(3) { ["name"]=> string(18) "Classe Combustivel" ["value"]=> string(1) "C" ["id_feature"]=> string(2) "32" } array(3) { ["name"]=> string(2) "Db" ["value"]=> string(2) "70" ["id_feature"]=> string(2) "33" } " and it's correct and showing in the right spot. But how can I do, to print like this: Classe Energetica - 8888888 Classe Combustível - C Db - 70. show only the 'name' and 'value' field. and show only the data and not the type of variable? Regards Link to comment Share on other sites More sharing options...
Jsilva Posted December 30, 2019 Author Share Posted December 30, 2019 never mind, i resolved it Very very thanks, @CedCommerce Team Link to comment Share on other sites More sharing options...
Jsilva Posted December 31, 2019 Author Share Posted December 31, 2019 by the way, you know how I can do the same, but with the Attachs? Regards 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