How to Install Sharpei into Prestashop
Lucia clifford avatar
Written by Lucia clifford
Updated over a week ago

Sharpei has been built on the idea of being compatible with any type of technological stack, however, we understand most shops are based on certain platforms; therefore, we are working on developing out-of-the-box plugins. This should be completed by Q1 of 2024. Meanwhile, here are the instructions to install Sharpei in Prestashop.

Get the Codes from your "Back Office" in Sharpei

  1. Log in to your Sharpei Back Office at app.gosharpei.com

  2. Navigate to your Admin portal to get the codes clicking on the right hand user icon

3. Go to the "Embed checkout" tab

4. Copy the API KEY and add it to the checkout code installation where it says "INSERT API KEY":

That should look something like this:

<script type="text/javascript">    var APP_ID = "$2y$10$GJXbd0i2NQXWlsCw6lcxGeB7qNF89eoDpyjyDx1fgmdZSVFO91oe6"; window.sharpeiSettings={app_id:APP_ID},function(){var t=window,e=t.Sharpei;if("function"==typeof e)e("reattach_activator"),e("update",t.sharpeiSettings);else{var a=document,n=function(){n.c(arguments)};n.q=[],n.c=function(t){n.q.push(t)},t.Sharpei=n;var r=function(){var t=a.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://appdev.gosharpei.com/widget/sharpei-button.min.js";var e=a.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e)};"complete"===document.readyState?r():t.attachEvent?t.attachEvent("onload",r):t.addEventListener("load",r,!1)}}();</script>

5. Save this value as you will need this later.

6. Copy the this html:

<!-- SHARPEI --><sharpei-button product-id="{$product.id}"></sharpei-button>

Access your Prestashop through FTP

  1. Make a backup copy of the files you will be changing, you never know if a change could potentially break the website so make sure you create a backup of the pages you will be changing.

  2. Navigate to:

public_html/webs/YOURWEBSITENAME/themes/YOURWEBISTETHEME/templates/_partials/javascript.tpl

2. Copy the code we saved before and paste it at the end of the file. This is the code that will insert the necessary javascript on the page, however, you still have to add the HTML in the product page where we want it to show.

3. Navigate to:

public_html/webs/YOURWEBSITENAME/themes/YOURWEBISTETHEME/templates/catalog/product-add-to-cart.tpl

4. Inside of the file, search for the 'Add to cart' button and paste the html there.

5. Save the file and navigate to your website, check the Network to see if the JS is running. Search for validate_api_key . If you find that, and it returns a 200, it means the js is injecting properly.

6. If you haven't already configured your remote_ids to your Sharpei backoffice for the HTML to run. The button will not show unless its Active and the remote_id matches that of the product.id in prestashop.

Did this answer your question?