<!-- STARTING GENIUS REFERRALS CODE SNIPPET -->
<span class="gr-widget-design" id= "gr-referral-program-home-page-1646"> </span>
<script type="text/javascript">
!function(){
const grSetting={
"grTemplateSlug": "referral-program-home-page-",
"grCustomerCurrencyCode": "USD",
"grLanguage": "es",
"grInstallMethod":"embeddedcode"
},
e=window,t=document;e.addEventListener("load",function(){const e=t.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://e9f87d8c82343264e6ba-2977c39e5e9390b1a89ab5ed2a171102.ssl.cf1.rackcdn.com/toolbox/geniusreferrals-toolbox_3.0.0.min.js",e.onload=function(){GRToolbox.init(grSetting)};const n=t.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)},!1)}();
</script>
<!-- ENDING GENIUS REFERRALS CODE SNIPPET -->
<!-- STARTING GENIUS REFERRALS CODE SNIPPET -->
<span class="gr-widget-design" id= "gr-referral-program-home-page-1646"> </span>
<script type="text/javascript">
!function(){
const grSetting={
"grTemplateSlug": "referral-program-home-page-",
"grCustomerCurrencyCode": "USD",
"grLanguage": "es",
"grInstallMethod":"embeddedcode"
},
e=window,t=document;e.addEventListener("load",function(){const e=t.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://e9f87d8c82343264e6ba-2977c39e5e9390b1a89ab5ed2a171102.ssl.cf1.rackcdn.com/toolbox/geniusreferrals-toolbox_3.0.0.min.js",e.onload=function(){GRToolbox.init(grSetting)};const n=t.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)},!1)}();
</script>
<!-- ENDING GENIUS REFERRALS CODE SNIPPET -->
<!-- STARTING GENIUS REFERRALS CODE SNIPPET -->
<span class="gr-widget-design" id= "gr-referral-program-home-page-1646"> </span>
<script type="text/javascript">
!function(){
const grSetting={
"grTemplateSlug": "referral-program-home-page-",
"grCustomerCurrencyCode": "USD",
"grLanguage": "es",
"grInstallMethod":"embeddedcode"
},
e=window,t=document;e.addEventListener("load",function(){const e=t.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://e9f87d8c82343264e6ba-2977c39e5e9390b1a89ab5ed2a171102.ssl.cf1.rackcdn.com/toolbox/geniusreferrals-toolbox_3.0.0.min.js",e.onload=function(){GRToolbox.init(grSetting)};const n=t.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)},!1)}();
</script>
<!-- ENDING GENIUS REFERRALS CODE SNIPPET -->
<!-- STARTING GENIUS REFERRALS TRACKING CODE -->
<script type="text/javascript">
!function(){const e=window,t=document;o={
grCookieLifeTime:"180"
};e.addEventListener("load",function(){const e=t.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://e9f87d8c82343264e6ba-2977c39e5e9390b1a89ab5ed2a171102.ssl.cf1.rackcdn.com/toolbox/geniusreferrals-toolbox_3.0.0.min.js",e.onload=function(){GRToolbox.catchReferrer(o)};const n=t.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)},!1)}();
</script>
<!-- ENDING GENIUS REFERRALS TRACKING CODE -->
<!-- STARTING GENIUS REFERRALS TRACKING CODE -->
<script type="text/javascript">
!function(){const e=window,o={
"grTemplateSlug": "referral-program-home-page",
"grCustomerFirstname":"{{orderDetails.firstname}}",
"grCustomerLastname": "{{orderDetails.lastname}}",
"grCustomerEmail": "{{orderDetails.email}}",
"grCustomerCurrencyCode": "USD",
"grCanRefer": false,
"grReference" : "Order Number {{orderDetails.id}}",
"grPaymentAmount" : "{{orderDetails.total}}"
};t=document;e.addEventListener("load",function(){const e=t.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://e9f87d8c82343264e6ba-2977c39e5e9390b1a89ab5ed2a171102.ssl.cf1.rackcdn.com/toolbox/geniusreferrals-toolbox_3.0.0.min.js",e.onload=function(){GRToolbox.processCustomerAndBonus(o).then(e=>{})};const n=t.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)},!1)}();
</script>
<!-- ENDING GENIUS REFERRALS TRACKING CODE -->
$this->load->model('checkout/order');
$order_id = $this->session->data['order_id'];
$data['firstname'] = $this->session->data['firstname'];
$data['lastname'] = $this->session->data['lastname'];
$data['email'] = $this->session->data['email'];
$order_data = $this->model_checkout_order->getOrder($order_id);
$sub_total = '0';
foreach ($this->model_checkout_order->getOrderTotals($order_id) as $total) {
if ($total['code'] = 'sub_total') {
$sub_total = $total['value'];
}
}
$orderDetails = array(
"id" => $order_data['order_id'],
"total" => $sub_total,
"email" => $data['email'],
"firstname" => $data['firstname'],
"lastname" => $data['lastname'],
);