- What is this? This is an example of a custom, self-hosted checkout that is powered by the Celery Pre-Order API. The style and functionality is inspired by the minimalist checkout used by Coin. You can add this checkout to any website and start selling with it right away.
- Why would I want this? You can easily make a beautifully branded and high-converting checkout. And because it's powered by Celery backend, you'll automatically get robust e-commerce features and order management. Most likely, you'll fit one of these two use cases: 1. I'm a person or company with a product and a website, and I want a quick way to set up pre-orders or crowdfunding campaigns with a custom checkout UI without having to deal with building an e-commerce backend. 1. I'm an existing Celery merchant and I've outgrown the existing out-of-the-box checkout UI customizations.
- What can I do with this? You can tailor and extend the checkout interface and user experience into whatever you want or just use it as inspiration for your own checkout. A live example is the Lockitron Bolt
- A Celery account
- Your own website
- Your website must use SSL
- jQuery
Checkout Features
- One-page checkout
- Collect shipping addresses later
- Quantity selection
- Shipping country and ZIP/postal code
- Shipping rates based on country
- Tax rates based on country or United States ZIP code
- Promo/coupon codes
- Social share buttons to Facebook, Twitter, and Pinterest
- Credit card validation via Stripe
Checkout Limitations
- Stripe only (no PayPal or Affirm support)
- No state-level shipping rate overrides
- No product options or variants support
- Only supports flat $ off coupons (not percent off or free shipping)
- Create a product on Celery
- Note your product slug or ID
- If you are in the dashboard, go to the product you want to sell. The ID is after
products
in the URL, ex./products/[id]
-
Add
data-celery="[id or slug]"
to your button element<!-- Example button element --> <a href="#" data-celery="53ebdd5e1fd9c90400553dab">Pre-Order</a>
-
Add dist/celery-cart.min.js and dist/celery.css to your site, where you put it is up to you:
<!-- Include jQuery before celery-cart.min.js --> <script src="jquery.js"></script> <script src="celery-cart.min.js"></script> <link rel="stylesheet" href="celery.css" />
-
Click on your "Pre-Order" link
Currently, you must manually customize the templates to set the countries, quantity options, and copy (header, footer, etc). In the future, this will be more easily configured.
The templates are written in using Mustache (Hogan).
- Fork this repo
- Install dependencies
- Install node/npm
- Run
npm install
in this repo folder - Run
npm run serve
to automatically start processing file changes and start a server - Replace
data-celery
value insrc/index.html
with your product id/slug - Open
http://localhost:8000/src
in a browser
Edit src/js/config.js
and flip any feature flags before building. For example:
{
features: {
taxes: true,
coupons: true
}
}
- To edit text and content, edit the files located in
src/templates
- To customize styling, edit the files located in
src/less
- Note: After editing and saving the
.less
files, the CSS will automatically update in the browser without refreshing. You will be able to see the styling changes almost instantly.
-
When you are done customizing, run
npm run build
to generate the minimized files indist
-
Include the newly generated
dist/celery-cart.min.js
anddist/celery.css
on your site, where you put it is up to you:<!-- Include jQuery before celery-cart.min.js --> <script src="jquery.js"></script> <script src="celery-cart.min.js"></script> <link rel="stylesheet" href="celery.css" />
-
Click on your "Pre-Order" link. The checkout UI should pop up.
-
Congrats! You are ready to sell via your very own custom checkout.
If you have any questions or feedback on the process, please create a Github issue for this repo. Thanks!
IE9 Support
If you want to support IE9, you must include some some plugins for placeholders and CORS support.
- For XDR plugin for Cross Domain calls, we recommend jQuery-ajaxTransport-XDomainRequest
- For placeholder polyfill, we recommend placeholdr
- For input validation, we recommend jQuery Splendid Textchange
This is just an example, you can shape it into whatever you want or just use it as inspiration for your own checkout. Here are some things we will be adding to the example.
- A customization config file will be available for easy basic customizations
- More explicit styles to reduce weird interactions with existing CSS
Note: If you have any of these features configured in your Celery dashboard, they are not yet compatible with this DIY Checkout.
Products
- Product Options and Variants
- Product Collections
Payments Settings
- PayPal
- Affirm
Checkout Settings
- Require shipping address
- Require company name
- Require phone number
- Optional "Add notes for seller"
- "Message to your buyers"
- Custom tracking scripts
- Custom confirmation page
Apps
- Google Analytics