How to provide a unique ID number per member (paid memberships pro)

WordPress
19 November, 2022 03:50:58
moniq
Topics: 1
Messages: 2
FIRST PART

Want a fixed 4 digit unique ID # per member: nnnn-2022
Used in all member products (created by E2PDF) e.g. ID Card shown.

Value: ID# [e2pdf-wp key="pods_id"]-[e2pdf-format-date format="Y"][e2pdf-wp key="post_date"][/e2pdf-format-date]

I do not know how to create a unique ID number in PODS. So I am wondering if WordPress (or something) can generate a reliable one that will not be re-generated when the user changes or updates their member plan.

- If I use [e2pdf-user key="ID"] it provides a single digit number and is listed in both member and wp user lists. (If I update member plan, will the # change? I can't recall right now but I think when trying out Member Press the number changed.)
- If I use [e2pdf-wp key="id"] it provides a 4 digit number I want, but what is generating it? I cannot find the root so I don't trust it won't change later on. It has to be fixed per user. (Maybe it was this one that changed when I updated my testuser member plan).

SECOND PART

Like to place your bar code on E2PDFs, e.g. document label shown. How can I add a value such as a URL link to a verification web page:
- page has a E2PDF viewer window displaying that is then populated with the users data
- according to the users id number in the URL - generates this without logging in to the site, e.g. URL/verificationpage?nnnn-2022

Any help is appreciated.
Thank you.
19 November, 2022 06:50:09
E2Pdf
Support
Topics: 7
Messages: 2734
Hi,

1. Some explanation:
Value: ID# [e2pdf-wp key="pods_id"]-[e2pdf-format-date format="Y"][e2pdf-wp key="post_date"][/e2pdf-format-date] - Is related to the Page / Post where E2Pdf shortcode placed. It has nothing related to the user.

[e2pdf-wp key="id"] - is also related to the Page / Post and outputs the ID of Page / Post where the E2Pdf shortcode is placed.

So above shortcodes look like not what you need, however:

[e2pdf-user key="ID"] - is the output of the ID of the logged-in user, it's unique and didn't change after the user registered.

You can also format it with 4 numbers:

[e2pdf-format-output sprintf="%04d"][e2pdf-user key="ID"][/e2pdf-format-output]

For User ID with ID 1 it will output 0001, for User ID with ID 173 it will output 0173, for User ID with 31234 it will output 31234.

However, you need to keep in mind that it's an incremental value, and if you will pass it directly to the URL, anyone will be able to change it manually...

2. As for "barcodes" - they are more designed for numbers output and for barcode readers, has a limited length and limited characters which can be used, so it seems you need to use "QR Code" instead, which can have an URL:

The "Value" of QR Code can be set as: https://example.com/verification/?id=[e2pdf-format-output sprintf="%04d"][e2pdf-user key="ID"][/e2pdf-format-output]

On the "verification" page you will need to place custom designed shortcode, which will parse the "id" parameter and will generate E2Pdf shortcode via PHP, something as:

$user_id = (int) $_GET['id'];
if ($user_id) {
echo do_shortcode('[e2pdf-view id="1" dataset="123" user_id="' . $user_id . '"]');
}

* where "1" is the ID of the E2Pdf Template and "123" is the Page ID of the Post Type to which the E2Pdf Template connected, usually, it can be found at "E2Pdf" -> "Export".

We remain at your service.
We would really appreciate your feedback at WordPress.org!
26 November, 2022 14:45:43
moniq
Topics: 1
Messages: 2
Absolutely amazing. Thank you. I will pass this on to our team.