How To Build Shopify Apps with PHP

How To Build Shopify Apps with PHP (Update 2019)

  Shopify

Learn how to create Shopify apps using PHP and Shopify API

Introduction

We are aware that there are hundreds of PHP tutorials online on how to create a Shopify app using PHP, but in this course, we’ll tackle all the components that you may want to add to your Shopify app like displaying products and such.

Now before we proceed, Shopify made an update with their API where they version their API quarterly also known as API versioning. It is important to know that Shopify will always make updates to their API so if you are developing Shopify apps, then you should also keep your apps updated.

What is Shopify PHP?

There’s no such thing called “Shopify PHP”, but to make it understandable to you. PHP is a programming language for web development that can be used to develop a Shopify app. Though there are PHP Frameworks that you can use as well to build a Shopify app like Laravel.

 

Is it hard to do Shopify App Development?

Building your own Shopify Apps is very easy, all you need is to understand how the API works. Shopify is a Rails application, there are lots of Shopify repository that you can use for FREE to integrate your website to Shopify API. Here’s the list:

Personally, I use this Shopify API Client made by Alex here:
Shopify Generating API Token Guide

To begin, you have to create a new Shopify app in your Shopify Developer account, so if you don’t have an account yet, you can sign up by visiting developers.shopify.com

Shopify App Development Tutorial PHP - WeeklyHow

Building Your Own Shopify App with PHP

In this article, we’re going to learn how to make a Shopify application from the scratch using PHP, if you already have a Shopify developer account this is the first page you’re going to see:

Developer Shopify Dashboard
Developer Shopify Dashboard

Proceed to left navigation panel and click the Apps category

Shopify App Development Tutorial PHP

Click Create app and fill out the forms like this:

Shopify App Development Tutorial PHP
Create Shopify App Form

App Name – The name of the Shopify application you’re about to create.
App URL – The URL of your website where you’re going to upload your Shopify files
Whitelisted Redirection URL(s) – This is where you’re going to list your generate token script or URLs you need as you Authenticate your Shopify.

Example:

Image of Shopify App Development using PHP

Once you’re done, filling the form, click Create app

Image of Shopify App Development using PHP
Here’s everything you need to start building your Shopify App

Now that we have our first Shopify app created, it’s time to make our website connected using these API credentials. To do this, download at least one of the Shopify repositories that I have provided in this article.

Create Shopify Apps for Storefront

Customize and add more features to your Shopify store using Shopify apps!

To continue with this project, you may proceed to this article.

In part 2, we’ll be using the credentials that we have to connect it to PHP. If you’re interested, proceed to this article below:

 

React to this topic
Bernard Polidario
About Bernard Polidario

A full-stack developer who has been around programming community for 10+ years and still has a lot of passion for programming and design. I am the founder of WeeklyHow and I can be reached at [email protected]

https://weeklyhow.com

6 comments on How To Build Shopify Apps with PHP (Update 2019)

  1. Hi! Do you know how to add product with variants & images?

    I have this array :

    Array
    (
    [product] => Array
    (
    [title] => TITLE
    [body_html] => DESCRIPTION
    [vendor] => TESTSTORE
    [product_type] =>
    [tags] =>
    [published] => 1
    [variants] => Array
    (
    [0] => Array
    (
    [price] => 1160
    )

    )

    [images] => Array
    (
    [0] => Array
    (
    [src] => urlofimage.jpg
    )

    [1] => Array
    (
    [src] => urlofimage.jpg
    )

    )

    )

    )

    But it does not add the price and images of the product when shopify_call is called. Thanks!

    1. Hi Raff,

      Thank you for reaching out to us!

      Are you referring to displaying product prices and images?
      If so, you may read this article, we have explained here how to use Product API.
      https://weeklyhow.com/how-to-display-product-price-using-shopify-api/

      However, if you’re talking about adding products to the store. You may use POST instead of GET and send an array of product data.

      We’d love to help you more! If you have more questions or issues, please don’t hesitate to let us know.

      Regards,
      Jeremy

  2. Thanks for sharing the information. It was really helpful.
    Can you please also write article on uninstall of Shopify app?
    Thank you very much. ๐Ÿ™‚

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*
*