> For the complete documentation index, see [llms.txt](https://docs.thewalletcrew.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thewalletcrew.io/connectors/e-commerce/prestashop.md).

# PrestaShop

Add Apple Wallet and Google Wallet “Add to Wallet” buttons to a PrestaShop storefront using a module, server-side HMAC signing, and The Wallet Crew SDK.

This guide adds an “Add to Wallet” button to the **My Account** area of **PrestaShop**, for a loyalty or membership pass (or a wallet gift card), using an identifier available in the PrestaShop customer session.

<figure><img src="https://3852727835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlP7d71aYydav6e0pRkxc%2Fuploads%2Fgit-blob-8a12b0912cdde47c7a440aa3bc4a9ba07550c508%2Fimage%20(1)%20(1)%20(1)%20(1)%20(1).png?alt=media" alt="PrestaShop My Account page showing an Add to Wallet button next to the loyalty information"><figcaption><p>Target result: one “Add to Wallet” button rendered for the logged-in customer in My Account.</p></figcaption></figure>

PrestaShop storefront customization is usually done through **modules** and **theme overrides**. This guide focuses on a module-based approach to keep secrets server-side and keep the integration maintainable during theme updates.

## How it works

The SDK, the HMAC rule, caching and CSP are explained in [How the Add to Wallet button works](https://docs.thewalletcrew.io/connectors/e-commerce.md#how-the-add-to-wallet-button-works). This guide uses the PrestaShop customer id as the external identifier key `prestashop.customerId`.

## Prerequisites

* A pass template and pass issuance already configured in The Wallet Crew.
* The Wallet Crew tenant id available (used by the SDK script URL).
* A stable identifier available on authenticated pages.
* An external identifier key name agreed during onboarding.

The stable identifier is often the PrestaShop customer id. A project can also use a CRM id if it is stored on the customer entity and stays stable over time.

## Where the button goes

Common placements are:

* The **My Account** dashboard, next to the loyalty or membership number.
* A dedicated **Wallet / Loyalty** page in the account area.
* A gift card list page, with one button per gift card.

Hook availability depends on the theme and PrestaShop version. Many projects use a module hook for the account dashboard. Some projects use a theme override to place the button in a specific section.

## Setup steps

{% stepper %}
{% step %}

#### Choose the external identifier contract

Identifier keys should stay stable over time (example: `prestashop.customerId`). In the attribute, the key is written `prestashop.customer_Id`: see [How the Add to Wallet button works](https://docs.thewalletcrew.io/connectors/e-commerce.md#how-the-add-to-wallet-button-works). The prefix `neostore` is the platform's former name and is kept in technical identifiers.

{% hint style="info" %}
If The Wallet Crew tenant already uses a mixed-case key, changing it can affect existing installations. Treat this as a migration topic.
{% endhint %}
{% endstep %}

{% step %}

#### Store tenant configuration and secret server-side

The tenant id can be used client-side. The HMAC secret must remain server-side.

Common approaches in PrestaShop deployments are:

* Environment variables injected by the hosting platform.
* A server-side configuration store managed by the module, with strict access control in the PrestaShop back office.
  {% endstep %}

{% step %}

#### Build a small module that renders the button

The module typically:

* Registers on an account-related hook, or provides a small controller for a dedicated account page.
* Reads the logged-in customer id from the session context.
* Computes the HMAC using the server-side secret.
* Assigns tenant id, pass template, identifier value, and HMAC to the template variables.
  {% endstep %}
  {% endstepper %}

## Validate the result

Follow the [validation steps](https://docs.thewalletcrew.io/connectors/e-commerce.md#how-the-add-to-wallet-button-works) of the e-commerce overview.

## Troubleshooting

See the [troubleshooting checks](https://docs.thewalletcrew.io/connectors/e-commerce.md#troubleshooting) of the e-commerce overview.

## FAQ

<details>

<summary><strong>Does this require a custom PrestaShop module?</strong></summary>

A theme override can be enough when server-side values are already available in the template context. A dedicated module is usually preferred. It keeps HMAC computation out of theme templates and centralizes secret loading.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.thewalletcrew.io/connectors/e-commerce/prestashop.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
