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
<script> | |
var verify_document = function() { | |
if ($("#order_other_documento_electronico option:selected").val() == "Factura Electronica") { | |
$("#other_giro").show() | |
$("#order_other_giro").attr("required", "required") | |
$("#other_razon_social").show() | |
$("#order_other_razon_social").attr("required", "required") | |
} else { |
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
<!-- Requires adaptation to the Theme --> | |
<div class="post-prev-text align-center"> | |
{% if product.discount > 0 %} | |
<strong>{% t "From" %} </strong>{{ product.price | minus:product.discount | price }} <del> {{ product.price | price }}</del> | |
{% else %} | |
{% assign variant_prices = product.variants | sort: 'price' | map: 'price' %} | |
{% if variant_prices.size > 1 %} | |
<strong>{{ variant_prices | first | price }} - {{ variant_prices | last | price }}</strong> | |
{%else%} | |
{{product.price | price}} |
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
<div id="alerta" class="alert alert-info" role="alert"> | |
<strong>Heads up!</strong> This alert needs your attention, but it's not super important. | |
</div> | |
<script> | |
var alert_checkout = function(){ | |
if($("#order_shipping_address_region").val() == "01"){ | |
$("#alerta").show() | |
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
<script> | |
// Variables | |
var productId = 4482829 // Create virtual product and get the product id | |
var variant1 = 8769517 // Create a variant of the product, this is the variant that will go to the cart. | |
// Conditions Function: This function returns true or false depending if the conditions are present or not on the checkout. This part can change depending on the conditions. | |
var conditions = function(){ | |
return $("#payments_options input:checked").val() == "186648"; // Certain payment option is selected on this example | |
} |
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
<script> | |
$(document).ready(function(){ | |
const queryString = window.location.search; | |
var decodedString = decodeURIComponent(queryString) | |
console.log(decodedString.slice(1)); | |
$("#contact_message").val(decodedString.slice(1)); | |
}); | |
</script> |
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
{% if order.subtotal < 100 %} | |
<script> | |
// Add this to your checkout block. Change the minimum from 100 to your desired number. Use a large number to block all purchase, change to 0 to block none | |
// Design your message | |
var message = '<i class="fa fa-info-circle fa-fw"></i>There is a minimum order required of <strong>100 USD</strong>' | |
var alert_m = '<div align="middle" id="alert-minimum" class="text-center alert alert-warning m-0">' + message + '<br><a onclick="history.go(-1); return false;" href="#" class="btn btn-sm btn-secondary mt-2" title="← {% t 'Go back & Keep Shopping' %}">← {% t "Go back & Keep Shopping" %}</a></div>' | |
$(document).ready(function(){ | |
$("#checkout").before(alert_m) |
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
/* Fields that can be marked as optional in Settings > Checkout */ | |
function justHide(field){ | |
$("#shipping_address_" + field).hide(); | |
} | |
$(document).ready(function(){ | |
// Postal Code | |
justHide("postal"); |
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
/* Fields that can be marked as optional in Settings > Checkout */ | |
function justHide(field) { | |
$("#billing_address_" + field).hide(); | |
} | |
$(document).ready(function() { | |
// Postal Code | |
justHide("postal"); |
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
<script> | |
// Define the shipping method for the local region (metropolitana) and for all others. | |
let metropolitana = 267131 | |
let others = "22276-service" | |
// Function verifies if customer selected the local region (Metropolitana). | |
function metropolitanaIsSelected() { | |
return $.inArray($.trim($("#order_shipping_address_region option:selected").text()), ["Metropolitana"]) > -1; | |
}; | |
// Function to hide/show the correct local method. |