Skip to content

Latest commit

 

History

History
125 lines (81 loc) · 3.48 KB

README.md

File metadata and controls

125 lines (81 loc) · 3.48 KB

Shopify App: Pre Order, Coming Soon and Request for Stock

This Shopify app will help customers to not losing their sells for stock management. After zero stock this app will automatically add those button so that customer can take actions.

Tech Stack

This template combines a number of third party open source tools:

Getting started

Requirements

  1. You must create a Shopify partner account if you don’t have one.
  2. You must create a store for testing if you don't have one, either a development store or a Shopify Plus sandbox store.
  3. You must have PHP installed.
  4. You must have Composer installed.
  5. You must have Node.js installed.

Installing the template

This template runs on Shopify CLI 3.0, which is a node package that can be included in projects. You can install it using your preferred Node.js package manager:

Using yarn:

yarn create @shopify/app --template php

Using npx:

npm init @shopify/app@latest -- --template php

Using pnpm:

pnpm create @shopify/app@latest --template php

This will clone the template and install the CLI in that project.

Setting up your Laravel app

Once the Shopify CLI clones the repo, you will be able to run commands on your app. However, the CLI will not manage your PHP dependencies automatically, so you will need to go through some steps to be able to run your app. These are the typical steps needed to set up a Laravel app once it's cloned:

  1. Start off by switching to the web folder:

    cd web
  2. Install your composer dependencies:

    composer install
  3. Create the .env file:

    cp .env.example .env
  4. Bootstrap the default SQLite database and add it to your .env file:

    touch storage/db.sqlite

    NOTE: Once you create the database file, make sure to update your DB_DATABASE variable in .env since Laravel requires a full path to the file.

  5. Generate an APP_KEY for your app:

    php artisan key:generate
  6. Create the necessary Shopify tables in your database:

    php artisan migrate

And your Laravel app is ready to run! You can now switch back to your app's root folder to continue:

cd ..

Local Development

The Shopify CLI connects to an app in your Partners dashboard. It provides environment variables, runs commands in parallel, and updates application URLs for easier development.

You can develop locally using your preferred Node.js package manager. Run one of the following commands from the root of your app:

Using yarn:

yarn dev

Using npm:

npm run dev

Using pnpm:

pnpm run dev

Open the URL generated in your console. Once you grant permission to the app, you can start development.