GravityPDF / gravity-pdf

Gravity PDF is a GPLv2-licensed WordPress plugin that allows you to automatically generate, email and download PDF documents using Gravity Forms.
https://gravitypdf.com
88 stars 21 forks source link

Add Entry Meta as PDF Conditional Logic Options #1404

Closed jakejackson1 closed 5 months ago

jakejackson1 commented 1 year ago

Description There are a number of missing conditional options missing from Gravity PDF's Conditional Logic feature that can be found on the Entry List search list. For example, we are unable to disable PDFs if the Payment Status isn't set to "Paid".

Expected behavior To be able to add conditional logic on this meta data.

Screenshots

Screen Shot 2022-08-19 at 4 13 38 pm
jestonihpi commented 1 year ago

Quick updates @jakejackson1. I tried to add some sample edit in our conditional logic : image

jakejackson1 commented 1 year ago

This JS hook would be the ideal candidate: https://docs.gravityforms.com/gform_conditional_logic_fields/

After reviewing the entry options available, here's what we want to ideally support:

jestonihpi commented 1 year ago

Copy @jakejackson1, I was actually using that snippet for that sample. My initial idea is to parse some php code inside that js loop. I also checking out the actual entry search class hoping for some ideas among other places.

jakejackson1 commented 1 year ago

@jestonihpi here's a leg up https://github.com/GravityPDF/gravity-pdf/pull/1405

I've opted to focus only on the payment status and payment amount values right now, as they are most important items for PDFs. I haven't verified Gravity Forms correctly takes the saved PDF conditional logic and pass/fails the entry based on the new settings. We may need to write additional code to ensure these checks are done correctly.

jestonihpi commented 1 year ago

Copy @jakejackson1.

jestonihpi commented 1 year ago

Hi @jakejackson1 , I have tested this update on my end and one thing I have noticed that its not consistent in terms of saving the conditions ( sometimes it does,sometimes it just reverted back to Name with an empty value and default operator ). I am using GravityForm CLI to manipulate the meta values for this tests.

jakejackson1 commented 1 year ago

@jestonihpi I might need to do a screen sharing session with you to see exactly how to replicate this.