Hide Product Prices violating MAP in Shopify

If you're receiving MAP violations on your Shopify storefront, but you still want to be able to sell the discounted products online, consider updating your theme's code so that if a product contains a tag (of your choosing) it will not show its price in common views like the grid or main product page. This can be accomplished using the Liquid templating language.

Here's an overview of how we approached this issue:

  1. In your theme's code, find the snippets that show your products and their prices outside of the checkout flow (usually having the price display after it's been added to the cart is okay by vendor's map standards)
  2. Add Liquid templating logic so that if the product has the specified tag, in our case 'removeMAP,' it does not show the price
  3. Add the tag to the problematic products using the GUI, import, or API
  4. Save these files and view your changes on the site to confirm success

In my example, it looked something like this albeit very paired down

product.liquid (snippet)


  
{% if product.tags contains "removeMAP" %}
  
{% else %}
  
{% render 'product-price', product: product, class_root: 'product', price: price, %}
{% endif %}

product-grid-item.liquid (snippet)


  
{% if product.tags contains "removeMAP" %}
  
{% else %}    
  {%- capture product_item_price -%}
    {%
      render 'product-price',
      product: product,
      class_root: 'productitem',
    %}
  {%- endcapture -%}
{% endif %}
  

Feel free to get in touch with any questions.