Shopping Cart Widget

A server-backed shopping cart widget for any site.

Give visitors a responsive slide-over cart, live line-item totals, discount code application, and secure checkout without building cart state or order storage from scratch.

How does the Shoprivet shopping cart widget work?

The widget pairs a lightweight script (widget.js) with server-side guest cart sessions on api.shoprivet.io so item pricing, product variant stock, and discount eligibility are always verified server-side.

Practical implementation

From product card to verified checkout

  1. 1

    Server-validated guest cart

    Shoppers add items with variant options, adjust quantities (1 to 99 per line), and see authoritative subtotal and discount math.

  2. 2

    Discount codes & promotions

    Free plans support up to 3 active discount codes; Premium ($15/mo) and Business ($39/mo) unlock unlimited codes and automatic promotions.

  3. 3

    Checkout with your payment gateway

    Customers complete checkout using Cash on delivery or your connected Stripe, Paystack, Flutterwave, Razorpay, or PayPal account.

Embed cart widget inside navigation bar

<div
  data-shoprivet="downtown-shop"
  data-shoprivet-cart-in-nav="true"
  data-shoprivet-hosted-cart="true"
></div>
<script src="https://api.shoprivet.io/widget.js" async></script>

Requirements, pricing & limits

Cart capabilities & developer control

Physical and digital products

Handles shipping address collection for physical orders and automatic download links for digital products.

Idempotent checkout retries

Guest cart checkouts enforce an idempotencyKey so double clicks or flaky mobile connections never duplicate orders.

Headless REST option

Prefer custom UI? Call POST /public/stores/:slug/carts directly and render your own React, Vue, or Next.js cart drawer.

Plan limits apply clearly

Free includes up to 50 orders/month and 25 products; Premium increases limits to 1,000 orders/month and Business to 10,000 orders/month.

Direct answers

Frequently asked questions

Does the shopping cart work on static HTML websites?
Yes. Because cart state lives on Shoprivet servers via guest cart sessions, static HTML pages on GitHub Pages, Netlify, or S3 get a persistent dynamic cart.
Can customers apply promo codes in the cart?
Yes. Customers can enter active discount codes, and Premium/Business stores can configure automatic promotions.
Are cart totals tamper-proof?
Yes. Browser requests only pass productId, variantId, and quantity; Shoprivet computes final unit prices, discounts, and stock checks on the backend.
Can I customize the widget without using widget.js?
Yes. Build any custom UI using the public Guest Cart endpoints documented in /docs/api-reference.

Start free at $0/month

Launch with 0% Shoprivet platform fees.

Create a store in minutes, embed a catalog on your existing site, or call our public Storefront and /v1 APIs.

Create your free store