AgentpointNick
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Mautic Form Integrator] Passing Cookie Value of Anonymous VisitorsI managed to resolve this issue. The forms must not have kiosk mode enabled, and you want to modify the following function.
I don’t have time to figure out exactly which of the 3 mods resolves it, but hey it works.
I think it’s just the first if() statement that’s needed.function _push_mautic_form( $query, $formId )
{
if( is_array( $query ) && ! empty( $query ) && is_numeric( $formId ) ) {
$ip = _get_ip();
$query[‘return’] = get_home_url();
$query[‘formId’] = $formId;$data = array(
‘mauticform’ => $query,
);if (isset($_COOKIE[‘mtc_id’]))
$data[‘mtc_id’] = $_COOKIE[‘mtc_id’];$MauticBaseURL = get_option( ‘haw_mautic_base_url’ );
if ( $MauticBaseURL ) {
$url = $MauticBaseURL . “/form/submit?formId=” . $formId . (isset($_COOKIE[‘mtc_id’]) ? ‘&mtc_id=’.$_COOKIE[‘mtc_id’] : ”);
$response = wp_remote_post(
$url,
array(
‘method’ => ‘POST’,
‘timeout’ => 45,
‘headers’ => array(
‘X-Forwarded-For’ => $ip,
),
‘body’ => $data,
‘cookies’ => $_COOKIE
)
);