How to Create Custom Product Catalogs in Shopify Store


Custom Product Catalogs and Pricing are an essential feature for a B2B or Wholesale Ecommerce store. Neither you want to show non-wholesale products to your wholesale customers, nor you want retail customers to view the products sold in the wholesale. This happens in the case of product pricing as well. Unless you have a Shopify Plus license, you won’t be able to get this feature of hiding specific products from specific customers based on Tags. This article shows you the steps in which you can achieve the same from your Shopify store using a little bit of coding in liquid.

The First Step – Product Tagging:

product-tagging

Edit the product and tag the product with Wholesale or anything you like. In case you would like to hide the complete Collection, you need to do the same thing for a Collection.

Next Step – Tag the Wholesale Customer:

As you have done for the products or collections, in the same way, tag your Wholesale Customers.

wholesale-customer

Now, the Magic Code:

From your Shopify Admin go to: Online Store -> Themes -> Actions -> Edit Code

Here, you need to show/hide the products from many different templates of your store, e.g.: The Navigation, All Products Page, The specific product page etc. We will show you how to hide the Wholesale products from the product page so that the retail customers won’t get the product link. Once you learn this, you can hide from other templates as well.Integrated-B2B-eCommerce-store-InSync

Go to Sections -> open Collection.liquid file

Search for the code:

{% for product in collection.products limit: product_limit %}

This is the place where all the products are displayed in a loop.

The following displays the product:

{% include 'product-card-grid', max_height: max_height %}

Before the for loop, write this logic:

{% if customer and customer.tags contains ‘Wholesale’ %}

{% assign customer_wholesale = true %}

{% endif %}

Then after the beginning of the for loop and before the <li> tag:

{% unless product.tags contains ‘Wholesale’ %}

{% assign product_wholesale = false %}

{% endunless %}

{% if customer_wholesale or product_wholesale == false %}

—- Rest of the code —-

After the </li> tag
{% endif %}
The complete code

code

The first part of the code checks if the user is logged in and has a tag Wholesale, then it creates a variable customer_wholsale accordingly with true value.

The next part checks unless the product is tagged as ‘Wholesale’, the product_wholesale  variable is false.

Finally, it uses the logic to hide/show a specific product to the specific customer.

This is the manual way to create customer product catalogs for Shopify. Now,  get the complete B2B or Wholesale Shopify experience which is more dynamic and automated!Integrated-B2B-eCommerce-store-InSync

Search

Search
On Key

Related Posts

APPSeCONNECT is now a completely new entity headquartered in the US! 🇺🇸