How Gatemi Name Your Price Works

A product with Name your price ticked swaps its fixed price for a box the shopper fills in. Everything else about the product — stock, shipping, tax, coupons — behaves as it always did. Three rules shape the plugin, and both editions keep all three.

The three rules

The band is enforced on the server, every time. The box on the product page carries a min attribute, but that is a hint to the browser, not a rule: anyone can post past it. So the plugin checks the amount again when the product is added to the cart, and again every time the cart is recalculated.

A named price is a price, not a discount. It is set on the cart line from the amount stored with that line, and never re-read from the product page or worked out again from the product. WooCommerce recalculates a cart several times per request; measuring from anything else would drift.

One service decides a product's rules. The field, the add-to-cart check, the cart and the catalog price all ask the same function for the product's band. They cannot disagree about the minimum.

Step 1: which band applies

When anything asks about a product, the plugin works out four things: whether it takes a named price, its minimum, its maximum (full edition) and its suggestion.

  1. If Offer the field on products that have it switched on is off on the settings screen, nothing takes a named price.
  2. Full edition: if the product (or the variation) has its own Name your price box ticked, its own fields are used.
  3. Otherwise, if the product's parent has the box ticked, the parent's fields are used. This is how a variation without its own band follows its product.
  4. Otherwise the product charges its normal price.

The free edition always reads the product, never a variation: every variation of a product uses the product's switch, minimum and suggestion.

Then the values are tidied:

  • An empty Minimum price means none — or, full edition, the Store minimum from the settings screen.
  • An empty Maximum price (full edition) means no ceiling. A maximum below the minimum is treated as a typo and dropped; the minimum stands.
  • A Suggested price below the minimum is raised to it; in the full edition a suggestion above the maximum is lowered to it.

Step 2: the product page

On a product that takes a named price:

  • The price wherever WooCommerce prints one (shop, product page, related products) becomes From £5.00 when there is a minimum. With no minimum it becomes "Name your price". Full edition: turn off Show "From " to always show your own Otherwise show text instead.
  • The box is printed just above the Add to cart button, inside your theme's own add-to-cart form, so it is sent with the form and works with variations. It is a number box, required, with the minimum (and the full edition's maximum) as limits and the suggestion pre-filled. Full edition: Pre-fill can be switched off, and a description can be printed underneath.
  • The hint says what the box accepts. The free edition prints "Minimum £5.00." when there is a minimum; the full edition prints "Between £5.00 and £50.00.", "Minimum £5.00." or "Up to £50.00." and can be switched off.
  • Full edition: the product's price is removed from its structured data (the JSON-LD search engines read), because a number nobody will be charged is not an offer a search engine should list.

Step 3: reading what the shopper typed

People type prices the way they write them. The box is read with the rule every spreadsheet uses: the last separator is the decimal point, and any earlier ones are thousands separators.

Typed Read as
12.50 12.50
12,50 12.50
1,234.56 1234.56
1.234,56 1234.56
£ 20 20

Step 4: add to cart — refused if outside the band

When the shopper presses Add to cart, the amount is checked before anything goes into the cart. If it fails, the shopper stays on the product page with a WooCommerce error and nothing is added:

Amount Message
Empty or 0 "Please enter how much you would like to pay."
Below the minimum "The lowest we can accept for this is £5.00."
Above the maximum (full edition) "The most we can accept for this is £50.00."

If it passes, the amount — rounded to your store's price decimals — is stored on the cart line under the key gmnp_price.

Step 5: the cart — clamped on every recalculation

Each time WooCommerce recalculates the cart, the plugin sets every named-price line's price from its stored amount, after bringing it inside the band as it stands now. This is deliberately a clamp, not a refusal:

  • If you raise a product's minimum from £5 to £8 while a shopper has £6 in their cart, the line becomes £8 on the next recalculation. The cart is not emptied under them mid-checkout.
  • If you switch Name your price off on that product, the line goes back to the product's normal price.

The price is set at priority 20 on woocommerce_before_calculate_totals, the hook the classic cart, the mini-cart, the Cart and Checkout blocks and the Store API all recalculate through.

Full edition: the cart line shows the chosen amount under the product name.

Step 6: the order

When the order is placed, the line's price is the named amount, and the amount is also kept on the order line as hidden item meta _gmnp_price. That record is what the customer actually agreed to pay, and it is never removed — not even on uninstall.

Worked example

A pay-what-you-want e-book, regular price £10 (kept so WooCommerce treats it as purchasable), Minimum price 3, Suggested price 8, and — full edition — Maximum price 50.

  • The shop shows From £3.00.
  • The product page box opens at 8.00, with "Between £3.00 and £50.00." under it (free edition: "Minimum £3.00.").
  • A shopper types 2,50: refused, "The lowest we can accept for this is £3.00."
  • They type 12,50: added at £12.50.
  • You raise the minimum to 15 that afternoon: their cart line becomes £15.00 the next time the cart recalculates.
Shopping Cart
Scroll to Top