Skip to content

🐛 Suppress WebChat Cart UI on VTEX Storefronts#88

Merged
cristiantela merged 1 commit intov3-mainfrom
fix/old-cart-mention-in-VTEX-context
Apr 17, 2026
Merged

🐛 Suppress WebChat Cart UI on VTEX Storefronts#88
cristiantela merged 1 commit intov3-mainfrom
fix/old-cart-mention-in-VTEX-context

Conversation

@cristiantela
Copy link
Copy Markdown
Collaborator

Description

Type of Change

    • Bugfix
    • Feature
    • Code style update (formatting, local variables)
    • Refactoring (no functional changes, no api changes)
    • Tests
    • Other

Motivation and Context

When the webchat is embedded inside a VTEX storefront, the store already provides its own native cart UI. Showing the webchat's internal cart navigation buttons (see cart / shopping cart) in this context is redundant and may confuse users by creating a parallel cart flow inside the chat widget.

Summary of Changes

Introduced a context-level boolean flag isInsideVTEXStore, populated once at mount by calling getVtexAccount(). The flag is exposed through ChatContext and consumed across the relevant components:

  • ChatContext — imports getVtexAccount, initializes isInsideVTEXStore via a useState lazy initializer, and exposes it to all consumers.
  • CounterControls — replaces the direct getVtexAccount() call in isAbleToAddProduct with isInsideVTEXStore from context, removing the dependency on the utility function for the boolean check.
  • Header — derives showCartButton = cartTotalItems > 0 && !isInsideVTEXStore and guards the shopping_cart button accordingly.
  • ProductCatalog — derives showSeeCartButton = totalItems > 0 && !isInsideVTEXStore and guards the footer "See cart" button.
  • ProductDetails — derives showSeeCartButton = totalItems > 0 && !isInsideVTEXStore and guards the "See cart" button inside the quantity > 0 branch.

Comment thread src/utils/VTEXIOMinicartBridge.js
@cristiantela cristiantela merged commit d5f2445 into v3-main Apr 17, 2026
1 of 2 checks passed
@cristiantela cristiantela deleted the fix/old-cart-mention-in-VTEX-context branch April 17, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants