Skip to content

Instantly share code, notes, and snippets.

@walkirien
walkirien / subcategories.liquid
Created March 31, 2021 15:54
Subcategories in Category Page in Jumpseller
<div class="row">
{% for category in category.subcategories %}
<div class="col-md-3 col-6 mb-3">
<a href="{{category.url}}">
{% if category.images.first != blank %}
<img src="{{category.images.first | thumb: '255x255'}}" alt="{{category.name}}" class="img-fluid mb-2" />
{% else %}
<img src="{{'demo-test.jpg' | asset }}" alt="{{category.name}}" class="img-fluid mb-2" />
{%endif%}
@walkirien
walkirien / phone_number_normalization.liquid
Last active February 22, 2022 02:55
Phone number Normalization for Jumpseller Checkout
<!--Copy this code at the end of the Checkout Layout-->
<script>
$(document).ready(function(){
// Restrict to only numbers
$('#order_customer_phone').keypress(function(tecla){
if(tecla.charCode < 48 || tecla.charCode > 57) { return false;}
});
//Phone format
$("#order_customer_phone").attr("maxlength", "8").attr("minlength", "8"); // Change the number according to what you need
$("#order_customer_phone").attr("placeholder", ""); // you can add a format example
{%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 %}
{%assign min_price = variant.price %}
{% endif %}
{%endfor%}