2023年3月16日 星期四

Adding infinite scrolling to Shopify - Collection Pages - Dawn Theme

Following the instruction:


- You should duplication theme before applying changes.

- Online Shop - Theme - Edit Code

- You could use search function to look for specific files:


Step 1: Download Source File

https://minionmade.github.io/scrollify/download.zip 

 

Step 2:  (Line 5)

Then add this script tag in main-collection-product-grid.liquid near the other asset_url tags:

main-collection-product-grid.liquid

{{% 'ajaxinate.min.js' | asset_url | script_tag  %}}
 
 
 Step 3: (Near Line 195)
 Add this script right before the schema starts in main-collection-product-grid.liquid to create a new ajaxinate instance.
 main-collection-product-grid.liquid 
<script>
const endlessCollection = new Ajaxinate({
container: '#product-grid',
pagination: '.infinite_next',
});
</script>
 
 
 Step 4 : (Near Line 62)
Add class = "infinite_next" inside <li> tag 
pagination.liquid 
 
 
 
 

Step: 5 (Near Line 1)

face.ts

const endlessCollection = new Ajaxinate({
container: '#product-grid',
pagination: '.infinite_next',
});
 
 
 
 
Bonus Step:  To make "loading" to "..."
ajaxinate.min.js
 
 

我的白蝕治療之路:從發現到自我管理

  大家好,想和大家分享我與白蝕, 白癜風(vitiligo)抗爭的經歷, 這抗爭於今天開始, 立此Blog 以作紀錄。   2024-08-14 這個故事開始於三年前, 三年前,也就是新冠肺炎初期,當時我剛買了新車,在駕駛過程中突然發現了手上皮膚的異常。我注意到了皮膚的出現了...