Skip to content

Commit

Permalink
Merge pull request #37 from clerkio/stubbe/ora-1196-prestashop-collec…
Browse files Browse the repository at this point in the history
…t-email-for-logged-in-users

added forced log email on every page load
  • Loading branch information
stubbedev authored Jul 24, 2024
2 parents f1d1f50 + 02202b3 commit 9823d1f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clerk.php
Original file line number Diff line number Diff line change
Expand Up @@ -2988,11 +2988,12 @@ public function hookFooter()
'clerk_language' => $this->language,
'customer_logged_in' => ($this->context->customer->logged == 1) ? true : false,
'customer_group_id' => (Customer::getDefaultGroupId((int) $this->context->customer->id) !== null) ? Customer::getDefaultGroupId((int) $this->context->customer->id) : false,
'customer_email' => $this->context->customer->email,
'currency_conversion_rate' => $currency_conversion_rate,
'currency_symbol' => Context::getContext()->currency->getSign() !== null ? Context::getContext()->currency->getSign() : '',
'currency_iso' => Context::getContext()->currency->iso_code !== null ? Context::getContext()->currency->iso_code !== null : '',
'clerk_additional_scripts' => $additional_scripts
)
)
);
$templateOutput .= $this->display(__FILE__, 'clerk_js.tpl');

Expand Down Expand Up @@ -3623,6 +3624,7 @@ public function trackingScriptContent($params)
'clerk_language' => $this->language,
'customer_logged_in' => ($this->context->customer->logged == 1) ? true : false,
'customer_group_id' => (Customer::getDefaultGroupId((int) $this->context->customer->id) !== null) ? Customer::getDefaultGroupId((int) $this->context->customer->id) : false,
'customer_email' => $this->context->customer->email,
'currency_conversion_rate' => $currency_conversion_rate,
'currency_symbol' => Context::getContext()->currency->getSign() !== null ? Context::getContext()->currency->getSign() : '',
'currency_iso' => Context::getContext()->currency->iso_code !== null ? Context::getContext()->currency->iso_code !== null : '',
Expand Down
7 changes: 7 additions & 0 deletions views/templates/hook/clerk_js.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ formatters: {
{if isset($clerk_additional_scripts)}
{$clerk_additional_scripts nofilter}
{/if}
{if isset($customer_email)}
if(typeof window.Clerk == 'function'){
Clerk('call', 'log/email', {
email: '{$customer_email}'
});
}
{/if}
</script>

<!-- End of Clerk.io E-commerce Personalisation tool - www.clerk.io -->

0 comments on commit 9823d1f

Please sign in to comment.