THEME DEBUT - REMOVING COLOR OPTIONS

Highlighted
New Member
4 0 0

Hi everyone ! I'm new on shopify and I have one question. As you can see my product only have one option for colors so I would like to remove the color option so that the customer won't have to choose the color. Do you know how to do that. I tried some things by editing my code but it doesn't work. Thank you for your help ! I'm using the Debut theme.

 

question shopify.png

0 Likes
Highlighted
Shopify Partner
2213 481 625

Hey @Mo14,

Hope the following post will help you.

https://community.shopify.com/c/Shopify-Design/Hide-Variant-with-one-option-Debut-theme/td-p/551216

 

Thanks!

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
0 Likes
Highlighted
New Member
4 0 0

Thank you for replying. 

But this is not exactly what I'm looking for. On the link you provided, one wanted to hide the whole variant of his product. 

In my case, my product just has one variant but in this variant I want to remove the ''color'' option because the product anyway just has one color. So I don't want the customer to have to choose for the color as you can see one the picture below: 

questions 2.png

 

Do you know how to do it so that the customer doesn't have to choose for the color of the product. Basically I just want the customer to see this without what is crossed out: 

 

question shopify 2.png

0 Likes
Highlighted
Astronaut
1074 173 210

Hello,

Thank you for your question.

Please share:
- your store URL;
- page URL with the issue you mention;
- storefront password (if your store has one).

I'll help you out to the best of my ability.

Kind regards,
Diego

◦ Problem Solved? ✔️ Please click on Accept as Solution and like.
◦ Hire me! Recommended by 25+ customers on Facebook. Click here to read their reviews.
◦ Contact me at: diego.boarutto.fortes@gmail.com
0 Likes
Highlighted
New Member
4 0 0

Hi and thank you for helping me:

This is my store URL: https://breathyy.myshopify.com/

0 Likes
Highlighted
Astronaut
1074 173 210

Hey, @Mo14 

1. In your Shopify Admin go to online store > themes > actions > edit code
2. In your theme.liquid file, find the </body> (press CTRL + F or command + F on Mac)
3. paste this code right above the </body> tag:

 

<script>

function hideColor(){
function getElementsByText(str, tag = 'a') {
  return Array.prototype.slice.call(document.getElementsByTagName(tag)).filter(el => el.textContent.trim() === str.trim());
}

 function _addStyle(styleString) {
        const style = document.createElement('style');
        style.textContent = styleString;
        document.head.append(style);
    }

const el = getElementsByText('Color', 'label');

if (!el) return;

for (var each of el){
each.closest(`.product-form__item`).classList.add(`hidden-option`);
}

_addStyle(`

.hidden-option{display:none !important;}
`);



}

hideColor();

</script>

 




Please let me know whether it works.

Kind regards,
Diego

◦ Problem Solved? ✔️ Please click on Accept as Solution and like.
◦ Hire me! Recommended by 25+ customers on Facebook. Click here to read their reviews.
◦ Contact me at: diego.boarutto.fortes@gmail.com
1 Like
Highlighted
New Member
4 0 0

Thank you @diego_ezfy  !!!

It worked

But now the customer can't choose the quantity as you can see. Is there a way to manage It ? 

 

pblm.png

0 Likes