Skip to product information
1 of 1
Published:2023.07.21

Example of settings for randomly displaying products from a featured collection in the Shopify theme "Dawn"

Example of settings for randomly displaying products from a featured collection in the Shopify theme "Dawn"

  • Product Image Management
  • LIQUID
  • Javascript
View full details

This is a setting example for randomly displaying products in Shopify's "Featured Collections". In order to update the content every time it is accessed using liquid with strong cache, I experimentally created this example based on the method using cart attributes adopted in the theme "Prestige".


How to set up random display of featured collection products in the Dawn theme


Setup Step 1: Add the scheme to "featured-collection.liquid" and the label to "ja.schema.json"


Setting procedure 2: Modify "featured-collection.liquid" (part 1)


Setup Step 3: Modify "featured-collection.liquid" (part 2), Modify "main-cart-items.liquid"


Setup Step 4: Select the collection you want to display in the theme's featured section and turn on "Show randomly"


After making a purchase (all items are ¥0), you will be able to view the sample code.

If you have already made a purchase, please login here.

Sample Codes

Test Theme :Dawn/Rise 15.2.0

Add scheme to "featured-collection.liquid"

{
	"type": "checkbox",
	"id": "display_at_random",
	"label": "t:sections.featured-collection.settings.display_at_random.label",
	"default": false
},


Add a label to "ja.schema.json"

"display_at_random": {
	"label": "商品をランダムで表示する"
},


Modifying "featured-collection.liquid" (Part 1)