Skip to navigation Search UltraCart Get Started

Control Content Display and Access Based on User Location

· ~3 min read ·

Optimize Your StoreFront with Geo-Location Controls

Easily manage the display and access of content on your StoreFront based on a user's location. If you have items you don’t want to sell in specific states, you can automatically show or hide content based on the user's geolocation using their IP address.

Setting this up is simple with the HideIf and ShowIf components in your StoreFront. These tools allow you to display or hide content based on various conditions. Follow this guide to learn how to use these components to control content visibility based on user location.

Step 1: Hide Content Using the HideIf Component

  1. Log into your UltraCart Account and go to your StoreFront.
  2. Navigate to the item page you want to restrict for a specific state and click "Edit" in the top left corner next to the UltraCart logo.
  3. Within the main UI or the Hierarchy, add a HideIf component to the page.
  4. In the HideIf component settings, scroll down to GEO-LOCATE US STATE IS and set it to the desired state.
  5. Nest each component you want to hide within the HideIf component using the Hierarchy view in the StoreFront.

This setup will hide any components within the HideIf component if the specified conditions are met. Hiding checkout options like quantity, variations, and the add-to-cart button will prevent the user from adding the restricted item to their cart.

Step 2: Display Alternative Content with the ShowIf Component

  1. Hover over the HideIf component in the Hierarchy sidebar of your StoreFront.
  2. Click the plus icon on the far left of this component and select "Add Content Below."
  3. This will bring up the component selection list.
  4. In the search bar, type “show” and select the ShowIf component.
  5. Add the ShowIf component to the page and include any components, such as a text block, to inform the user they cannot purchase the item due to their location.

The ShowIf component will display the nested content if the specified conditions are met. In this case, it will show a message to the user explaining that they cannot check out with the item because they reside in a restricted state.

Enhance User Experience with Targeted Content

By effectively using HideIf and ShowIf components, you can ensure a seamless user experience while complying with regional restrictions. This setup not only improves user satisfaction but also helps in maintaining compliance with state-specific regulations, enhancing your StoreFront's efficiency and reliability.

Implement these steps to control content display and access based on user location, optimizing your StoreFront for better user experience and compliance.

Continue reading

Subscription Commerce Without the Plugin Tax: Built-In Subscription Management for Ecommerce

Subscription Commerce Without the Plugin Tax: Built-In Subscription Management for Ecommerce

Built-in subscription management for ecommerce should not be a separate line item on your bill. On most platforms, recurring billing, checkout upsells, customer portals, and retention flows live in different apps that were never built to work together. UltraCart treats subscriptions as core infrastructure: auto-orders, native checkout upsells, customer self-service, save-the-cancel flows, and unified analytics all ship in one platform with one data model.

AI-Powered BigQuery Reporting for UltraCart Merchants

AI-Powered BigQuery Reporting for UltraCart Merchants

UltraCart merchants can now build, visualize, and automate BigQuery reports using natural language and Claude Code. The new @ultracart/bq-skill package turns your data warehouse into a reporting engine: ask a question, get a complete report with SQL, charts, PDFs, and executive analysis — then replay it forever with a single command. Connect your own external data sources, set up automated delivery to Slack and email, define alarms for revenue drops, and generate executive report decks. Reports are code — version-controlled, diffable, and schedulable in CI/CD.