X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   General questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=66)
-   -   Product ID (https://forum.x-cart.com/showthread.php?t=78178)

Dawn Howard 03-13-2021 06:14 AM

Product ID
 
Having recently switched from Xcart 4 to Xcart 5, I'm struggling to understand the role of Product ID in Xcart 5. Note, out internal CRM is not linked to Xcart.

In 4, when I added new products, I did so by import to control the Product ID name, and match it with the SKU. Otherwise, the Product ID would be randomly generated. Matching Product ID and SKU make future product updates via import easier.

In 5, the Product ID is randomly generated again when adding a new product manually, but it doesn't seem to be a required field for import, only SKU. So I'm thinking I no longer need to worry about them matching.

Is there something I might be missing? I add new products regularly, and would like to update several of them at once in the future using import. I don't want Product ID to be an issue.

Thanks in advance!

cflsystems 03-13-2021 09:16 AM

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.

Dawn Howard 03-15-2021 06:20 AM

Re: Product ID
 
Thank you, that is very helpful! Can I add new products with a CSV and choose the Product ID, like I was able to in xcart 4? What is the import field called? It was "!productid" in X4

Dawn Howard 03-15-2021 06:21 AM

Re: Product ID
 
Also, can I export products and include the Product ID as a column?

cflsystems 03-15-2021 06:25 AM

Re: Product ID
 
No and no. Unless you have custom module to extend the stock behavior and process ids


All times are GMT -8. The time now is 04:08 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.