Skip to content

Instantly share code, notes, and snippets.

<script>
$(document).ready(function(){
$('<div class="form-group"><div style="margin-top: 16px;" id="contactpage_custom" class="field"><label for="contactpage_custom" class="control-label">Empresa</label><br><input type="text" name="contact[custom]" id="contact_pcustom" class="text form-control"></div></div>').insertAfter("#contactpage_name")
});
$("#contact_form").submit(function(){
$("#contact_message").val("Empresa: "+ $("#contact_pcustom").val() + "\n" + $("#contact_message").val())
});
</script>
// This example will remove all Regions that are not "12" and all Municipalities not listed below.
var shipping_to = ["Cerrillos","Cerro Navia","Conchali","El Bosque","Estacion Central","Huechuraba","Independencia","La Cisterna","La Florida","La Granja","La Pintana","La Reina","Las Condes","Lo Barnechea","Lo Espejo","Lo Prado","Macul","Maipu","Ñuñoa","Padre Hurtado","Pedro Aguierre Cerda","PeÑAlolen","Providencia","Pudahuel","Puente Alto","Quilicura","Quinta Normal","Recoleta","Renca","San Bernardo","San Joaquin","San Miguel","San Ramon","Santiago Centro","Vitacura"]
function removeItems(select,shipping_to){
$('#' + select +' option:not(:first)').filter(function() {
return $.inArray($.trim($(this).text()), shipping_to) == -1;
}).remove();
};
$("#order_shipping_address_region").change(function(){
<script>
$(document).ready(function(){
$('#other_razon_social, #other_giro').hide();
})
$('#order_other_boleta_o_factura').on('change', function() {
var option = $("#order_other_boleta_o_factura option:selected").val();
if(option == 'Factura Electrónica'){
$('#other_razon_social, #other_giro').show();
{%assign min_price = product.price %}
{%assign max_price = product.price %}
{% for variant in product.variants %}
{% if max_price < variant.price %}
{%assign max_price = variant.price %}
{% endif %}
{% if min_price > variant.price %}
<script>
var paymentId = 105935 // replace the id for the payment ID (last number on payment URL in admin panel, Ex: https://www.evernote.com/l/AJrfSyLBf_FNeo2o4Zhsw4jOUclx150s4OQ ) )
$(document).ready(function(){
$("input[value=" + paymentId + "]").parent().hide()
});
</script>
// Step 1: Create a virtual Product Called "Envio a Cobranza" with two Variants: Portugal/Spain
// Step 2: Get the Product and variants IDs
// Step 3: replace the following variables with the Product ID (in the product settings URL), Variant Ids (see tip below) and Manual Payment ID (In the payment method URL in the admin panel)
var productId = "2388937"
var portugalId = "1883423"
var spainId = "1883423"
var paymentId = "136033"
/* TIP: To get the variant ID of the countries I added this code to the product page and checked the console
<style>
.pop-up_canvas {
background: #e65f5f;
z-index: 9998;
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
display: none;
<script>
var payment = "99578"
$(document).ready(function(){
$("#order_payment_method_" + payment).parent().attr('id', 'top');
$("#order_payment_method_" + payment).parent().parent().attr('id', 'payments_ul');
$("#top").prependTo("#payments_ul");
$("#order_payment_method_" + payment).click();
});
</script>
<!-- Instagram widget -->
<div class="col-12"><h2>{% t 'Instagram' %}</h2></div>
<div id="instagram" class="col-12"></div>
<!-- Instagram script -->
<script>
$.ajax({
url: "https://js-instagram-proxy.herokuapp.com/{{social.instagram_url | replace: "https://www.instagram.com/", "" }}/media",
dataType: "jsonp",
data: {
/*!
* Age verification CSS to go with the JS that can be found at (https://github.com/Herudea/age-verification)
*/
#modal_screen {
position: fixed;
top:0;
left: 0;
height: 100%;
width: 100%;