| Problem | I am using the Prestige theme. On the sidebar they have an option for a group by filter. It is currently sorting alphabetically. I have two categories I would like to add custom sorting to. Size: S,M,L,XL Price: $0 to $40, $40 to $80, $80 to $100, $100 to $150, $150 to $200, $200+ You can see an example of price sorting here: https://themes.shopify.com/themes/prestige/styles/couture/preview |
|---|---|
| My Url | https://thepenthousecloset.com/collections/ password:prettylolo |
{%- if section.settings.show_layout_switch -%}
{%- assign desktop_items_per_row = cart.attributes.collection_desktop_items_per_row | default: section.settings.grid_desktop_items_per_row | times: 1 -%}
{%- assign mobile_items_per_row = cart.attributes.collection_mobile_items_per_row | default: section.settings.grid_mobile_items_per_row | times: 1 -%}
{%- if desktop_items_per_row >= 3 and desktop_items_per_row != section.settings.grid_desktop_items_per_row -%}
{%- assign desktop_items_per_row = section.settings.grid_desktop_items_per_row -%}
{%- endif -%}
{%- else -%}
{%- assign desktop_items_per_row = section.settings.grid_desktop_items_per_row | times: 1 -%}
{%- assign mobile_items_per_row = section.settings.grid_mobile_items_per_row | times: 1 -%}
{%- endif -%}
{%- if desktop_items_per_row == 4 -%}
{%- assign tablet_items_per_row = 3 -%}
{%- else -%}
{%- assign tablet_items_per_row = 2 -%}
{%- endif -%}
{%- capture collection_inner -%}
{%- comment -%}This is the common part to both template{%- endcomment -%}
{%- if collection.products_count > 0 -%}
{%- paginate collection.products by section.settings.grid_items_per_page -%}
{%- for product in collection.products -%}
{%- render 'product-item', product: product, show_product_info: true, show_vendor: section.settings.show_vendor, show_color_swatch: section.settings.show_color_swatch, show_labels: true -%}
{%- endfor -%}
{%- render 'pagination', paginate: paginate -%}
{%- endpaginate -%}
{%- else -%}
# {{ 'collection.general.no_products' | t }}
{%- endif -%}
{%- endcapture -%}
{%- if template == 'collection.ajax' -%}
{%- comment -%}
--------------------------------------------------------------------------------------------------------------------
CONTENT FOR AJAX ALTERNATE TEMPLATE
--------------------------------------------------------------------------------------------------------------------
{%- endcomment -%}
{{- collection_inner -}}
{%- else -%}
{%- comment -%}
--------------------------------------------------------------------------------------------------------------------
CONTENT FOR NORMAL TEMPLATE
--------------------------------------------------------------------------------------------------------------------
{%- endcomment -%}
{%- assign active_tags = '' -%}
{%- for tag in current_tags -%}
{%- assign tag_as_handle = tag | replace: ''', '' | replace: '"', '' | handle -%}
{%- assign active_tags = active_tags | append: tag_as_handle -%}
{%- unless forloop.last -%}
{%- assign active_tags = active_tags | append: '+' -%}
{%- endunless -%}
{%- endfor -%}
{%- capture section_settings -%}
{
"collectionUrl": {{ collection.url | default: '/collections/all' | json }},
"currentTags": {% if active_tags != blank %}{{ active_tags | split: '+' | json }}{% else %}[]{% endif %},
"sortBy": {{ collection.sort_by | default: collection.default_sort_by | json }},
"filterPosition": {{ section.settings.filter_position | json }}
}
{%- endcapture -%}
{%- endif -%}
{%- capture hack -%}
{%- comment -%}This is just an ugly hack to make those variables appear as part of the theme editor in the General Settings{%- endcomment -%}
{{ settings.product_list_horizontal_spacing }},{{ settings.product_list_vertical_spacing }}
{%- endcapture -%}
{% schema %}
{
"name": "Collection page",
"class": "shopify-section--bordered",
"settings": [
{
"type": "checkbox",
"id": "show_collection_info",
"label": "Show collection info",
"default": true
},
{
"type": "checkbox",
"id": "show_collection_image",
"label": "Show collection image",
"default": false
},
{
"type": "checkbox",
"id": "apply_overlay",
"label": "Apply overlay on image",
"info": "This can improve text visibility.",
"default": true
},
{
"type": "checkbox",
"id": "show_color_swatch",
"label": "Show color swatch",
"info": "Some colors appear white? [Learn more](http://support.maestrooo.com/article/80-product-uploading-custom-color-for-color-swatch).",
"default": false
},
{
"type": "checkbox",
"id": "show_vendor",
"label": "Show vendor",
"default": false
},
{
"type": "select",
"id": "collection_image_size",
"label": "Collection image size",
"options": [
{
"value": "small",
"label": "Small"
},
{
"value": "normal",
"label": "Normal"
},
{
"value": "large",
"label": "Large"
}
],
"default": "normal"
},
{
"type": "header",
"content": "Toolbar"
},
{
"type": "checkbox",
"id": "show_sort_by",
"label": "Show sort by",
"default": true
},
{
"type": "checkbox",
"id": "show_layout_switch",
"label": "Show layout switch"
},
{
"type": "select",
"id": "toolbar_position",
"label": "Position",
"options": [
{
"value": "top",
"label": "Top"
},
{
"value": "bottom",
"label": "Bottom"
}
],
"default": "top"
},
{
"type": "header",
"content": "Filters"
},
{
"type": "select",
"id": "filter_position",
"label": "Desktop position",
"options": [
{
"value": "sidebar",
"label": "Sidebar"
},
{
"value": "drawer",
"label": "Drawer"
}
],
"default": "sidebar"
},
{
"type": "select",
"id": "filter_mode",
"label": "Mode",
"info": "Filters by group requires specific tag formatting. [Learn more](https://help.shopify.com/manual/using-themes/themes-by-shopify/supply#product-tips-tips-specific)",
"options": [
{
"value": "hidden",
"label": "Hidden"
},
{
"value": "tag",
"label": "By tag"
},
{
"value": "group",
"label": "By group"
}
],
"default": "tag"
},
{
"type": "checkbox",
"id": "show_filter_color_swatch",
"label": "Show filter color swatch",
"info": "This is only used if filters by group is enabled.",
"default": true
},
{
"type": "link_list",
"id": "filter_menu",
"label": "Quick links",
"info": "This menu won't show dropdown items."
},
{
"type": "header",
"content": "Grid"
},
{
"type": "range",
"id": "grid_items_per_page",
"label": "Products per page",
"min": 4,
"max": 48,
"step": 4,
"default": 16
},
{
"type": "select",
"id": "grid_mobile_items_per_row",
"label": "Products per row (mobile)",
"options": [
{
"value": "1",
"label": "1"
},
{
"value": "2",
"label": "2"
}
],
"default": "2"
},
{
"type": "range",
"min": 2,
"max": 4,
"id": "grid_desktop_items_per_row",
"label": "Products per row (desktop)",
"default": 4
}
]
}
{% endschema %}