pagehive

Buy buttons and the cart.

Add to cart and Buy now buttons, with no code to write.

Updated Guide 5 of 8

Buttons that just work

Your agent can turn any button into a shop button with a few attributes:

  • data-bp-cart-add: adds a product to the cart
  • data-bp-checkout: goes to checkout with the cart
  • data-bp-checkout with a product: Buy now, for just that item
  • data-bp-cart-count: shows how many items are in the cart
  • data-bp-cart-code: a field for a discount code
  • data-bp-checkout-message: where a message like Sold out appears

A size or colour picker can choose the variant. No script is needed: Pagehive adds what the page needs by itself.

The cart

The cart is kept in the buyer's browser, per site. Prices, names and stock always come from your tables, never from the page, so nobody can change a price in their browser.

After paying

Stripe sends the buyer a receipt, and the buyer comes back to your site: to a thank-you page you choose, or for digital products, to their order page.

Your agent can also build its own cart with bp.cart and bp.checkout in a page script.