805 votes
1 answers
How to check page is cart page or not in Shopify
How can I check if the current page is the cart page or not in front side?
I try to find page type usingShopifyAnalytics.meta.page.pageType
. This works for all pages (like product and collection page) but doesn't work for cart page.
If you have any idea, please give answer.
Undefined asked
233
votes
Answer
Solution:
add this condition
{% if template == 'cart' %}
//your code here
{% endif %}
Undefined answered
Source
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.