Hide the catalog page on Shopify - e-commerce

Is there a way to hide the catalog page in Shopify? Here is more detail about the Shopify catalog page.

You might add an automatic javascript redirection to home when collection URL contains 'all'.
So this could be something like this in collection template in your theme :
{% if collection.handle == 'all' %}
<script>window.location.href = '{{ shop.url }}';</script>
{% else %}
Usual code for collection template display if this is not the 'all' collection.
{% endif %}
Please note that is NOT RECOMMENDED practice.
For example, if your customer has disabled Javascript, the page content will be blank as redirection won't work.
A better practice would be to not index page in search engines, so if there is no internal link and if search engines do not index it, no one will see it.
To do that, open the 'theme.liquid' template, and then, add this in <head> section :
{% if collection.handle == 'all' %}
<meta name="robots" content="noindex">
{% endif %}
HTH

Can you please give us a little more details about what you want ? If you want to remove the catalog from main menu , you need to go to Online store > navigation > find the main menu and remove catalog from there. That will remove the menu named catalog from your theme.
https://help.shopify.com/manual/sell-online/online-store/menus-and-links
If you donot want to show any product in the catalog page, you need to go to Online store > themes > edit html/css of the active theme and modify the collection.liquid to remove the section that displays the products.
Give us more details so that we can help you properly.

From the link you provided:
All Shopify stores have a page at the URL your-store.com/collections/all that lists all of the visible products in the store. This is the store's catalog page. By default, products on the catalog page are shown in alphabetic order. You can create a collection to control the order in which your products are shown on this page.
If you want to hide / remove that page altogether, you need to do a few things:
Create a collection to control your catalog page, as described via that same link,
Redirect it so that anyone that visits the page gets taken somewhere else e.g. your homepage. You can use the snippet below, based on this excellent answer for "Redirect[ing] from an HTML page" [or, in this case, a Liquid template:]
{%- layout none -%}
{%- assign title = "Nothing to See Here!" -%}
{%- assign url = shop.url -%}
<!DOCTYPE HTML>
<html lang="en-US">
<head>
{%- include 'head-meta' -%}
<meta http-equiv="refresh" content="1;url={{ url }}">
<script type="text/javascript">
window.top.location.href = "{{ url }}"
</script>
</head>
<body>
<h1>{{ page_title }}</h1>
<p>If you are not redirected automatically, follow the link.</p>
</body>
</html>
Remove it from the sitemap. You can do that (for this Collection or any Shopify resource) using my answer here — tl;dr add a metafield.seo.hidden with value 1.

Related

Shopify Where to Setup Returns Texts

Where in the admin panel can I setup some kind of product returns text and then call it in the product.liquid template?
I've setup a new tab for the product description now I need to find a way to setup and pull the returns text information.
<div class="tabs">
{% if product.description.size > 0 %}
<div class="tab" id="product-description-tab">
<div class="tab-title">Description</div>
<div class="tab-content">
{{ product.description }}
</div>
</div>
{% endif %}
</div>
So to answer question, if content is always the same for all products:
First solution, you may use a page content :
Create a page with needed content
Add theme option allowing theme user to choose the page content to display
Retrieve settings to display page content wherever you need in your product template - To do it clean, add a condition to display nothing if settings value is empty.
Second solution:
Create theme setting with textarea type
Retrieve setting to display content wherever you want in your product template
Add a condition to display nothing if setting value is blank.
Documentation about settings_schema.json is available here: https://help.shopify.com/themes/development/theme-editor/settings-schema
HTH

Shopify: Showing a certain breadcrumb on /collections/all

I would like to display a certain breadcrumb only if the user is on the /collections/all page but am having trouble with which code I use to check that I am on that page. I tried collection.title and collection.handle and collection.url == all and it didn't seem to work. What code can I use?
I figured this out. To create specific breadcrumb code for the /collections/all page, I used:
{% if collection.handle == "all" %}
all products
{% endif %}
(there is other code that creates home >> etc.)

