# 把 Shoprocket 添加到 Ghost 网站

> 在你的 Ghost 站点上销售。在文章或页面中添加 HTML 卡片，粘贴嵌入代码并发布。在 Code injection 中添加一行代码，购物车就能在整个网站上使用。

帮助中心 / 嵌入 - 更新于 2026年11月19日

你可以用 Shoprocket 在 Ghost 站点上销售，就在你的文章和页面里。你在 Shoprocket 中创建嵌入，再把它的代码粘贴到 **HTML** 卡片中。购物车和结账在你自己的网站上打开。

## 开始之前

- 在 Shoprocket 中至少添加一件启用状态的商品。
- 你需要有编辑文章或页面的权限。第 3 步还需要你能访问网站的设置。

## 第 1 步：获取嵌入代码

1. 在 Shoprocket 后台进入 **嵌入**，点击 **新建嵌入**。
2. 选择显示内容和布局，然后点击 **继续**。博客文章很适合使用 **卡片** 布局的单个商品。
3. 点击 **保存并获取代码**，再点击 **复制代码**。

![“获取代码”面板，包含建站工具标签页、嵌入代码和“复制代码”按钮](https://shoprocket.io/img/help/embed-on-any-website/get-code.webp)

想了解可选的布局，请参阅[在任何网站上嵌入 Shoprocket](https://shoprocket.io/zh/help/embed-on-any-website.md)。

## 第 2 步：把代码粘贴到 HTML 卡片中

1. 在 Ghost 编辑器中打开文章或页面。
2. 在店铺要显示的新一行，点击 **+** 按钮并选择 **HTML**。你也可以输入 `/html`。
3. 把你的代码粘贴到卡片中。
4. 点击 **Publish** 或 **Update**。

请在你的线上网站上打开这篇文章查看店铺。编辑器里显示的是代码，而不是店铺。

如果你把文章作为邮件通讯发送，邮件里只会显示文字和图片。邮件应用不会运行店铺代码，所以请附上文章链接，方便想购买的读者点进去。

## 第 3 步（推荐）：把 Shoprocket 添加到整个网站

你的悬浮购物车和在线聊天只会显示在加载了 Shoprocket 的页面上。在网站页头放一行代码，就能让每个页面都加载它。

1. 在 **嵌入** 中，点击**把 Shoprocket 添加到你网站的每个页面** 卡片上的 **复制**。
2. 在 Ghost 中，依次打开 **Settings**、**Code injection**。
3. 把这一行粘贴到 **Site header** 框中，点击 **Save**。
4. 打开你网站的任意页面。回到 **嵌入**，卡片的状态会从 **尚未检测到** 变为 **已连接**。

这一行放进站点页头之后，每篇文章里只需粘贴嵌入代码的最后一行，也就是以 `<div` 开头的那一行。

## 如果店铺没有显示

- **卡片设为仅会员可见。** HTML 卡片可以设为只对免费会员或付费会员显示。如果有些读者看不到店铺，请检查卡片的可见性。
- **你粘贴到了 Markdown 或文本卡片中。** 请使用 **HTML** 卡片，这样 Ghost 才会原样保留代码。

## 相关文章

- [在任何网站上嵌入 Shoprocket](https://shoprocket.io/zh/help/embed-on-any-website.md)
- [嵌入一个商品或一个分类](https://shoprocket.io/zh/help/embed-a-single-product-or-category.md)
- [替换你的旧版 Shoprocket 代码](https://shoprocket.io/zh/help/replace-old-shoprocket-code.md)

[在后台打开“嵌入”](https://app.shoprocket.io/go/embeds)

---

- HTML version: https://shoprocket.io/zh/help/add-shoprocket-to-ghost
- Language: 中文 (zh)
- Also in: [العربية](https://shoprocket.io/ar/help/add-shoprocket-to-ghost.md), [Deutsch](https://shoprocket.io/de/hilfe/shoprocket-zu-ghost-hinzufuegen.md), [Ελληνικά](https://shoprocket.io/el/help/add-shoprocket-to-ghost.md), [English](https://shoprocket.io/help/add-shoprocket-to-ghost.md), [Español](https://shoprocket.io/es/ayuda/anadir-shoprocket-a-ghost.md), [Français](https://shoprocket.io/fr/aide/ajouter-shoprocket-a-ghost.md), [עברית](https://shoprocket.io/he/help/add-shoprocket-to-ghost.md), [हिन्दी](https://shoprocket.io/hi/help/add-shoprocket-to-ghost.md), [Bahasa Indonesia](https://shoprocket.io/id/bantuan/tambahkan-shoprocket-ke-ghost.md), [Italiano](https://shoprocket.io/it/aiuto/aggiungere-shoprocket-a-ghost.md), [日本語](https://shoprocket.io/ja/help/add-shoprocket-to-ghost.md), [Lietuvių](https://shoprocket.io/lt/pagalba/shoprocket-ghost-svetainei-prideti.md), [Norsk](https://shoprocket.io/nb/hjelp/legg-til-shoprocket-i-ghost.md), [Nederlands](https://shoprocket.io/nl/hulp/shoprocket-toevoegen-aan-ghost.md), [Polski](https://shoprocket.io/pl/pomoc/dodaj-shoprocket-do-ghost.md), [Português](https://shoprocket.io/pt/ajuda/adicionar-shoprocket-ao-ghost.md), [Română](https://shoprocket.io/ro/ajutor/adauga-shoprocket-pe-ghost.md), [Русский](https://shoprocket.io/ru/help/add-shoprocket-to-ghost.md), [ไทย](https://shoprocket.io/th/help/add-shoprocket-to-ghost.md), [Türkçe](https://shoprocket.io/tr/yardim/shoprocket-ghost-sitesine-ekleme.md)
