Thread: Product ID
View Single Post
  #2  
Old 03-13-2021, 09:16 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Product ID

Product ID is never random. As with any other ID for any other entity - customer, order, category, etc. The ID field is the unique identifier for the corresponding table in the database and is a sequential number. Always increments by 1 (unless the actual table is set differently which is almost never the case) from the last id.


If last product you added has an id of 10 the next one will have an id of 11. If you delete the product with an id of 10 the next one will be 12 - since there is 11.



Look at these IDs as unique IDs for internal use. You don't need to know the id or reference it unless you are using dynamic urls for storefront or trying to access the record in the backend with direct url.


Importing new or existing products (update) - no need to know or reference the id. The sku is enough to identify the product as it is unique.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote