> ## Documentation Index
> Fetch the complete documentation index at: https://foliant-help.iforiti.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 从 Order Printer 导入模板

> 粘贴或上传来自 Shopify Order Printer 或 Order Printer Pro 的模板，查看 Foliant 转换的内容，并将其创建为新模板。

# 从 Order Printer 导入模板

![从 Order Printer 导入模板对话框](https://mintcdn.com/foliant-dev/nnNby4-r9e5xN6eK/templates/images/import-from-order-printer.png?fit=max\&auto=format\&n=nnNby4-r9e5xN6eK\&q=85\&s=68121591400fb17c0e627e839faae0b9)

如果您正从 Shopify Order Printer 或 Order Printer Pro 迁移过来，可以将您的模板导入 Foliant。粘贴模板代码或拖入模板文件，Foliant 会转换不同的变量。保存之前，它会显示更改了什么、移除了什么以及需要您处理的内容，并附上文档预览。

导入始终会创建一个新模板，绝不会覆盖您已有的模板。

## 开始之前

从您要迁移的应用中复制模板代码，或将其保存为文件。导入窗口中的 **如何复制你的模板** 链接会说明具体方法。

## 导入模板

1. 前往 **模板**，点击 **导入模板**。您也可以点击 **模板设置** 底部的 **Import your templates**。
2. 在 **从 Order Printer 导入模板** 中，您可以：
   * 将代码粘贴到 **模板代码** 中，或
   * 将 `.liquid`、`.html` 或 `.txt` 文件拖到 **或拖入 .liquid、.html 或 .txt 文件** 上。
3. 在 **导入来源** 中，保留 **自动检测**，或选择 **Shopify Order Printer**、**Order Printer（旧版）** 或 **Order Printer Pro**。
4. 在 **文档** 中，如果模板是 **发票**、**贷记单** 或 **报价单**，请选择对应项，这样它会被编号。否则请保留 **其他单据**。
5. 输入 **模板名称**。如果留空，模板将命名为“Imported template”。拖入文件时，会使用该文件的文件名。
6. 点击 **转换**。

## 查看转换结果

Foliant 会在 **用示例订单预览** 旁边显示一份报告。

* 第一行会说明模板来自哪个应用，并显示“Everything was converted.”或需要处理的项目数量。
* 更改按 **需要处理**、**更改内容**、**已移除** 和 **布局** 分组，每项都附有它在您模板中的行号。

您可能会看到的常见原因：

| 原因 | 含义 |
| - | - |
| Foliant has no such variable: it prints blank. | 该变量在 Foliant 中不存在。保存后请替换或移除它。 |
| Probably this; check it prints the same, then change it. | Foliant 建议了最接近的匹配项。 |
| A storefront tag: documents can't use it. | 主题标签在文档中无法使用。 |
| A storefront filter: removed with what it printed. | 主题过滤器已被移除。 |
| A snippet Foliant doesn't have. | 模板引用了 Foliant 找不到的代码片段。 |
| The page around the document was dropped; its styles were kept. | 只保留了文档本身。 |
| The page break at the end was dropped: documents start on a new page anyway. | 您无需进行任何操作。 |
| Foliant's date filter doesn't print this part of a date format. | 请检查日期的打印效果。 |

如果模板暂时还无法打印，预览中会显示“It doesn't print yet: fix the items below after saving.”

点击 **返回** 可修改您的模板代码或选项，然后重新转换。

## 创建模板

1. 点击 **创建模板**。Foliant 会显示“Template imported”。
2. 新模板的设置页面会打开。请选择它在哪里被预选以及谁会收到它。请参阅[模板设置](https://foliant-help.iforiti.com/cn/templates/template-settings.md)。
3. 打开 **编辑模板**，修复所有需要处理的内容。请参阅[编辑模板代码](https://foliant-help.iforiti.com/cn/template-editor/code-editor.md)。

## 须知

* 模板最大为 512 KB。更大的文件会显示“The template is larger than 512 KB.”
* 如果文件不是文本模板，Foliant 会提示“That file isn't a text template.”
* 如果在您查看之后、点击 **创建模板** 之前转换结果发生了变化，Foliant 会显示新的转换结果，并请您再次检查。
* 导入会以 **已导入** 的形式保存在模板的版本历史中。请参阅[版本历史](https://foliant-help.iforiti.com/cn/templates/version-history.md)。
* 与任何新模板一样，导入的模板在您做出选择之前不会在任何地方被预选。

## 相关文章

* [创建模板](https://foliant-help.iforiti.com/cn/templates/create-a-template.md)
* [模板设置](https://foliant-help.iforiti.com/cn/templates/template-settings.md)
* [编辑模板代码](https://foliant-help.iforiti.com/cn/template-editor/code-editor.md)
* [入门指南](https://foliant-help.iforiti.com/cn/getting-started.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.