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

# 站点页眉遮挡 Upcart

> 本文说明如何解决打开 Upcart 小组件时被站点页眉遮挡的问题。

<div id="why-this-happens">
  ### 出现此问题的原因
</div>

在某些 Shopify 主题中，页眉的 **z-index** 高于 Upcart，导致购物车显示在页眉下方。这可能使 Upcart 在客户打开购物车时看起来被部分遮挡或无法访问。

***

<div id="how-to-fix">
  ## 解决方法
</div>

按照以下步骤将 Upcart 置于站点页眉之上：

1. **复制本文底部提供的代码**。
2. 在 Shopify 后台中，打开 Upcart 的 **Cart Editor**，前往 **Settings**，然后选择 **Custom HTML** 选项卡。Settings 是一排选项卡——如果你没有看到 Custom HTML，它位于 **More settings** 中。
3. 点击 **HTML 下拉菜单**并选择 **Scripts (Before Load)**。
4. **将代码粘贴**到该字段中。
5. 点击 **Save changes**。
6. **刷新你的店面**并测试购物车。

完成这些步骤后，购物车应能正确显示在站点页眉之上。

***

<div id="code-required">
  ## 所需代码：
</div>

```
<script>  
	// Find UpCart  
	let upcart = document.querySelector("#upCart");  
  
	// Find the site's body  
	let body = document.body;  
	  
	// If we found both  
	if(upcart && body)  
			// Move upcart to the top of the body's children so it takes priority over site header  
	    body.firstChild.before(upcart)  
</script>
```
