Product Title cut between commas

Highlighted
New Member
2 0 0

Structure of the title:

123, Product Name, MPN 934

 

I need to cut the information between commas and show only Product Name

I tried to use split, but doesnt work. Has anybody an suggestion?

 

{{product.title}}

 

Thank you

 

 

0 Likes
Highlighted
Shopify Partner
658 133 153

Hello,

Try this

{% assign split_title = product.title | split: ", " %}

{{ split_title[1] }}
Want to modify or custom changes on store hire me.
My Email: guleriathakur43@gmail.com
Skype: navrocks1
If helpful then please Like and Accept Solution.
If you are happy and want to donate small Click here (Its my paypal)
1 Like
Highlighted
Shopify Expert
1353 111 181

try this

{{ product.title | split: "," | Last }}
Thanks & Regards
Perennial Solution

Problem Solved?✔️Like and Accept the solution that can help others.
Need any help with theme customization or design? Hire us
Shopify Expert Page: https://experts.shopify.com/perennialsolution
Email: infoperennialsolution@gmail.com
Skype: infoperennialsolution
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
0 Likes
New Member
2 0 0

Is it also possible to initiate a check if a title is formatted like this?

 

Product Name, MPN 934

 

If the title doesnt include two commas to cut, otherwise it works on the first version :)

0 Likes
Highlighted
Shopify Partner
658 133 153
{% assign title = product.title %}
{% assign split_title = title | split:", "  %}
{% assign split_size =  split_title.size | minus:1 %} 
{% if split_size >=2 %}
	{{ split_title[0] }}
{% else %}
	{{ title }}
{% endif %}
Want to modify or custom changes on store hire me.
My Email: guleriathakur43@gmail.com
Skype: navrocks1
If helpful then please Like and Accept Solution.
If you are happy and want to donate small Click here (Its my paypal)
1 Like