Skip to content

Instantly share code, notes, and snippets.

View ronipl's full-sized avatar
🏠
Working from home

roni ronipl

🏠
Working from home
View GitHub Profile
@ronipl
ronipl / product-search-gql.js
Last active July 14, 2020 04:26
Product search using graphql
<script>
(function($){
$(document).ready(function(){
var apiUrl = "https://yourshop.myshopify.com/api/graphql";
var token = "tokenhere";
customProductSearch(
apiUrl,
token,
@ronipl
ronipl / variant-collection.liquid
Last active August 11, 2020 16:28
Adding variant selection in collection page - shopify
//Product grid
<div id="product-colors-{{product.id}}" class="product-colors">
{% capture variant_data %}
{% for variant in product.variants %}
{{ variant.option1 | escape | handleize | remove: "-amp"}}|{{variant.id}}
{% if forloop.last == false %}::{% endif%}
{% endfor %}
{% endcapture %}
@ronipl
ronipl / collection-filter-sort.js
Created August 11, 2020 16:31
Cusom collection filter - shopify
//Collection page
// Start of filter
var grid_view_items = $('.grid--view-items');
var grid_product = $(grid_view_items).find('.grid__item');
var $filterCheckboxes = $('input[type="radio"].collection-filter');
$filterCheckboxes.on('change', function() {
var selectedFilters = {};