Shorten product title on feature collect on homepage

Shorten product title on feature collect on homepage

clementjaw001
Shopify Partner
25 0 2

I wonder if anyone can also advise on how to make the feature collection product title just display 2 rows in desktop and mobile view? Just like the screenshot for this store below? (This store only allows product titles to display 1 row, but for me, I prefer 2 rows.),  I also want the discount price and original price displayed in the same row as this store under desktop view. The color of the original price can be changed to green. 

Under mobile view, the after discounted price is on top of the original price, and the font size is slightly bigger than the original price font size, just like this store below mobile view.

https://trendingcustom.com/

 

IMPROVE FEATURE COLLECTION DISPLAY.png

 

 

This is my store home page currently feature collection display
update feature colletion.png

Replies 11 (11)

BSSCommerce-HDL
Shopify Partner
2079 738 929

Hi @clementjaw001

Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code

Step 2: Search file theme.liquid

Step 3: Insert this code above </head> tag:

<style>
.collection .card__heading.h5 a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 260px;
    display: block;
}
</style>

Here is result:

BSSCommerceHDL_0-1724314889089.png

Hope this can help you,

If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you 😍

If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here .

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

GTLOfficial
Shopify Partner
475 95 90

Hello @clementjaw001 
1) to display collection product title just display 2 rows:
Go to online store ---------> themes --------------> actions ------> edit code------->assets-----> style.scss.css ---> line number 17529
seach this code

 

.new-featured-collection-section .product-list .thumbnail .product-details .title, .recently-viewed__section .product-list .thumbnail .product-details .title, .recommendation-products__section .product-list .thumbnail .product-details .title {
font-weight: 700;
font-size: 14px;
line-height: 20px;
color: #222;
text-align: left;
-webkit-line-clamp: 1;
margin-bottom: 4px;
}

 


and replace with this code

 

.new-featured-collection-section .product-list .thumbnail .product-details .title, .recently-viewed__section .product-list .thumbnail .product-details .title, .recommendation-products__section .product-list .thumbnail .product-details .title {
font-weight: 700;
font-size: 14px;
line-height: 20px;
color: #222;
text-align: left;
-webkit-line-clamp: 2;
margin-bottom: 4px;
}

 

result
3.png

If this was helpful, hit the like button and accept the solution.
Thanks

- Buy me a Pizza
- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on the store Hire me. GTL web solutions
- Want Complete Storefront: Send an email ⇨- Email: info@gtlofficial.com - Skype: ritesh_27dh
clementjaw001
Shopify Partner
25 0 2

My theme dont have this "style.scss.css " in assets.

Huptech-Web
Shopify Partner
909 186 190

Hey @clementjaw001 
please remove this code 

 

 

<li>{{ product.title | truncatewords: 5 }}</li>

 

 

truncatewords

Shortens a string down to the number of words passed as an argument. If the specified number of words is less than the number of words in the string, an ellipsis (…) is appended to the string.

If you need further assistance, please let me know. If you found my help useful, consider liking this message and marking it as the solution.
Best regards
K.K

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required
clementjaw001
Shopify Partner
25 0 2

Hi K.K,

Where to remove the code you mention?

Huptech-Web
Shopify Partner
909 186 190

@clementjaw001 find the card-product.liquid file and find truncatewords

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required

GTLOfficial
Shopify Partner
475 95 90

2) the font size is slightly bigger than the original price
Go to online store ---------> themes --------------> actions ------> edit code------->assets-----> style.scss.css ---> line number 17529
add this code at the end of the file.

.new-featured-collection-section .product-list .thumbnail .product-details .price span.money {
font-size: 14px !important;
}

result
4.png

If this was helpful, hit the like button and accept the solution.
Thanks

- Buy me a Pizza
- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on the store Hire me. GTL web solutions
- Want Complete Storefront: Send an email ⇨- Email: info@gtlofficial.com - Skype: ritesh_27dh
clementjaw001
Shopify Partner
25 0 2

I do not has this style.scss.css, can please help?

Sweans
Shopify Partner
398 77 119

Hi @clementjaw001 ,

 

Please follow the steps below to implement the solution:

 

1. In your Shopify admin, navigate to Online Store under Sales Channels. Click the three dots next to the theme you want to edit, and select Edit Code.

 

Sweans_0-1724316051445.png

 

2. Locate the main CSS file in your theme, such as `main.css`, `theme.css`, `base.css`, or `style.css`, and add the following CSS code:

#To display title in two lines

 

.featured-collection__products.container .product-details .title {
  width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

 

#Ensure the offer price and original price are on the same line if space allows. Otherwise, they will appear on two lines. */

 

span.price.sale {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

 

#To change the original price color

 

.new-featured-collection-section .product-list .thumbnail .product-details .price span.money {

  color: green;

}

 

 

#To change the size of both prices

 

.new-featured-collection-section .product-list .thumbnail .product-details .price .was_price span.money,
.new-featured-collection-section .product-list .thumbnail .product-details .price span.money {
  font-size: 14px;
}

 

The provided CSS should meet your requirements. However, you may need to adjust the class names to match those used in your theme.

I hope this helps! If it does, please like it and mark it as a solution! 

If you need further assistance, feel free to reach out!

 

Regards,

Sweans

- Was my reply helpful? Please Like and Accept the Solution or let me know by Buying me coffee!
- Want to modify or custom changes on store Hire me.
- Feel free to contact me at info@sweans.com regarding any help.
- To know more about me check out www.sweans.com

clementjaw001
Shopify Partner
25 0 2

Hi Sweans,

 

I have apply all the code above to bass.css, but nothing change.

Sweans
Shopify Partner
398 77 119

Hi,

 

I've updated the class names to better align with your site's structure. Please replace the previous code with the following:

 

 

.card--standard > .card__content .card__information .card__heading a { 
    width: 100% !important; 
    overflow: hidden !important; 
    display: -webkit-box !important; 
    -webkit-line-clamp: 2 !important; 
    -webkit-box-orient: vertical !important;
}

.price--on-sale .price__sale {
    display: flex !important; 
    align-items: center !important; 
    flex-wrap: wrap !important;
}

.price .price-item, span.price-item.price-item--sale {
    font-size: 14px !important;
}

 

 

If the issue persists, please share the store link so I can assist further.

 

I hope this helps! If it does, please like it and mark it as a solution! 

If you need further assistance, feel free to reach out!

 

Regards,

Sweans

- Was my reply helpful? Please Like and Accept the Solution or let me know by Buying me coffee!
- Want to modify or custom changes on store Hire me.
- Feel free to contact me at info@sweans.com regarding any help.
- To know more about me check out www.sweans.com