We recently updated to C&P v 3.700.008, and just noticed that the order number would be populated in the email notification that is sent out on the form submission, however when resending an email notification that is using an {order_number} merge tag from the Notifications panel on the Gravity Forms Entries page, the {order_number} is blank. We traced this back to the following:
Here is a snippet from the Gravity Forms forms_model.php
So when C&P runs this:
Line 784 of the above GFCnpPlugin is blank since Gravity Forms does not save into a field named 'order_number', instead they save to a field named 'transaction_id' as you can see in the Gravity Forms code from the forms_model.php.
Here is a screenshot from our Gravity Forms Database, note there is no 'order_number' field, just the 'transaction_id' field:

We changed the following line in class.GFCnpPlugin.php from:
to:
And our resend notifications worked again by populating the {order_number} merge tag correctly. Please fix this as we don't want to have to modify the plugin code directly to achieve proper functionality. Thank you.
Here is a snippet from the Gravity Forms forms_model.php
Code:
Gravity Forms v2.4.14 (forms_model.php) line 2635 /** * Save Entry to database. * * @since 2.4.8.13 Updated created_by property to save as an empty value when undefined. * @since Unknown * * @param array $form Form object. * @param array $entry Entry object. */ public static function save_entry( $form, &$entry ) { ... line 2726 $entry = array( 'id' => (string) $lead_id, 'status' => 'active', 'form_id' => (string) $form['id'], 'ip' => $ip, 'source_url' => $source_url, 'currency' => $currency, 'post_id' => null, 'date_created' => $current_date, 'date_updated' => $current_date, 'is_starred' => 0, 'is_read' => 0, 'user_agent' => $user_agent, 'payment_status' => null, 'payment_date' => null, 'payment_amount' => null, 'payment_method' => '', 'transaction_id' => null, 'is_fulfilled' => null, 'created_by' => (string) $user_id, 'transaction_type' => null, );
Code:
C&P v 3.700.008 class.GFCnpPlugin.php /** 768 * replace custom merge tags 769 * @param string $text 770 * @param array $form 771 * @param array $lead 772 * @param bool $url_encode 773 * @param bool $esc_html 774 * @param bool $nl2br 775 * @param string $format 776 * @return string 777 */ 778 779 public function gformReplaceMergeTags($text, $form, $lead, $url_encode, $esc_html, $nl2br, $format) { 780 if ($this->hasFieldType($form['fields'], 'creditcard')) { 781 if (is_null($this->txResult)) { 782 // lead loaded from database, get values from lead meta 783 /*$transaction_id = isset($lead['transaction_id']) ? $lead['transaction_id'] : '';*/ 784 $order_number = isset($lead['order_number']) ? $lead['order_number'] : '';
Here is a screenshot from our Gravity Forms Database, note there is no 'order_number' field, just the 'transaction_id' field:
We changed the following line in class.GFCnpPlugin.php from:
Code:
784 $order_number = isset($lead['order_number']) ? $lead['order_number'] : '';
Code:
784 $order_number = isset($lead['transaction_id']) ? $lead['transaction_id'] : '';
Comment