1/** 2* 2007-2017 PrestaShop 3* 4* NOTICE OF LICENSE 5* 6* This source file is subject to the Academic Free License (AFL 3.0) 7* that is bundled with this package in the file LICENSE.txt. 8* It is also available through the world-wide-web at this URL: 9* http://opensource.org/licenses/afl-3.0.php 10* If you did not receive a copy of the license and are unable to 11* obtain it through the world-wide-web, please send an email 12* to [email protected] so we can send you a copy immediately. 13* 14* DISCLAIMER 15* 16* Do not edit or add to this file if you wish to upgrade PrestaShop to newer 17* versions in the future. If you wish to customize PrestaShop for your 18* needs please refer to http://www.prestashop.com for more information. 19* 20* @author PrestaShop SA <[email protected]> 21* @copyright 2007-2017 PrestaShop SA 22* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 23* International Registered Trademark & Property of PrestaShop SA 24* 25* Don't forget to prefix your containers with your own identifier 26* to avoid any conflicts with others containers. 27*/ 28 29$(document).ready(function () { 30 var hide_others = false; 31 32 /********* PS 1.7 ******************/ 33 var payment_forms = $("form#payment-form"); 34 payment_forms.each(function(index) { 35 var aux = $(this).attr('action'); 36 if (aux && is_seur_cod(aux)) { 37 hide_others = true; 38 } 39 }); 40 payment_forms.each(function(index) { 41 var aux = $(this).attr('action'); 42 if (aux && hide_others && is_cod(aux)) { 43 $('#payment-option-'+eval(index+1)+'-container').hide(); 44 } 45 }); 46 47 /******** PS 1.6 ********************/ 48 var payment_modules = $(".payment_module"); 49 payment_modules.each(function(index) { 50 var aux = $(this).find('a').attr('href'); 51 if (aux && is_seur_cod(aux)) { 52 hide_others = true; 53 } 54 }); 55 payment_modules.each(function(index) { 56 var aux = $(this).find('a').attr('href'); 57 if (aux && hide_others && is_cod(aux)) { 58 $(this).hide(); 59 } 60 }); 61 62 /******* common functions **********/ 63 function is_seur_cod(aux) { 64 return aux.search('seurcashondelivery') != -1; 65 } 66 67 function is_cod(aux) { 68 return (aux.search('cod') !== -1 || 69 aux.search('cashondelivery') !== -1 || 70 aux.search('reembolso') !== -1 ) && 71 (aux.search('seurcashondelivery') == -1); 72 } 73});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.