Skip to content
This repository was archived by the owner on Nov 2, 2022. It is now read-only.

Commit f3fa2ba

Browse files
committed
GFDibsHook::dibsTransition(), ny parameter ordertext
1 parent 6c72913 commit f3fa2ba

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

GFDibsHook.php

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ public static function changeColumnData($value, $lead_id, $index, $Entry){
9393
$Transaction = $Dao->getTransactionByLeadId($Entry['id']);
9494
$value = $Transaction->transaction_id;
9595
}
96+
else if ( $index == 'order_id'){
97+
$Dao = new GFDibsDao();
98+
$Transaction = $Dao->getTransactionByLeadId($Entry['id']);
99+
$value = $Transaction->order_id;
100+
}
96101
else if ( $index == 'payment_status'){
97102
$Dao = new GFDibsDao();
98103
$Transaction = $Dao->getTransactionByLeadId($Entry['id']);
@@ -199,7 +204,6 @@ public static function dibsTransition($confirmation, $form, $lead, $ajax){
199204
$Dao = new GFDibsDao();
200205
_log('GFDibsHook::dibsTransition()');
201206

202-
203207
if ( $feed_id = $Dao->isDibsForm($form['id']) ){
204208
$feed = $Dao->getDibsMeta($feed_id);
205209

@@ -250,10 +254,24 @@ public static function dibsTransition($confirmation, $form, $lead, $ajax){
250254
if ( $key == 'billingEmail' ){
251255
$_POST['email'] = $_POST[$key];
252256
}
253-
254257
}
255258
}
256259

260+
// set ordertext
261+
$_POST['ordertext'] = null;
262+
if ( isset($_POST['billingFirstName']) ){
263+
$_POST['ordertext'] .= $_POST['billingFirstName']." ";
264+
}
265+
if ( isset($_POST['billingLastName']) ){
266+
$_POST['ordertext'] .= $_POST['billingLastName']." ";
267+
}
268+
269+
if ( isset($_POST['email']) ){
270+
$_POST['ordertext'] .= "(".$_POST['email'].")";
271+
}
272+
$_POST['ordertext'] = trim($_POST['ordertext']);
273+
274+
257275
// $_POST['orderId'] = hexdec(uniqid());
258276
$_POST['leadId'] = $lead['id'];
259277

@@ -303,7 +321,7 @@ public static function dibsTransition($confirmation, $form, $lead, $ajax){
303321
$Dao->log($transaction_id);
304322

305323

306-
$confirmation = '<form action="'.get_option(DIBS_POST_URL).'" name="dibs_post_form" id="dibs_post_form" method="post" >';
324+
$confirmation = '<form action="'.get_option(DIBS_POST_URL).'" name="dibs_post_form" id="dibs_post_form" method="post" accept-charset="utf-8" >';
307325
foreach ($_POST as $key => $value) {
308326
if ( !is_numeric(strpos($key, 'input')) && !is_numeric(strpos($key, 'MAX_FILE_SIZE')) && !is_numeric(strpos($key, 'state')) && !is_numeric(strpos($key, 'gform')) ){
309327
$confirmation .= sprintf('<input type="hidden" name="%s" id="%s" value="%s" />', $key, $key, $value );

gravityformsdibs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Gravity Forms DIBS
44
Plugin URI: http://nettbutikk.mediebruket.no
55
Description: DIBS add-on for Gravity Forms. Supports D2 and DX platform.
6-
Version: 1.2.1
6+
Version: 1.2.2
77
Author: Mediebruket
88
Author URI: http://mediebruket.no
99
*/

0 commit comments

Comments
 (0)