How to assign unique Numeric ID's

In my listing website, vendors, customers and affiliates have profiles. Vendor listing shows product offerrings, customers shows user profile, and affiliates also shows user profile and all 3 have have respective categories.

I want to create a system where each listing, customer profile, and affiliate profile will have a unique numeric ID — for example:

  • Listing A = ID 000001
  • Listing B = ID 000002
  • Customer or Affiliate = ID 000003, and so on.

These IDs will help keep everything organized and easy to track in the listing theme — including vendor services, customer accounts, and affiliate accounts.

How can I set this up?

Hi,

Please note that listings and vendors have a unique ID. If you are familiar with the code, we can provide general guidance.

Thanks for the reply.

So if there is a unique ID already given to listings and vendors…

  1. Is it only numeric? or can be made Alpha-Numeric too?
  2. Can the ID series be changed? e.g. I need a different series for the listing like e.g. “L00001” and “V00001” for vendors.
  3. I can get the code done, if you guide.

Thanks

Yes, both vendors and listings are stored in wp_posts table and each entry has a numeric ID. Depending on how you output this ID, you can add a letter before the number if needed. If you’re familiar with code customizations, please try using this sample code snippet as a starting point Unique number or ID - #8 by yevhen

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.