Tachanka Posted May 2, 2018 Share Posted May 2, 2018 Is there a way for me to get every single combination's attribute id from a product? Say I have a product named MyProduct with an ID = 1, which has 3 attributes A, B, and C, each attribute with 3 options. So there will be around 27 possible combinations, all of them I can see on Catalog > products > MyProduct on the Combinations tab. However, what I cannot see is their respective id_product_attribute. One way of getting it is adding MyProduct to the cart and hovering my mouse on the delete button, which gives me a link like this: /cart?delete=1&id_product=1&id_product_attribute=1000 . But alas, I cannot do this for 800+ combinations. I'm implementing an external product selector which sends the final built productID to prestashop (if that helps). For it to work, I need to get the id_product_attribute, any leads? Link to comment Share on other sites More sharing options...
gusman126 Posted May 2, 2018 Share Posted May 2, 2018 in .tpl file <script><script> $(document).ready(function() { $id_product = '{$product.id_product}'; $id_product_attribute = '{$product.id_product_attribute}'; $productoref = '{$product.reference_to_display}'; $urlok = '{$urlok}'; }); </script> Link to comment Share on other sites More sharing options...
Tachanka Posted May 2, 2018 Author Share Posted May 2, 2018 19 minutes ago, gusman126 said: in .tpl file <script><script> $(document).ready(function() { $id_product = '{$product.id_product}'; $id_product_attribute = '{$product.id_product_attribute}'; $productoref = '{$product.reference_to_display}'; $urlok = '{$urlok}'; }); </script> This could work. However I am using an external site which is not supporting prestashop. What I just found out though, is that I can get the product IDs and product attribute IDs by doing an SQL query. Now I only need to find out the correct one that includes the combination parameters for it to output said ID. Thanks anyway! 1 Link to comment Share on other sites More sharing options...
limitedshop Posted March 18, 2021 Share Posted March 18, 2021 Hello, I'm bringing this topic up again, because my request is related. I am looking to change the value of the product_attribute_id so that : the value id_product_attribute = id_product- id_attribute Example: If my product has as id_product: 250 If the declination in Catalogue > Attributes & characteristics > Size (ID "1") > XL (ID "6") I want my product_attribute to be 250-6 Does anyone know how to make this change? Thanks in advance and have a nice day Link to comment Share on other sites More sharing options...
musicmaster Posted March 22, 2021 Share Posted March 22, 2021 On 3/18/2021 at 3:55 PM, limitedshop said: Hello, I'm bringing this topic up again, because my request is related. I am looking to change the value of the product_attribute_id so that : the value id_product_attribute = id_product- id_attribute Example: If my product has as id_product: 250 If the declination in Catalogue > Attributes & characteristics > Size (ID "1") > XL (ID "6") I want my product_attribute to be 250-6 Does anyone know how to make this change? Thanks in advance and have a nice day Forget it. id_product_attribute is an auto-increase key. You would need to redefine it in all tables in which it is used as there are validation routines that check it being an integer. Link to comment Share on other sites More sharing options...
limitedshop Posted March 22, 2021 Share Posted March 22, 2021 11 minutes ago, musicmaster said: Forget it. id_product_attribute is an auto-increase key. You would need to redefine it in all tables in which it is used as there are validation routines that check it being an integer. Hi, Thank you for your feedback. I would like to make this change because I cannot export the variations on my orders. I have tried through Zapier and Integromat but there is only : product_name id_product id_product_attribute The id_product is perfectly usable but the product_attribute is unusable as there are 100,000 variations. In conclusion, it is impossible to get the variations (sizes) on the products ordered by my customers. My goal is simply to export the orders of my customers and to obtain in one of these columns the declination (size) bought by the customer. Would you have an alternative solution? Best regards, Link to comment Share on other sites More sharing options...
musicmaster Posted March 22, 2021 Share Posted March 22, 2021 It is not hard to make a customized export that exports according to your specification. On the other hand, when you change the id_product_attribute you make changes in the heart of Prestashop and nobody can foretell what side-effects that will have. 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