Jump to content

How to get all id_product_attribute in product.tpl?


santiagonra

Recommended Posts

Hi! I need to have the id_product_attribute (aka Product Combination ID) for each combination in my Product page. So far I have been able to get the id_product_attribute for the selected current combination. But what I really need is to have all the ids.

 

This is what I have in my product.tpl

            <div id="mobileProductViewer" class="col-md-6">
                <input type="hidden" id="combinationId" value="{$product.id_product_attribute}">
            </div>

 That generates a hidden input with just one combination id. I would need all the ids for the combinations. 

And is it possible to get also what that ID represents? I mean something like this:

167 - Red - XL

 

I hope I coud explain myself.

 

Thanks in advance!!!

prestashopCombinationId.png

Link to comment
Share on other sites

Thanks so much for you answer! I tried your code, it works, but it's not exactly what I need. What I need is each combination number. You can see it on the url on the image that I attached. 

Every combination has this id, for example:

RED-S : 286

RED-M: 134

WHITE-L: 122

 

So what I need is to have all the combinations ids on my product page.

 

 

combination.png

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...