Getting the colour of my product in brackets in the title on my collection pages

I have been trying to find out how I can get the colour to show in the shopping tiles on my website in brackets at the end of the title, for example “Compact Folding Desk (Grey)” but for the actual title of the product on the product page when you click into it to stay as “Compact Folding Desk”

another website we have been getting some inspiration from have got it similar to how we would like it "https://www.rinkit.com/search?q=desk" in that link it shows the product tiles with the colours in brackets at the end but if you click into the products the colour disappears from the title and it just shows the variants "https://www.rinkit.com/products/harbour-housewares-laptop-computer-desk?variant=41842224464059"

I am using the warehouse theme, if anyone could help or has any ideas it would be greatly appreciated

Hi @Cardys ,

Please follow these steps:

Go to snippets > product-item.liquid file, find ‘product.title’ and add code: https://i.imgur.com/Q0dV26c.png

{%- for product_option in product_card_product.options_with_values -%}
{%- if product_option.name == ‘Colour’ || product_option.name == ‘colour’ -%}
({% for value in product_option.values %}{{ value }}{% unless forloop.last == true %}/ {% endunless %}{% endfor %})
{%- endif -%}
{%- endfor -%}

Hope it helps!

If my answer can help you solve your issue, please mark it as a solution. Thank you and good luck.

I have just pasted the code below the line that includes “product.tite” and it has not worked, it has turned all of my product pages to code instead of images and text, is there anywhere specific I am meant to put this code so it works?

Sorry, please change:

product_card_product.options_with_values => product.options_with_values

A mistake, everything will work fine.

If my answer can help you solve your issue, please mark it as a solution. Thank you and good luck.

@LitExtension

Thank you for your help but it still appears to be doing the same thing, could you possibly post another picture of how the code is meant to be arranged to make sure I am not making a mistake, I have done exactly what you have said though and am still having no luck.

You can send the staff account to the email: namphan992@gmail.com . I will check it