Remove Add to Cart Button for Non-Registered Users Impulse theme

I operate a wholesale website using the Impulse theme. I would like to restrict the “Add to Cart” functionality so that it’s only available to registered users with an account. However, I’m having trouble locating the specific section of code that renders the “Add to Cart” button.

Could you please provide guidance on:

  1. The file or section of code responsible for rendering the “Add to Cart” button
  2. How to modify this code to hide or disable the button for non-registered users

Your assistance in this matter would be greatly appreciated.

Thank you for your help.

Hello @pommedeterre

You need to disable add to cart button on product page or at everywhere where it says “Add to Cart” ?

Find the file named “buy-buttons.liquid” in snippets if your theme contains this file. Usually Add to cart button placed in this file.

I can check it and fix it. but for that i need the access of your admin so i can check and make changes in code side to fix your issue.

Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution.

Best Regards

Parth ghelani

Hello @pommedeterre

This needs to be handled through code

  1. From your Shopify admin, navigate to Online Store > Themes.

  2. Click Actions > Edit code.

  3. Navigate to product-form.liquid file

  4. Search for “add-to-cart

  5. Now replace the existing button with below code

    {% if customer %}
    <button
    {% if product.empty? %}
    type=“button”
    {% else %}
    type=“submit”
    {% endif %}
    name=“add”
    data-add-to-cart
    class=“btn btn–full add-to-cart{% if enable_dynamic_buttons and product.selling_plan_groups == empty %} btn–secondary{% endif %}”
    {% unless current_variant.available %}
    disabled=“disabled”
    {% endunless %}

    {{ button_text }} {% else %} {{ button_text }} {% endif %}

    I hope this solution meets your needs.
    Thank you!!