All Collections
Add a buy button in Shopify
Add a buy button in Shopify

In this article we show you how to set up a buy button from Shopify to your store with Publish.

Lara Macarena Sastre avatar
Written by Lara Macarena Sastre
Updated over a week ago

To perform this configuration you will need to have a Publica content store and a Shopify store. Before moving forward, create your store and choose the content following each step.

1. Go to your Shopify store > Applications:

2. Click on " See more apps in this collection ":

Screen Shot 2021-06-16 at 00.42.44


3. Search for " Outlink " in the Shopify app store:

Screen Shot 2021-06-16 at 00.36.21

Click on the application and add it (Add app)

Now you have Outlink in your applications:

4. Go to Online Store. Click the " Actions " dropdown menu:


Select " Edit the code ." The following view will open:

Look in the Sections folder for the component " product-template.liquid "

5. Now we will look for the code snippet that we need to edit. Press CTRL+F (Windows, Linux and Chrome OS) or ⌘ + F (Mac), a search box will open:

There you will have to write " add_to_cart " to find the following snippet:



6. Below the button's closing tag (</button>) and just before the if, we need to add a line of code that will enable the button to the store.

The code you must enter is:

It will look like this:

7. Click Save :

Screen Shot 2021-06-16 at 01.07.07

8. Go to Products and click Add Product:

9. Complete the fields and click Save:

10. Click on " More actions " and click on Outlink :

11. A new tab will open where you must edit the text of the button and place the link to the store . Remember to click Activate (On) and Save (Save)

Make sure it is enabled from Bulk Editor > Via search :

12. You can see in the preview the button you added:

Ready! 🙌🏼 You have added the buy button from Shopify to your Post store.

Here we share the link to the Shopify help center, do not hesitate to contact their Support team in case you need assistance.

We hope this tutorial has been easy for you and if you have any further questions write to us at [email protected]

Did this answer your question?