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

# 跳转到旧版客户账户的登录页面

> 介绍在使用旧版客户账户的商店中，如何让未登录就点击收藏按钮的客户跳转到旧版登录页面。

未登录的客户点击收藏按钮后，会跳转到 Shopify 新版客户账户的登录页面。在使用旧版客户账户的商店中，只要在模板中添加一段脚本，就会跳转到旧版登录页面（`/account/login`），登录后返回原来的页面。

## 设置方法

在模板的“编辑代码”中打开 `layout/theme.liquid`，在 `</body>` 之前添加以下脚本。

```html theme={null}
<script>
  if (window.multilikesConfig) {
    window.multilikesConfig.loginUrl =
      '/account/login?return_url=' + encodeURIComponent(location.pathname + location.search);
  }
</script>
```

应用的所有收藏按钮都适用（商品、品牌和门店、产品系列、页面、文章）。如果将“未登录时的按钮行为”设为“显示登录提示”，提示中的“登录”按钮也会跳转到同一个页面。

> [!WARNING]
>
> 如果添加在 `{{ content_for_header }}` 之后等 `</head>` 之前的位置，将不会生效。请务必添加在 `</body>` 之前。

## 确认方法

在退出登录的状态下打开商品页面，点击收藏按钮。如果地址栏变为 `/account/login?return_url=...`，就说明设置已完成。

> [!NOTE]
>
> 要在登录后返回原来的页面，登录页面的表单必须是 Shopify 标准的登录表单（`{% form 'customer_login' %}`）。如果您自定义了登录页面，请确认跳转目标页面的源代码中是否包含 `name="return_url"` 输入框。

## 相关页面

* [设置收藏列表页面](https://docs.bouquet-inc.com/zh/apps/multilikes/setup/favorites-list-page.md)
* [MultiLikes API 参考](https://docs.bouquet-inc.com/zh/apps/multilikes/developers/api-reference.md)
* [MultiLikes 常见问题](https://docs.bouquet-inc.com/zh/apps/multilikes/faq.md)


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