Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi together,
I am currently building my online shop and I have a problem with the color of the sold out button, because there is no possibility to define the background color in the theme editor.
But I want to define a grey color if no stock available.
Has anybody an idea how to change it.
Here is the code from the buy-buttons.liquid
<buy-buttons class="buy-buttons {% if show_payment_button %}buy-buttons--has-dynamic{% endif %}" template="{{ product.template_suffix | escape }}" form="{{ form_id }}"> {%- if show_payment_button and atc_button_background == blank and atc_button_text_color == blank -%} {%- assign atc_button_style = 'outline' -%} {%- else -%} {%- assign atc_button_style = 'solid' -%} {%- endif -%} {%- render 'button', content: button_content, type: 'submit', disabled: button_disabled, style: atc_button_style, background: atc_button_background, text_color: atc_button_text_color, stretch: true -%} {%- if show_payment_button -%} {{- form | payment_button -}} <style> #shopify-section-{{ section.id }} .shopify-payment-button { {%- if payment_button_background != blank and payment_button_background != 'rgba(0,0,0,0)' -%} --button-background: {{ payment_button_background.rgb }}; {%- endif -%} {%- if payment_button_text_color != blank and payment_button_text_color != 'rgba(0,0,0,0)' -%} --button-text-color: {{ payment_button_text_color.rgb }}; {%- endif -%} {%- unless product.selected_or_first_available_variant.available -%} display: none; {%- endunless -%} } </style> {%- endif -%} </buy-buttons> </div> {%- endform -%} {%- else -%} <buy-buttons class="buy-buttons" template="{{ product.template_suffix | escape }}" form="{{ form_id }}"> {%- assign button_content = 'product.general.add_to_cart_button' | t -%} {%- render 'button', content: button_content, type: 'submit', background: variant_picker_block.settings.atc_button_background, text_color: variant_picker.settings.atc_button_text_color, stretch: true -%} </buy-buttons> {%- endif -%}
Hey @GurneyBrolin
Could you please provide your Store URL and, if applicable, the Password too? Your cooperation is greatly appreciated!
Best Regards,
Moeed
Hi, sorry but I don't share my password and my Url will not help, because the store is currently not visible, due to that I am still preparing the launch. But if you need some more code information, just tell me.
Hey @GurneyBrolin
I need to have a look on your website to provide you a solution.
Best Regards,
Moeed
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025