Jump to content

Can product ID be increased from the current 10 digits to 13?


Recommended Posts

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

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

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

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

  • 4 weeks later...

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...