Hi! Is it possible to remove some options here in the Sort By dropdown? I’m using Dawn 2.0
My store url: chrisandleon.com
Hi! Is it possible to remove some options here in the Sort By dropdown? I’m using Dawn 2.0
My store url: chrisandleon.com
which options you want remove from sort dropdown ?
If possible, the featured and best selling.
Hi! These are the codes from that:
{{ ‘template-collection.css’ | asset_url | stylesheet_tag }}
{{ ‘component-loading-overlay.css’ | asset_url | stylesheet_tag }}
{{ ‘component-card.css’ | asset_url | stylesheet_tag }}
{{ ‘component-price.css’ | asset_url | stylesheet_tag }}
{{ ‘component-product-grid.css’ | asset_url | stylesheet_tag }}
{{ ‘component-rte.css’ | asset_url | stylesheet_tag }}
{%- if section.settings.enable_filtering or section.settings.enable_sorting -%}
{{ ‘component-facets.css’ | asset_url | stylesheet_tag }}
{%- if paginate.pages > 1 -%}
{% render ‘pagination’, paginate: paginate, anchor: ‘’ %}
{%- endif -%}
{% schema %}
{
“name”: “t:sections.main-collection-product-grid.name”,
“class”: “spaced-section collection-grid-section”,
“settings”: [
{
“type”: “range”,
“id”: “products_per_page”,
“min”: 8,
“max”: 24,
“step”: 4,
“default”: 16,
“label”: “t:sections.main-collection-product-grid.settings.products_per_page.label”
},
{
“type”: “header”,
“content”: “t:sections.main-collection-product-grid.settings.header__3.content”
},
{
“type”: “select”,
“id”: “image_ratio”,
“options”: [
{
“value”: “adapt”,
“label”: “t:sections.main-collection-product-grid.settings.image_ratio.options__1.label”
},
{
“value”: “portrait”,
“label”: “t:sections.main-collection-product-grid.settings.image_ratio.options__2.label”
},
{
“value”: “square”,
“label”: “t:sections.main-collection-product-grid.settings.image_ratio.options__3.label”
}
],
“default”: “adapt”,
“label”: “t:sections.main-collection-product-grid.settings.image_ratio.label”
},
{
“type”: “checkbox”,
“id”: “show_secondary_image”,
“default”: false,
“label”: “t:sections.main-collection-product-grid.settings.show_secondary_image.label”
},
{
“type”: “checkbox”,
“id”: “add_image_padding”,
“default”: false,
“label”: “t:sections.main-collection-product-grid.settings.add_image_padding.label”
},
{
“type”: “checkbox”,
“id”: “show_image_outline”,
“default”: true,
“label”: “t:sections.main-collection-product-grid.settings.show_image_outline.label”
},
{
“type”: “checkbox”,
“id”: “show_vendor”,
“default”: false,
“label”: “t:sections.main-collection-product-grid.settings.show_vendor.label”
},
{
“type”: “checkbox”,
“id”: “show_rating”,
“default”: false,
“label”: “t:sections.main-collection-product-grid.settings.show_rating.label”,
“info”: “t:sections.main-collection-product-grid.settings.show_rating.info”
},
{
“type”: “header”,
“content”: “t:sections.main-collection-product-grid.settings.header__1.content”
},
{
“type”: “checkbox”,
“id”: “enable_filtering”,
“default”: true,
“label”: “t:sections.main-collection-product-grid.settings.enable_filtering.label”,
“info”: “t:sections.main-collection-product-grid.settings.enable_filtering.info”
},
{
“type”: “checkbox”,
“id”: “enable_sorting”,
“default”: true,
“label”: “t:sections.main-collection-product-grid.settings.enable_sorting.label”
},
{
“type”: “checkbox”,
“id”: “collapse_on_larger_devices”,
“default”: false,
“label”: “t:sections.main-collection-product-grid.settings.collapse_on_larger_devices.label”
}
]
}
{% endschema %}
your theme code is diffrent please share theme.zip i will check code and send correct solution for you.
Thanks!
Hi! Sure! Is it this one?
Thanks!
Will try this one. Thank you!
Sadly, I cannot find this code in any of the liquids
Replace all following code your Snippets/facets.liquid file
{% comment %}
Renders facets (filtering and sorting)
Accepts:
- results: {Object} Collection or Search object
- enable_filtering: {Boolean} Show filtering when true
- enable_sorting: {Boolean} Show sorting when true
- collapse_on_larger_devices: {Boolean} Collapse filtering/sorting into menu on larger devices when true
Usage:
{% render 'facets', results: collection, enable_filtering: true, enable_sorting: true, collapse_on_larger_devices: false %}
{% endcomment %}
{%- liquid
assign sort_by = results.sort_by | default: results.default_sort_by
assign total_active_values = 0
if results.url
assign results_url = results.url
else
assign terms = results.terms | escape
assign results_url = '?q=' | append: terms | append: '&options%5Bprefix%5D=last&sort_by=' | append: sort_by
endif
-%}
{%- unless collapse_on_larger_devices -%}
{%- endunless -%}
{%- for filter in results.filters -%}
{%- for value in filter.active_values -%}
{%- endfor -%}
{%- if filter.type == "price_range" -%}
{%- if filter.min_value.value != nil or filter.max_value.value != nil -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- if results.results_count -%}
{{ 'templates.search.results_with_count' | t: terms: results.terms, count: results.results_count }}
{%- elsif results.products_count == results.all_products_count -%}
{{ 'products.facets.product_count_simple' | t: count: results.products_count }}
{%- else -%}
{{ 'products.facets.product_count' | t: product_count: results.products_count, count: results.all_products_count }}
{%- endif -%}
Hope this work!
Thanks!
OH MY GOSH THIS WORKED!!! WOW!!!
Thanks! welcome again.
Hi,
Is there any way to do exactly the same but only keep the Price low to high and high to low options?
Thank you!
Hey Cathrine, after adding the new facets code from the accepted solution find this section
{% unless option.value == 'manual' or option.value == 'best-selling' %}
and change it to this
{% unless option.value == 'manual' or option.value == 'best-selling' or option.value ==
'title-ascending' or option.value == 'title-descending' or option.value == 'created-ascending' or option.value == 'created-descending' %}
Can you tell me how to make ‘best-selling’ the default selected option so that when the page loads it displays the best selling products? I’ve removed the Alphabetical option and the page still sorts alphabetically on the first load.
Thank you so much, it worked!
Hi ! Same question here but I would like to remove Featured, Best Selling + Alphabetical order A-Z and Z-A
Many thx in advance
found my answer already thanks