If you want to keep your store running but you want to Disable Purchase option offer checkout functionality, you can pause your store in the Shopify Admin (under Themes> Customize > Product Pages). This will make your store “dormant”, which stop offers checkout. To do this, you simply have to write this is to your theme.
Shopify checkout is optimized for mobile and it’s easy to get started. You can customize it to match your store’s look and feel, integrate it with your favorite apps and make selling online easier than ever
before all without making major changes to your store’s backend code.
Shopify checkout is built to be the fastest and easiest way to collect payments from customers. It can be integrated into your own website and apps, or used embedded on a third-party website to
run a checkout process for your products. A successful checkout strategy is critical to acquiring and retaining customers. For instance, Shopify Checkout lets you display product offers after customers have checked out, right before the order confirmation page. This increases your chances at upselling effortlessly.
Editing your theme code to add the Ability to stop purchase feature
- Section directory, open the
product-template.liquid
and find add to cart button, the cart button looks like the following in the debut theme and other themes contains this code<button type="submit" name="add"
:
&amp;amp;amp;amp;lt;div class="product-form__item product-form__item--submit{% if section.settings.enable_payment_button %} product-form__item--payment-button{% endif %}{% if product.has_only_default_variant %} product-form__item--no-variants{% endif %}"&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;button type="submit" name="add" {% unless current_variant.available %} aria-disabled="true"{% endunless %} aria-label="{% unless current_variant.available %}{{ 'products.product.sold_out' | t }}{% else %}{{ 'products.product.add_to_cart' | t }}{% endunless %}" class="btn product-form__cart-submit{% if section.settings.enable_payment_button %} btn--secondary-accent{% endif %}" data-add-to-cart&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;span data-add-to-cart-text&amp;amp;amp;amp;gt; {% unless current_variant.available %} {{ 'products.product.sold_out' | t }} {% else %} {{ 'products.product.add_to_cart' | t }} {% endunless %} &amp;amp;amp;amp;lt;/span&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;span class="hide" data-loader&amp;amp;amp;amp;gt; {% include 'icon-spinner' %} &amp;amp;amp;amp;lt;/span&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;/button&amp;amp;amp;amp;gt; {% if section.settings.enable_payment_button %} {{ form | payment_button }} {% endif %} &amp;amp;amp;amp;lt;/div&amp;amp;amp;amp;gt;
- Add this code above of the button code
{% unless section.settings.disable_cart %}
and add this{% endunless %}
right after the button code. - In the same file find the
{% schema %}
and locate settings, go to the ] in the settings and add the following code right above the ] :
, { "type": "checkbox", "id": "disable_cart", "label": "Disable Purchase", "default": false }
- Congrats you’ve completed the coding part. Now it’s available in the Themes>Customize>product pages. Now you can enable or Disable Purchase option in Shopify the Add to cart button which will Add the ability to stop purchase checkout in your store