EG Theme Snippets
HomeNew Snippets ⭐️
  • Introduction
  • GETTING STARTED
    • Installation
    • No Refunds
    • CONFIGURING SNIPPETS
      • MegaMenu
      • Custom HTML & Custom Liquid
      • Sticky Video
      • Age Verification Check
      • Scroll Bar Color
      • Promo Slider
      • Upsell Checkbox
      • Color Swatches
      • Accordion Footer
      • Testimonials
      • Sticky Add-To-Cart
      • Marquee
      • Stock Bar Indicator
      • EG Animated Stories
      • Qty Breaks
      • Testimonials
      • Dawn Cart Goal
      • Frequently Bought Together
      • Trust Badges
      • FAQ Section
      • WhatsApp Chat Box
      • Before and After Slider
      • Advanced Announcement Bar
      • Dawn PDF Invoice Generator Snippet
      • Dawn Theme Sales Pop
      • Payment Calculator Snippet
      • Custom Line Item Properties
      • Parallax Media
    • FREE RESOURCES
      • Email Marketing
      • Shopify Critical Css Generator
      • Ways To Increase Conversions
  • FREE CODE NUGGETS
    • PRE-ORDER CODE TO SHOPIFY
Powered by GitBook
On this page

Was this helpful?

  1. FREE CODE NUGGETS

PRE-ORDER CODE TO SHOPIFY

To write a pre-order code for Shopify, you can follow these steps:

  1. Open the Shopify admin page and go to the "Products" section.

  2. Click on the product that you want to enable pre-orders for.

  3. In the product details page, scroll down to the "Inventory" section and enable the "Allow customers to purchase this product when it's out of stock" option.

  4. Save the changes to the product.

  5. To display the pre-order information on the product page, you can use the following code snippet:

{% if product.available %}
  In stock
{% else %}
  Pre-order now
{% endif %}

6. You can also customize the message that appears for pre-orders by modifying the code snippet. For example, if you want to display the estimated date when the product will be back in stock, you can use the following code:

{% if product.available %}
  In stock
{% else %}
  Pre-order now (estimated restock date: {{ product.variants.first.next_incoming_date }})
{% endif %}

7. Save the changes to your theme and the pre-order information will be displayed on the product page.

Keep in mind that you can also customize the pre-order process by setting up inventory alerts, inventory policies, and email notifications for pre-ordered products. For more information, you can check out the Shopify documentation.

PreviousFREE CODE NUGGETS

Last updated 2 years ago

Was this helpful?