Name your price
Let the customer type the amount they pay, between a minimum and a maximum, without new variants, and what happens to that price from the cart to the order.
With Name your price, the customer types the amount they pay: a donation, a gift card of any amount, a “pay what you want” download, or an amount agreed with the shop beforehand, such as a deposit. You set the lowest and highest amount. The product stays one product in Shopify: no variant is created for each amount. This page covers the price field and what happens to the price from the cart to the order.
Note
Name your price needs the server plan and Name your price turned on in the Smootify dashboard. It runs on the site’s licensed domain. On your .webflow.io address it runs once the site is paid, not during a trial.
1. Add the price field
Inside the Form of the product’s smootify-add-to-cart:
- Add a Custom element with the tag
name-your-price. - Inside it, add a Text field and set its Type to Number in its settings.
- On the Text field, add the custom attributes
minandmax: the lowest and highest amount you accept. - On
name-your-price, adddata-invalid-pricewith the message for an amount out of range. Without it, the message is “Invalid price”.
Warning
Always set min. An empty field starts at the minimum, and the price shown with it. Without min, an empty field is a valid amount of 0: the product can be added to the cart for free.
The product keeps a price in Shopify, which can be 0. With the field above, the page shows:
Before an amount
The page shows the product's price in Shopify until the customer types an amount.
An amount from 5 to 500
smootify-price shows it as the price, and times the quantity as the total.
An amount out of range
The data-invalid-price message shows in the Error message, and nothing is added.
- The amount is not saved as a property of the line: the customer sees a price, not a filled-in field.
- Any
smootify-priceof the product follows the amount as it is typed, such as one in a gift card preview or inside the Buy now button. - Add-ons in the same form go in with the product, at their own price.
2. From the cart to the order
Add to cart. The line goes to the cart with the amount the customer chose. The Smootify cart shows that amount in the line and in the totals.
Checkout. A cart with a chosen amount does not go through the usual Shopify checkout. It becomes one Shopify draft order, and the customer pays on its invoice page. Two ways lead there:
Add to cart, then check out
- Draft order
- The whole cart, the lines at the normal price too, except subscription lines.
- The cart
- Emptied when the customer leaves for the invoice: coming back without paying, they find it empty.
Buy now
- Built with
- A Custom element with the tag
buttonandtype="submit". - Draft order
- This product and its add-ons, at once.
- The cart
- Stays as it was.
On the order, the line carries the chosen price, like any other price.
The product configurator uses the same checkout for its calculated prices.
The buy-again button of the order pages leaves these lines out: a cart cannot carry a chosen price.
Developers can change the draft order before it is created, or stop the customer from leaving, with the draft_order_data and checkout_url filters.
A gift card of any amount
Shopify issues a gift card for the value of its variant, whatever the customer paid. So name-your-price does not work on a Shopify gift card product: it removes itself, with an error on your testing domains.
For a gift card at any amount, sell a normal product instead:
- Create a product, such as “Gift card”, with one variant at your lowest amount. Do not charge taxes on it: the tax is charged when the card is spent. It needs no shipping.
- Add
name-your-priceto its page, as above. - Add the fields for the gift with dynamic properties: the recipient’s email and a message.
- Import the Gift card at any amount workflow in Shopify Flow. On Order paid, it creates a Shopify gift card of the amount paid for the recipient, with the message, and Shopify emails them the code.
The card the recipient gets is a normal Shopify gift card, so it can be spent everywhere, the invoice page included.
Before you publish
Test an order on the licensed domain, with Add to cart and with Buy now, up to the invoice page. The invoice page already has the discount codes of the cart, and accepts more codes and gift cards. It is not the usual checkout: check the payment methods the customer sees there.
Check these first
- The product goes in at its normal price, with no error. The
name-your-priceelement has no Number Text field inside, so it removed itself. Or the site is not on the server plan, or Name your price is not turned on: the element is removed then too. - Products can be added for free. The Text field has no
min. - The price field disappears on a gift card. The product is a Shopify gift card product: see A gift card of any amount.
- Any amount is accepted.
minandmaxare onname-your-priceinstead of the Text field. - It works on the live site but not on
.webflow.io. During a trial, server add-ons run only on the licensed domain. - The customer comes back to an empty cart. The cart is emptied when they leave for the invoice.
- A subscription is missing from the order. Subscription lines do not go into the draft order. Sell them in a separate order.
Coming from 1.x
- The Draft Orders add-on is no longer needed.
- Add-ons in the same form now go to the cart with the product. 1.x added the main product only.