Skip to content

Commit

Permalink
Add UTM suggestions apps for buy now button
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed May 29, 2018
1 parent e0b8fe1 commit 9f3dec6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions app/Http/Controllers/Modules/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ public function show($alias)
}
}

if (request()->get('utm_source')) {
$parameters = request()->all();

$character = '?';

if (strpos($module->action_url, '?') !== false) {
$character = '&';
}

$module->action_url .= $character . http_build_query($parameters);
}

return view('modules.item.show', compact('module', 'about', 'installed', 'enable'));
}

Expand Down
2 changes: 1 addition & 1 deletion resources/views/partials/admin/content.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@if ($suggestion_modules)
@foreach($suggestion_modules as $s_module)
<span class="new-button">
<a href="{{ url($s_module->action_url) }}" class="btn btn-default btn-sm" target="{{ $s_module->action_target }}"><span class="fa fa-rocket"></span> &nbsp;{{ $s_module->name }}</a>
<a href="{{ url($s_module->action_url) . '?' . http_build_query((array) $s_module->action_parameters) }}" class="btn btn-default btn-sm" target="{{ $s_module->action_target }}"><span class="fa fa-rocket"></span> &nbsp;{{ $s_module->name }}</a>
</span>
@endforeach
@endif
Expand Down

0 comments on commit 9f3dec6

Please sign in to comment.