<script type="text/javascript">/* * 2007-2016 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <contact@prestashop.com> * @copyright 2007-2016 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ function updateFormDatas() { var nb = $('#quantity_wanted').val(); var id = $('#idCombination').val(); $('#paypal_payment_form input[name=quantity]').val(nb); $('#paypal_payment_form input[name=id_p_attr]').val(id); } $(document).ready( function() { if($('#in_context_checkout_enabled').val() != 1) { $('#payment_paypal_express_checkout').click(function() { $('#paypal_payment_form').submit(); return false; }); } $('#paypal_payment_form').live('submit', function() { updateFormDatas(); }); function displayExpressCheckoutShortcut() { var id_product = $('input[name="id_product"]').val(); var id_product_attribute = $('input[name="id_product_attribute"]').val(); $.ajax({ type: "GET", url: baseDir+'/modules/paypal/express_checkout/ajax.php', data: { get_qty: "1", id_product: id_product, id_product_attribute: id_product_attribute }, cache: false, success: function(result) { if (result == '1') { $('#container_express_checkout').slideDown(); } else { $('#container_express_checkout').slideUp(); } return true; } }); } $('select[name^="group_"]').change(function () { setTimeout(function(){displayExpressCheckoutShortcut()}, 500); }); $('.color_pick').click(function () { setTimeout(function(){displayExpressCheckoutShortcut()}, 500); }); if($('body#product').length > 0) setTimeout(function(){displayExpressCheckoutShortcut()}, 500); var modulePath = 'modules/paypal'; var subFolder = '/integral_evolution'; var baseDirPP = baseDir; var fullPath = baseDirPP + modulePath + subFolder; var confirmTimer = false; if ($('form[target="hss_iframe"]').length == 0) { if ($('select[name^="group_"]').length > 0) displayExpressCheckoutShortcut(); return false; } else { checkOrder(); } function checkOrder() { if(confirmTimer == false) confirmTimer = setInterval(getOrdersCount, 1000); } }); </script>