- Clerk.io Help Center
- Using Clerk.io on SmartWeb / HostedShop
- Using Clerk.io in Your Store
-
Working with Clerk.io
-
Using Clerk.io on Other / Custom Platforms
-
Using Clerk.io on Shopify
-
Using Clerk.io on Magento 1
-
Using Clerk.io on Magento 2
-
Using Clerk.io on WooCommerce
-
Using Clerk.io on Prestashop
-
Using Clerk.io on BigCommerce
-
Using Clerk.io on Shoporama
-
Using Clerk.io on Shopware 6
-
Using Clerk.io on DanDomain
-
Using Clerk.io on Lightspeed
-
Using Clerk.io on SmartWeb / HostedShop
-
Using Clerk.io on DynamicWeb
-
Using Clerk.io with Any Email Client
-
Using Clerk.io with Copernica
-
Using Clerk.io with Autopilot
-
Using Clerk.io with Active Campaign
-
Using Clerk.io with Marketing Platform
-
Using Clerk.io with MailChimp
-
Using Clerk.io with MailUp
-
Using Clerk.io with Apsis
-
Using Clerk.io with UbiVox
-
Using Clerk.io with CleverReach
-
Using Clerk.io with Google Ads
-
Using Clerk.io with Act-On
-
Audience Integrations with Facebook
-
Using Clerk.io with DotDigital
-
Using Clerk.io with Klaviyo
Installing Sales-Tracking on Smartweb / HostedShop
Dynamically send orders to Clerk.io.
-
In the Smartweb Admin go to
Modules → Checkout → checkout-approved.tpl -
Insert the following Sales-Tracking code in the bottom of the file, just before the closing </div> tag.
{if !empty($page.orderId)}
{entity controller=order assign=order id=$page.orderId userId=false statusId=false}
{* Order Customer entity *}
{entity controller=orderCustomer assign=orderCustomer orderId=$page.orderId}
{* Order Lines collection *}
{collection controller=orderLine assign=orderLines orderId=$page.orderId repay=false}
{* Group order collection by class *}
{$orderList = $orderLines->groupByClass()}
{assign var=products value=''}
{if $orderLines->getActualSize() gt 0}
{if isset($orderList['CollectionOrderLine'])}
{foreach $orderList.CollectionOrderLine as $orderLine}
{$products = $products|cat:{ldelim}|cat:' "id": '|cat:$orderLine->ProductId|cat:', "quantity": '|cat:$orderLine->Amount|cat:', "price": '|cat:$orderLine->Price|cat:{rdelim}}
{if !$orderLine@last}
{$products = $products|cat:', '}
{/if}
{/foreach}
{/if}
{/if}
<span
class="clerk"
data-api="log/sale"
data-sale="{$page.orderId}"
data-email="{$orderCustomer->Email}"
data-customer="{$user->Id}"
data-products='[{$products}]'>
</span>
{/if}
4. Click Gem to save your changes.
Did this answer your question?