Problems displaying cards in user profile

WordPress
5 June, 2020 18:22:21
Topics: 3
Messages: 6
Hello,

Thanks for our plugin it work great but i have a problem displaying my card :

My settings :
CMS : WordPress - Latest version
Theme: Divi - Latest Release
Dedicated hosting provider with Plesk interface.
Database: phpmyadmin (MariaDB)

Plugin:
- Woocommerce : It allows to manage our products : 3 products (adult/child).
- Gravity Forms : The plugin allows users to register on the site.
• One form per beneficiary: Linked to an E2PDF card (*3) This form is filled in by the PAYERS and allows to register a new beneficiary on the site.
• A registration form for payors
- Ultimate Members: The plugin is used to create the member areas on the site. We have two types of profiles: Payer and Beneficiary.
- E2PDF : I used your to generate the cards for the beneficiaries. We MUST have one card per beneficiary. This card takes into account the information entered during the registration of the beneficiary and it enters a conditional according to the product chosen by the payer for his beneficiary.

Please note the following:
We display the card on the beneficiary's profile. He or she should only see HIS card. The card is displayed via a custom tab implemented using Ultimate Members and a "do_shortcode" function in the child theme (functions.php).

We use the shortcode provided by E2PDF : [e2pdf-download] to allow the user to export his card.

Our goal:
Display the card to the beneficiary and display all the cards to the payer who has registered his beneficiaries. The beneficiary must therefore see only 1 card: HIS card. The payer must therefore see all the cards of the beneficiaries he has registered.

Our problem:
- We can't pass any DYNAMIC argument in the custom value (arg) of E2PDF (Documentation: https://e2pdf.com/support/docs) in the [e2pdf-download] shortcode. So we don't know how to retrieve variables through this shortcode.
- The dataset table of the E2PDf plugin in the database doesn't return any information. It's completely empty when it should contain the card data, right? We have a doubt about the function of the dataset (we have this link with explanations : https://e2pdf.com/support/desk/tempalte-tags-definition-and-what-they-do)

Would you have more information about how your plugin works to help us achieve our goal? Because i don’t finf the information in our documentation.

Thank you,
6 June, 2020 07:20:56
E2Pdf
Support
Topics: 7
Messages: 3346
Hi,

Were you able to setup export shortcode for the beneficiary to output only HIS card? If yes, do your template connected to Gravity Forms and using its entries to export? or your Template connected to WordPress and it's used [e2pdf-user] shortcodes inside Template?

"dataset" - attribute is used to define for which entry it must be generated download link and it's depending to which extension and item is connected your E2Pdf Template.

For example:

If Template connected to "Gravity Forms" extension and item is set to its form then dataset must be Gravity Forms submitted Entry ID to this form: [e2pdf-download id="1" dataset="308"] (screenshot 1)

If Template connected to "WordPress" extension and item is set to "Pages" then dataset must be WordPress Page ID: : [e2pdf-download id="1" dataset="1435"] (screenshot 2)

- So if your Gravity Forms contains all needed information, and your E2Pdf Template connected to it directly, you will need to retrieve all entries submitted by currently logged in user which looks like possible to do via: https://docs.gravityforms.com/api-functions/#get-entries


$search_criteria['field_filters'][] = array( 'key' => 'created_by', 'value' => $current_user->ID );


After getting all entries you must be able to iterate over all entries submitted by current user and get 'id' of each entry which must be inserted as attribute inside do_shortcode('[e2pdf-download id="1" dataset="'.$entry_id.'"]'); shortcode.

- If you connected E2Pdf Template to WordPress extension and using exactly data from meta fields with [e2pdf-user] shortcode, you can set "dataset" static to any Post ID/Page ID depending to which item your Template connected but "user_id" in this case must be dynamic and also must be retrieved dynamically depending on how you linked beneficiaries to payers so E2Pdf can know for which user it must be created PDF Link and shortcode will look like: do_shortcode('[e2pdf-download id="1" dataset="1" user_id="'.$user_id.'"]');

We remain at your service.
We would really appreciate your feedback at WordPress.org!