Skip to content

Instantly share code, notes, and snippets.

{% if order.email != "EMAIL" %}
/// Content of the page.
{% endif %}
{% if customer %}
Código que quieres mostrar a tus clientes logeados.
{% endif %}
{% if customer %}
Precio: {{product.price | price}}
{% else %}
<a href="/customer/login">Regístrate para poder comprar</a>
{% endif %}
function hideShow(){
if($("#order_shipping_address_region").val() == "12"){
$("#shipping_options input[value='143029']").parent().siblings().hide();
$("#shipping_options input[value='143029']").parent().show();
$("#shipping_options input[value='143029']").click();
}else{
$("#shipping_options input[value='143029']").parent().siblings().show();
$("#shipping_options input[value='143029']").parent().hide();
$("#shipping_options input[value='144303']").click();
}
var remove_payment = function(data) {
var order_product_id = payment_cost_order_product_id(data);
Jumpseller.updateCart(order_product_id, 0); // no payment cost on the order.
}
function payment_cost_order_product_id(cart_json) {
var id = null;
$.each(cart_json.products, function(i, order_product) {
if (order_product.product_id == productId) { // product for adding payment cost. You need to create a virtual product with the additional price. The ID is the number in the URL of the product in the admin panel.
function autocomplete(value,input){
var interval = setInterval(function(){
console.log("#"+input)
if($("#"+input).text()){
$("#"+input).val(value);
clearInterval(interval);
}
}, 500)
}
<script type="application/ld+json">
{
"@context": "http://schema.org/"
{% case template %}
{% when 'product' %},
"@type": "Product",
"name": "{{product.name | escape}}",
"url": "{{store.url}}{{product.url}}",
"itemCondition": "http://schema.org/NewCondition",
{% if product.sku != blank %}"sku": "{{product.sku}}",{% endif %}
<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.
/* Fields that can be marked as optional in Settings > Checkout */
function justHide(field) {
$("#billing_address_" + field).hide();
}
$(document).ready(function() {
// Postal Code
justHide("postal");