fahad_ansari Posted October 11, 2018 Share Posted October 11, 2018 (edited) hi there, In PS1.6, how to get current 'id_product_attribute' of a product with combinations, when click on a button that i create below 'Add to Cart' button using hook 'displayProductButtons' ? Thanks Edited October 11, 2018 by fahad_ansari added hook name (see edit history) Link to comment Share on other sites More sharing options...
hakeryk2 Posted October 11, 2018 Share Posted October 11, 2018 You want to have it .tpl file? It suppose be like this {if isset($product.id_product_attribute) && $product.id_product_attribute} {$product.id_product_attribute|intval} {/if} Link to comment Share on other sites More sharing options...
fahad_ansari Posted October 11, 2018 Author Share Posted October 11, 2018 hi @hakeryk2, Thanks for your response, Yes it will work for tpl file but I want it in my ajax call, and luckily I found a hidden input tag with id "idCombination" in product page which contains current combination's id_product_attribute and it worked for me. <input type="hidden" name="id_product_attribute" id="idCombination" value="4"> 1 Link to comment Share on other sites More sharing options...
hakeryk2 Posted December 29, 2022 Share Posted December 29, 2022 On 10/11/2018 at 10:25 AM, fahad_ansari said: hi @hakeryk2, Thanks for your response, Yes it will work for tpl file but I want it in my ajax call, and luckily I found a hidden input tag with id "idCombination" in product page which contains current combination's id_product_attribute and it worked for me. <input type="hidden" name="id_product_attribute" id="idCombination" value="4"> Few years ago and I found this thread in google while I was searching for JS solution xD It is so obvious now but yeah. Praise the forums! 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