How to Add Meta tags in Shopify Theme Site?

I have a site designed in Shopify platform But unable to insert Meta Title, Description, Keywords.
Also I want to implement Meta Tags in its pages & products. But don't know how to add them?
If you based your theme on one of the standard ones you should see some tags in the main layout like:
{% if page_description %}
<meta name="description" content="{{ page_description | escape }}">
{% endif %}
If not you can add it and get a meta tag.
If you want to add more info you'll need decide where the info is going to come from and code your theme accordingly. Again if you based your theme on a standard theme your main layout may have a snippet reference for open-graph-tags. If you edit open-graph-tags.liquid you will see one way to manage conditional meta tags.
In a nutshell you'd put something like the following in your theme header where XXX is the field that has your keywords. (maybe use a metafield for this?) :
{% if template contains 'product' %}
<meta name="keywords" content="{{ product.XXX | strip_html | escape }}">
{% endif %}

Multiple linklists on shopify categories (sidebar)

Yet another shopify question. I have a sidebar on shop/collections page
settings.sidebar_categoryblock_linklist
Which shows links to my main collecions: men/woman/kinds ect.
Yet I have another collection list based on product tags:
Winter/Autumn/Casual/Business etc
How do I get to display them on the sidebar? Meaning how can I put several linklists as categories link lists?
Thanks in advance
Julia
In a collection page, you have access to all the tags (unique) that the products have. You can use these tags to see if the belong to any collection and then display them. The code is as follows:
{% for tag in collection.all_tags %}
{% assign c_collection = collections[tag] %} // c_collection is used so the current display page's collection doesn't get disturbed
{% if c_collection.title != '' %}
{{ tag | link_to: c_collection.url,c_collection.title }} // not sure about this, but you can use proper html as well here
{% endif %}
{% endfor %}

Shopify - Get list of product from a specific collection

In shopify, I am creating 4 dropdowns.
Dropdown 1 - City
Dropdown 2 - Category of shops (such as Apparel, stationary etc)
Dropdown 3 - Shops available in the particular city and particular shop
Dropdown 4 - Items available in the particular shop
My requirement is, when a particular shop is selected (Dropdown 3) below the dropdown all the products in that shop should be listed (I will make the product part of collection and collection name will be same as shop name).
I realize that I need to use Ajax. I checked the APIs offered by shopify but somehow I am not able to connect dots. I am not able to use it. Can you please provide a pointer where it is explained how to achieve it.
Please note, i am new to web development and shopify.
EDITED*
I have created another template called "collection.alternate".
Tagged the collection to the new template.
In theme.liquid I have used the following code, to avoid header and footer from getting displayed in iframe
{% if template != 'collection.alternate' %}
{% include 'header-bar' %}
.....
{% endif %}
Used iframe to load the collection.alternate.
However in iframe the Header is still getting displayed. When I analyze the "Elements" in Chrome developer tools for the iframe, I see the header logic is generated for collection.template. How do I stop header from appearing in iframe.
You don't need AJAX for this functionality.
Each values in the four dropdowns should be added as tags in the products. Then you can use simple JavaScript command to change the url as required and display required products.
For ex., let's say you have New York as a City, and CK as a Shop. Now to display the products that are in CK store in New York, all the said products must contain New York and CK as tags. The final URL to display the said products will be - storename.myshopify.com/collections/all/new-york+ck
To call products from shopify collects you can simply use this loop:
{% for product in collections.shop_name.products limit: 4 %} /*********** shop_name is collections name limit is used to show no. of products ******/
<li><img src="{{ product.featured_image | product_img_url: 'medium' }}" alt=""></li>
{% endfor %}
Below is the link to shopify article that describes how to filter products based on tags.
https://docs.shopify.com/support/your-store/collections/filtering-a-collection-with-multiple-tag-drop-down
Thanks #Hymnz for guiding me to the article.
Just mention your collection name in collection array index
{% for product in collections['collection-name'].products %}
{{product.name}}
{% endfor %}