previous and next button not working after certain page

Solved

previous and next button not working after certain page

minhsien
Tourist
4 0 1

i copy and paste the liquide provide on the site to add my previous and next page button.  My previous and next page button link works well  for all the collection except one. Could some one please help out  to check what went wrong.  The following is the liquid i locate from the site. 

And the actual website page to show my problem

 

https://m-zakkaya.myshopify.com/admin/themes/131844309244/editor?previewPath=%2Fproducts%2Fkids-suns...

 

(with the previous and next button )

 

https://m-zakkaya.myshopify.com/admin/themes/131844309244/editor?previewPath=%2Fproducts%2Fknitted-g...

(without the previous and next button)

 

 

{%- liquid
assign previous_product = collection.previous_product
assign next_product = collection.next_product
if previous_product or next_product
else
assign collectionList = product.collections[0].handle
assign previous_product = nil
assign next_product = nil
assign last = collections[collectionList].products_count
for p in collections[collectionList].products
if p.handle == product.handle
assign prev = forloop.index | minus: 2
assign next = forloop.index
if prev >= 0
assign previous_product = collections[collectionList].products[prev].handle
endif
if last >= next
assign next_product = collections[collectionList].products[next].handle
endif
break
endif
endfor
endif
-%}
{%- if previous_product -%}
<a class="next-prev-icon prev-icon" href="{{ previous_product }}">
Previous
</a>
{%- endif -%}
{%- if next_product -%}
<a class="next-prev-icon next-icon" href="{{ next_product }}">
Next
</a>
{%- endif -%}

Accepted Solution (1)
LitExtension
Shopify Partner
4915 1005 1183

This is an accepted solution.

Hi @minhsien,

The next and previous button is only displayed when you visit the collection page and have a product link: https://mzakkaya.com/collections/trendy/products/kids-sunscreen-lace-lace-breathable-bucket-hat

So you need to change the product link in step 1 as per my previous instructions.

Hope it is clear to you.

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
Contact us:
- Email: contact@litextension.com

View solution in original post

Replies 7 (7)

LitExtension
Shopify Partner
4915 1005 1183

Hi @minhsien,

I have checked and the products are not working well. Can you send me the product link that works well? I will check it.

You can also refer to my previous tutorial: https://community.shopify.com/c/shopify-design/add-previous-and-next-buttons-to-dawn-theme/td-p/1461...

Hope it helps!

 

 

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
Contact us:
- Email: contact@litextension.com
minhsien
Tourist
4 0 1
Thank you for the reply. my is theme dawn 4.0 therefore i could not find

product-card.liquid file, find 'card-information__text h5

as mentioned in your post. And i am sorry that i have deleted the old
liquid, and i can't find the original source right now. Perhaps i could
provide my shopify line for you to check?
LitExtension
Shopify Partner
4915 1005 1183

Hi @minhsien,

Please find 'card_product.url', change 

card_product.url

=>

card_product.url | within: collection | default: '#'

Hope it helps!

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
Contact us:
- Email: contact@litextension.com
minhsien
Tourist
4 0 1

https://mzakkaya.com/products/kids-sunscreen-lace-lace-breathable-bucket-hat

 

https://mzakkaya.com/products/summer-childrens-short-sleeved-boy-t-shirt-cotton-bottoming-top

 

https://mzakkaya.com/products/t-shirt-slub-cotton-casual-top

Please check above. These products are in the same collection, howewver some products did not show the previous and next link as well.  And i might need to move the link to the right side of the page.

LitExtension
Shopify Partner
4915 1005 1183

This is an accepted solution.

Hi @minhsien,

The next and previous button is only displayed when you visit the collection page and have a product link: https://mzakkaya.com/collections/trendy/products/kids-sunscreen-lace-lace-breathable-bucket-hat

So you need to change the product link in step 1 as per my previous instructions.

Hope it is clear to you.

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
Contact us:
- Email: contact@litextension.com
minhsien
Tourist
4 0 1

Thanks for the effort! it looks and work well

Nabeel2
Shopify Partner
2 0 0

Hi @minhsien put this line in your collection page 

{% assign url = card_product.url | within: collection %}
 
and your collection link should look something like this: - 
 <a href="{{ url }}" class="full-unstyled-link">
                {{ item.title | escape }}
              </a>
 
i hope this helps