pavel83 Posted June 24, 2022 Share Posted June 24, 2022 i am trying to call in the product page, the current id code of the active combination. I am trying to use this code but I am not getting any results $id_product_attribute=Tools::getValue('id_product_attribute'); Somebody can help me? Link to comment Share on other sites More sharing options...
Ress Posted June 24, 2022 Share Posted June 24, 2022 Can you detail a little? Where exactly do you want to call, directly in the controller? Through a module in a certain hook? Link to comment Share on other sites More sharing options...
pavel83 Posted June 24, 2022 Author Share Posted June 24, 2022 (edited) I'm trying writing a module, for my website to synchronize quantities through in a webservice in hook of the product page, everything works for me, except in case the product has combinations. I need to check the product id of the current combination and update the quantities via the reference. $product = new Product(Tools::getValue('id_product')); $idarticolo = $product->reference; if ($product->hasAttributes()) { $id_product_attribute=Tools::getValue('id_product_attribute'); $combination = new Combination($id_product_attribute); $idarticolo = $combination->reference; } can you help me? Edited June 27, 2022 by pavel83 (see edit history) Link to comment Share on other sites More sharing options...
pavel83 Posted June 29, 2022 Author Share Posted June 29, 2022 can someone help me? I can't get the id of the current combination in any way Link to comment Share on other sites More sharing options...
Ress Posted June 29, 2022 Share Posted June 29, 2022 Can you also show in which function you wrote that code? In a specific hook? Link to comment Share on other sites More sharing options...
pavel83 Posted June 29, 2022 Author Share Posted June 29, 2022 for products without combinations, there are no problems, for those with combinations I can't query find the current id combination of the active product so it doesn't work for me i am trying this $id_product_attribute=Tools::getValue('id_product_attribute'); but doens't work 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