> ## 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.

# 장바구니에 한 번에 하나의 업셀만 허용하기

> 커스텀 HTML을 사용해 업셀 하나가 장바구니에 추가된 후 업셀 모듈을 숨기세요.

<div id="overview">
  # 개요
</div>

이 커스터마이징은 업셀 하나가 수락되는 즉시 업셀 섹션을 숨겨 여러 업셀이 한꺼번에 추가되는 것을 방지해요. 업셀이 제거되면 모듈이 다시 나타나요.

다음을 원할 때 유용해요:

* 장바구니 경험 단순화
* 결정 피로 줄이기
* 특정 오퍼의 독점성 유지

***

<div id="how-it-works">
  ## 작동 방식
</div>

* 고객이 업셀을 수락하면 업셀 섹션이 숨겨져요
* 업셀 상품이 제거되면 업셀 섹션이 다시 표시돼요
* AI 추천 업셀과 수동 업셀 모두에서 작동해요

***

<div id="where-to-add-the-code">
  ## 코드를 추가할 위치
</div>

1. **Upcart > Cart Editor > Settings > Custom HTML**로 이동하세요

<Warning>
  **아래 선택자는 버전 1 전용이에요.** `.upcart-upsells-module`은 V1 업셀 캐러셀에 있어요. Upsells 모듈이 **버전 2**에 있다면 세 개의 핸들러 모두에서 `.upcart-public-upsell`로 교체하세요 — 나머지 스크립트는 그대로예요. [V2 CSS 선택자 라이브러리](/ko/upcart/upcart_css_selector_library_v2)를 참고하세요.
</Warning>

2. 다음 코드를 **Above announcements/rewards** 위치에 붙여넣으세요

***

<div id="html-script-to-copy">
  ## 복사할 HTML 스크립트
</div>

```
<script>  
  // Show upsells again when upsells are removed  
  window.upcartSubscribeItemRemoved((event) => {  
    if (event.item?.properties?.__upcartUpsell) {  
      const upsells = window.upcartDocumentOrShadowRoot.querySelector(".upcart-upsells-module");  
      if (upsells) upsells.style.display = "block";  
    }  
  });  
  
  // Hide upsells once one is added  
  window.upcartSubscribeUpsellsAddedToCart(() => {  
    const upsells = window.upcartDocumentOrShadowRoot.querySelector(".upcart-upsells-module");  
    if (upsells) upsells.style.display = "none";  
  });  
  
  // Check for upsell in cart when it loads  
  window.upcartSubscribeCartLoaded((event) => {  
    const upsells = window.upcartDocumentOrShadowRoot.querySelector(".upcart-upsells-module");  
    const items = event.cart.items || [];  
    const hasUpsell = items.some(item => item?.properties?.__upcartUpsell);  
    if (upsells && hasUpsell) {  
      upsells.style.display = "none";  
    }  
  });  
</script>
```

<Note>
  **레거시 참고:** `window.upcartOnItemRemoved`, `window.upcartOnAddUpsell`, `window.upcartOnCartLoaded` 콜백은 여전히 작동하지만 더 이상 사용되지 않으며(deprecated) 콘솔 경고를 기록해요. 모든 새 스크립트에는 `upcartSubscribeItemRemoved`, `upcartSubscribeUpsellsAddedToCart`, `upcartSubscribeCartLoaded`를 사용하세요.
</Note>

***

<div id="result">
  ## 결과
</div>

이 커스터마이징을 추가하면:

* 고객은 아직 업셀을 수락하지 않은 경우에만 업셀을 볼 수 있어요
* 업셀이 추가되는 즉시 업셀 모듈이 숨겨져요
* 업셀 상품이 제거되면 모듈이 자동으로 다시 나타나요
* 제품 ID나 태그를 구성할 필요가 없어요

이렇게 하면 업셀 경험이 집중적이고 깔끔하며 고객이 참여하기 쉬워져요.

***

<div id="still-need-help">
  ## 여전히 도움이 필요하신가요?
</div>

더 고급 커스터마이징의 경우 **Shopify Expert**와 함께 작업하시는 것을 권장해요. 장바구니 드로어 내부의 HTML, CSS, JavaScript 작업을 도와드릴 수 있어요.

[Shopify Experts 보기](https://www.shopify.com/partners/directory)
