Features in detail

Price input widget

The price input widget is rendered on product pages for any NYP-enabled product. It consists of:

  • An optional suggested price line above the input
  • A labeled input field with the currency symbol positioned according to your WooCommerce currency settings (left, right, with or without space)
  • An optional minimum notice inline with the label
  • An optional price range line below the input
  • A hidden validation message area that appears when the customer enters an invalid price

JavaScript validates the price on the client side before the form submits, providing immediate feedback without a page reload. Server-side validation runs again at add-to-cart for security.

Cart and checkout behavior

When a customer adds a NYP product to the cart, their chosen price is:

  1. Stored in the cart item data under nyp_custom_price
  2. Applied to the product’s price via WC_Product::set_price() before totals are calculated
  3. Displayed in the cart line item price column
  4. Recorded as order item metadata (Customer Price visible label, _nyp_custom_price internal key) when the order is created

Custom prices are preserved when the cart is updated. Each NYP item is treated as a unique cart item to prevent quantity merging with items that carry a different custom price.

Shop page integration

On shop and archive pages, NYP products display a configurable button (default: “Choose Price”) that links to the product page. The standard WooCommerce “Add to cart” button is replaced, since price entry must happen on the product page.

If Show Price Info on Shop is enabled, the suggested price and/or price range will appear below the product price on shop listings.

Bulk actions

From Products → All Products, you can select multiple products and use the Bulk Actions dropdown to:

  • Enable Name Your Price — Sets _nyp_enabled to yes on all selected products
  • Disable Name Your Price — Sets _nyp_enabled to no on all selected products

Reports dashboard

The Reports tab under WooCommerce → Custom Pricing provides:

  • Date range filtering (from/to)
  • Total NYP revenue, total items sold at custom prices, and average custom price for the selected period
  • Per-product breakdown showing item count, total revenue, and average price
  • Export CSV button to download the report data

A Name Your Price Overview widget is also added to the WordPress dashboard showing recent NYP order stats. The widget data is cached for one hour and can be refreshed manually.

Hide regular price

When Hide Regular Price is enabled (either on the product or via a rule), the standard WooCommerce price display is suppressed on the product page. This works for both simple and variable products.