Created
December 6, 2018 19:03
-
-
Save aatronco/26fa5df34c221b93472f8f29426f3f3d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function hidePayments(){ | |
| chile = $("#order_shipping_address_country").val() == "CL"; | |
| if(!chile){ | |
| $.each($('#payments_options input'), function(index, element){ | |
| element = $(element) | |
| if(element.val() != '74858'){ | |
| element.parent().hide() | |
| }else{ | |
| element.parent().show() | |
| $("#payments_options input[value='74858']").click(); | |
| } | |
| } ) | |
| }else{ | |
| $.each($('#payments_options input'), function(index, element){ | |
| element = $(element) | |
| if(element.val() != '74858'){ | |
| element.parent().show() | |
| }else{ | |
| element.parent().show() | |
| $("#payments_options input[value='74858']").click(); | |
| } | |
| } ) | |
| } | |
| } | |
| $(document).ready(function(){ | |
| var interval = setInterval(function(){ | |
| if($("#order_shipping_address_country").val()){ | |
| hidePayments(); | |
| clearInterval(interval) | |
| }}, 200) | |
| }); | |
| $("#checkout").change(function(){ | |
| hidePayments(); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment