Add Payhip to Shopify

Got a Shopify store that you’d like to integrate with your Payhip store? No problem! This article outlines some different ways that you can do just that.

Embed a Payhip button on Shopify

You are able to embed a Payhip button on your Shopify store. This will enable customers to buy your Payhip products without leaving the page.

The Payhip-generated buttons are only available for digital and physical products right now. To link another kind of product to Shopify, see the next section.

Step 1. Get the embed code

Head to Products in your admin dashboard and click Share / Embed for your product.

Go to the Embed Button tab of the window that appears.

A screenshot of the Share / Embed window for a product on Payhip

From here, you can customize the button’s text, color, and type. There are two types of button that you can create:

  • Direct Purchase – Will direct the user straight to checkout for the product.
  • Add to Cart – Will add the product to the user’s cart. They’ll be able to add other products before purchasing.

Once you’re done creating your button, click Get Your Embed Code. This will give you two snippets of code (JavaScript and HTML) that you need to add to your Shopify store.

A screenshot of the Embed Code window on Payhip showing two snippets of code (HTML and JavaScript)

Step 2. Add the JavaScript to your Shopify theme

Copy the JavaScript snippet and then head on over to your Shopify dashboard.

Under Sales channels, click Online Store, and make sure you’re on the Themes tab.

A screenshot of the Themes tab on Shopify

Click the three-dot icon for your current theme and choose Edit code.

A screenshot of the three-dot menu for a Shopify theme with the cursor hovering over Edit Code

This will load up your Shopify theme. It might look a little intimidating, but don’t worry! We’ll walk you through what to do…

Over on the left-hand side, go to theme.liquid.

A screenshot of the theme editor in Shopify with the cursor hovering over the theme.liquid page

Find the closing </head> tag. (A quick way to do this is to hit Control / Command + F and search for </head>)

Paste the JavaScript snippet you got from Payhip just before the closing </head> tag and click Save.

A screenshot of the theme.liquid page in Shopify's code editor

Step 3. Add the button to your page

Click the Exit button at the top left of the screen to go back to your Themes page. Then click Customize to open up your store editor, and navigate to the page that you want to add the button to.

Click Add section and choose the Custom Liquid option.

A screenshot of the Add section menu on Shopify with the cursor hovering over the Custom Liquid option

Paste the second snippet of code from Payhip into the Custom Liquid field.

A screenshot of editing the Custom Liquid section type on Shopify

Save your changes, and you’ll see your button appear in the preview pane on the right.

A screenshot of a Payhip button embedded on Shopify

You can use HTML around the embed code; e.g. to center the button put <center> tags around it.

Add a link to Shopify

If you don’t mind directing people away from Shopify and over to Payhip to purchase, then the easiest way to integrate your Payhip store with Shopify is to link to your product sales page or checkout on Payhip.

Link to the product sales page

To find the URL for your product sales page, just click Products at the top of your admin dashboard, then find the product you’d like to promote and click Share / Embed.

A screenshot of a product on the Products page in Payhip with the cursor hovering over the Share / Embed button

Link directly to checkout

If you want to skip the Payhip product sales page, then you can send people directly to checkout.

For digital and physical products, here’s how to get the direct checkout link: Direct Checkout Link

For courses, memberships, coaching, and bundles head to the Pricing tab and click Copy URL for your chosen pricing plan.

A screenshot of the Pricing tab for a Payhip product with the cursor hovering over the Copy URL link

Embed a page on Shopify

For digital and physical products, you can also embed your full product sales page on Shopify if you’d like to. 

To do that, find the product you want to promote, click Share / Embed, and go to the Embed Page tab.

A screenshot of the Embed Page tab of the Share / Embed window for a Payhip product

Copy the code from the Embed code field and head on over to Shopify and the page to which you want to add the embed to.

Click Add Section and choose the Custom Liquid option.

A screenshot of the Add section menu on Shopify with the cursor hovering over the Custom Liquid option

Paste your embed code into the Custom Liquid field. Once you’ve saved your changes, you’ll see your page embedded.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.