Skip to content
themeforge
EN
Start free
Menu
  1. Home
  2. Attribute reference
  3. wp-cart
Core Shop

The cart page in your own design

wp-cart="items"

The buyer changes quantities and removes products without a page reload; the rows and the total update on the spot.

Where it goes

On page-cart.html: WordPress uses it for the cart page of WooCommerce. wp="cart-full" wraps the cart, wp="cart-empty" the message for an empty cart.

Inside, wp-cart="items" on the block of rows; the first row is the pattern. In a row: product_title, product_image, product_price, product_qty, product_total, product_remove. Under the rows: wp="cart-total".

Example: a cart with two products

Markup page-cart.html
<div class="cart" wp="cart-full">
  <div wp-cart="items">
    <div class="cart__row">
      <div wp-cart="product_title">Ethiopia Yirgacheffe</div>
      <input wp-cart="product_qty">
      <div wp-cart="product_total">$28.00</div>
      <a href="#" wp-cart="product_remove">Remove</a>
    </div>
  </div>
  <div>Total: <span wp="cart-total">$28.00</span></div>
</div>
<div class="cart-empty" wp="cart-empty">Your cart is empty.</div>
In the admin WooCommerce → Settings → Advanced
Cart page Cart
On the site the cart page
Cart
Ethiopia Yirgacheffe × 2 $28.00
Colombia Huila × 1 $13.00
Total $41.00

What matters

  • Needs WooCommerce.
  • The empty state is wp="cart-empty": the theme shows it when the cart is empty and hides it otherwise.
  • The price in a row follows product-price: add product_price_sale and product_price_regular for sales.

Common mistakes

The build log is the “Logs” tab of your project on themeforge.pro; the free markup check shows the same notes.

Not like this
<div wp-cart="empty-cart">Your cart is empty.</div>

An unknown wp-cart value is removed, so the message always shows; the build log names the value.

Like this
<div wp="cart-empty">Your cart is empty.</div>

The empty state is wp="cart-empty" (or wp-cart="empty").

Alternative spelling

wp_cart works the same: the build gives an identical theme.

Ready when you are

See your site’s WordPress admin before you pay.