How to show vendor on search results page (and in cart)?

Solved
esmiller
Tourist
10 1 3

Hello,

 

I am setting up a Shopify store to sell rare books with the Debut template. I am using the vendor field to input the author's name for each book. By making changes in Liquid, I figured out how to show the vendor field below the product title on both my collection and product pages.

 

However, I have not been able to figure out how to make the vendor field visible on the search results page or in the cart. In both cases, I would like the vendor field to occupy the line directly below the product title. Can anyone offer any suggestions?

 

Thanks and kind regards,

Evan

0 Likes
esmiller
Tourist
10 1 3

This is an accepted solution.

Edit: Fixed both issues! The cart was relatively easy. Having vendor display in search results, however, ultimately meant making a change to product_card_list.liquid, and not to search.liquid, which is what I had been trying to do. The search results automatically defer to the product_card_list snippet when it exists (which it would for any products). I had been attempting to include vendor information downstream from the following lines in search.liquid:

 

{% if item.object_type == 'product' %}

{% include 'product-card-list', product: item %}

 

Naturally my changes had no effect, since the object type in question was indeed a product. Hope this helps in case anyone else runs into a similar issue!

 

Andrei21
Tourist
15 0 0

Hi,

How were you able to add Vendor to check out and cart? I would need the Vendor name appear above or before the Product Title.

Thanks

0 Likes
Grant-Senior
Excursionist
36 3 5

Hi there, it's probably too late for you now, but for anybody else after this info (as I just was), to make esmiller's information a bit clearer, add the bottom line as shown in the code below to the product-card-list.liquid file will get you the vendor appearing in the search results.

 

<div class="list-view-item__title" aria-hidden="true">
        <span class="product-card__title">{{ product.title }}</span>         
      </div>
      <div class="spf-product-card__vendor">{{ product.vendor }}</div>  <!--  this line added -->

 

0 Likes