larsbachs Posted December 17, 2011 Share Posted December 17, 2011 Hello there, in my PS I need to import a number of csv files on a weekly basis. The csv files contains product that are either updated, new og obsolete. During the import I would like that the product won't be changed, which means that the product IDs need to be defined in the csv that is imported. In order to do the above, I would like to use each product's SKU and add an extra identifier number number to use that as the product ID. Like this: identifier + SKU. All in all the product ID will have a length of 13 digits. Is it possible to increase the product ID digit limit from 10 to 13? And will it have any negative consequences? Link to comment Share on other sites More sharing options...
larsbachs Posted December 18, 2011 Author Share Posted December 18, 2011 Does someone know if the 10 digits is a limit is PS shop or a limit in mysql? And is there a reason the limit is restricted to just 10 digits Link to comment Share on other sites More sharing options...
doekia Posted December 18, 2011 Share Posted December 18, 2011 The limit of 10 is a development choice. It represent 100 millions (-1) of products no including the combination. Changing the limit to 13 significant for your use mean in fact 14. id_product in a sequential number allocated by the database to uniquely identify the this unique object. What you try to achieve seems more related to the reference field which is a 32 alphanumeric long field. If I understand import as a program that does import the csv, just fetch the product by Product::getByReference($sku); rather than new Product($id). This should do. Best, (d)oekia Link to comment Share on other sites More sharing options...
larsbachs Posted December 19, 2011 Author Share Posted December 19, 2011 Hi doekia, you are right that what I am trying to achieve is related to the reference field. The thing is that I often need to update my products from data feeds, but I want the product ID to always be the same in order to preserve the URLs. If I understand you correctly, I can preserve the product IDs when updating the product, by using the " Use product reference as key?" when importing. Is that correct? Link to comment Share on other sites More sharing options...
doekia Posted December 19, 2011 Share Posted December 19, 2011 Yes, assuming nobody tamper with the reference. If you have full db access you create a DB trigger that prevent the reference to be tampered once not empty (you need SQL skills here) Now I understand you are using off-the-shelf import function. Assertion is correct use "product reference as key". Bear in mind that since you mentionned data feeds you could optimize the performances by creating a glue component attached to webservices (you need development skills for that) unfortunatly, to date webservices still does not provide by reference identification (on talk actually within the team). Best, (d)oekia Link to comment Share on other sites More sharing options...
larsbachs Posted January 16, 2012 Author Share Posted January 16, 2012 #doekia thanks for your help, it was very useful. To solve the problem I decided to buy the module Import Fast that has been extremely efficient in doing daily import while mainting the product IDs. 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