<commit_before><?php
/**
 * Copyright © 2016 <NAME>. All rights reserved.
 * See LICENSE.txt for license details.
 */

    /** @var \Magento\Directory\Model\Currency $currency */
    $currency = $block->getCurrencySign();
?>
<div id="logitrailFormContainer" style="width:400px;">
    <img src="<?php //echo $block->getSkinUrl('logitrail/images/loading.gif');?>" style="width: 32px;height: auto;display: block;margin: 0 auto;" id="logitrailLoader" />
    <div id="logitrailHolder"></div>

    <script type="text/javascript">
        require([ 'jquery', 'jquery/ui'], function($){
            var selectionDone = false;

            window.logitrailConfig = {
                containerId: 'logitrailHolder',
                <?php echo $block->isTestMode()?'host: "http://checkout.test.logitrail.com",':''; ?>
                bridgeUrl: '<?php echo $block->getUrl('logitrail/ajax/form'); ?>',
                success: function(logitrailResponse) {
                    var price = Number(logitrailResponse.delivery_fee);
                    span = jQuery('#s_method_logitrail_logitrail').parent().parent().find('span.price')[0];
                    jQuery(span).html('<span class="price">'+ '<?php echo $currency->getCurrencySymbol(); ?>' + price.toFixed(2) + '</span>');
                    jQuery.get('<?php echo $block->getUrl('logitrail/ajax/success');?>' + 'order_id/' + logitrailResponse.order_id
                        + /delivery_type/ + logitrailResponse.delivery_info.type
                        + '/delivery_fee/' + price, function(){
                        if(typeof logitrailSelectionDone === 'function') {
                            logitrailSelectionDone();
                        }
                    });
                    jQuery("#shipping-method-buttons-container").find(".button").prop("disabled", false);
                    selectionDone = true;
                },
                error: function(error) {
                    alert('<?php echo __('Error occured in Logitrail shipping selection.'); ?>');
                }
            };
        });<commit_msg>Fix logitrail iframe not loading when logged in before going to checkout.<commit_after><?php
/**
 * Copyright © 2016 <NAME>. All rights reserved.
 * See LICENSE.txt for license details.
 */

    /** @var \Magento\Directory\Model\Currency $currency */
    $currency = $block->getCurrencySign();
?>
<div id="logitrailFormContainer" style="width:400px;">
    <img src="<?php //echo $block->getSkinUrl('logitrail/images/loading.gif');?>" style="width: 32px;height: auto;display: block;margin: 0 auto;" id="logitrailLoader" />
    <div id="logitrailHolder"></div>

    <script type="text/javascript">
        require([ 'jquery', 'jquery/ui'], function($){
            var selectionDone = false;

            window.logitrailConfig = {
                containerId: 'logitrailHolder',
                <?php echo $block->isTestMode()?'host: "http://checkout.test.logitrail.com",':''; ?>
                bridgeUrl: '<?php echo $block->getUrl('logitrail/ajax/form'); ?>',
                success: function(logitrailResponse) {
                    var price = Number(logitrailResponse.delivery_fee);
                    span = jQuery('#s_method_logitrail_logitrail').parent().parent().find('span.price')[0];
                    jQuery(span).html('<span class="price">'+ '<?php echo $currency->getCurrencySymbol(); ?>' + price.toFixed(2) + '</span>');
                    jQuery.get('<?php echo $block->getUrl('logitrail/ajax/success');?>' + 'order_id/' + logitrailResponse.order_id
                        + /delivery_type/ + logitrailResponse.delivery_info.type
                        + '/delivery_fee/' + price, function(){
                        if(typeof logitrailSelectionDone === 'function') {
                            logitrailSelectionDone();
                        }
                    });
                    jQuery("#shipping-method-buttons-container").find(".button").prop("disabled", false);
                    selectionDone = true;
                },
                error: function(error) {
                    alert('<?php echo __('Error occured in Logitrail shipping selection.'); ?>');
                }
            };

            <?php
                $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
                $customerSession = $objectManager->create('Magento\Customer\Model\Session');
                if($customerSession->isLoggedIn()){
                    echo "Logitrail.checkout(window.logitrailConfig);";
                }
            ?>
        });
{'fraction_non_alphanumeric': 0.1579062159214831, 'fraction_numerical': 0.005234460196292257, 'mean_word_length': 2.1007437457741718, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 48, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3856040', 'n_tokens_mistral': 1294, 'n_tokens_neox': 1196, 'n_words': 211}