"Sorter Box render to left"

Hala11
New Member
2 0 0

Hi,

I added a "sort by" menu by adding this code in "snippet directory":

<div>
<label for="sort-by">Sort by</label>
<select id="sort-by">
<option value="best-selling">Best Selling</option>
<option value="created-ascending">Oldest to Newest</option>
<option value="created-descending">Newest to Oldest</option>
<option value="price-ascending">Price: Low to High</option>
<option value="price-descending">Price: High to Low</option>
<option value="title-ascending">Product Title A-Z</option>
<option value="title-descending">Product Title Z-A</option>
<option value="manual">Manually</option>
</select>
</div>
<script>
Shopify.queryParams = {};
if (location.search.length) {
for (var aKeyValue, i = 0, aCouples = location.search.substr(1).split('&'); i < aCouples.length; i++) {
aKeyValue = aCouples[i].split('=');
if (aKeyValue.length > 1) {
Shopify.queryParams[decodeURIComponent(aKeyValue[0])] = decodeURIComponent(aKeyValue[1]);
}
}
}
jQuery('#sort-by')
.val('{{ collection.sort_by | default: collection.default_sort_by | escape }}')
.bind('change', function() {
Shopify.queryParams.sort_by = jQuery(this).val();
location.search = jQuery.param(Shopify.queryParams).replace(/\+/g, '%20');
});
</script>

 

 

Then, added in collection.liquid under "section directory"

{% render 'collection-sorting' %}

I want to show the menu on the left side on all collection pages, what should I do?

0 Likes
Hala11
New Member
2 0 0

Anyone can help please???

0 Likes