Shopify Section: Custom Frame Builder
Custom Frame Builder
Documentation for the frame-customizer section. This section lets customers upload artwork, select frame styles, adjust dimensions, and set matte padding. It calculates pricing based on total square inches and generates a preview image that can be included with the order.
Overview
The Custom Frame Builder is a Shopify theme section that provides a full “build-your-frame” experience on a page. Customers can:
- Upload artwork
- Select a frame style (solid color or texture image)
- Change width and height
- Set matte padding
- See a live preview and dynamic price updates
Pricing uses square inches: price = (width × height) × ratePerSqIn.
What gets added to cart
The section adds one Shopify product (your “Custom Frame” product) to cart with custom line item properties, typically including:
| Property | Example | Purpose |
|---|---|---|
| Frame Style | Black | Selected frame option |
| Dimensions | 12" × 18" | Chosen size |
| Matte | 1.5" | Padding around artwork |
| Preview Image | CDN URL | Generated framed preview |
Exact property keys may differ depending on your implementation.
Installation & Setup
-
Create a new section
In Shopify Admin, go to Online Store → Themes → Actions → Edit code.
Under Sections, click Add a new section and name it frame-customizer. -
Paste the provided code
Paste the provided HTML, CSS, Liquid, and JavaScript into the new file. This section includes the UI, preview logic, and price calculation.
https://codeshare.io/5Qqom7 -
Create your framing product
Create a product in Shopify (example: Custom Frame). Set its price to be treated as price per square inch (or use a fixed base price, depending on your setup). -
Add the section in the Theme Editor
Open the Theme Editor (Customize), add the Frame Customizer section to a page, and configure blocks for each frame style.
Note: Make sure your product is available on the sales channel and has at least one variant.
Section Configuration
In the Theme Editor, add one Frame Style block per frame option. Example: Oak, Black, White.
- Product: Select the “Custom Frame” product
- Frame Name: Display label (example: Black)
- Thickness: Thickness (px) for preview overlay
- Color/Image: Pick a color or upload a texture image
Tip: Use texture images for premium frame types and plain colors for simple finishes.
Pricing Logic
The builder calculates pricing using area:
Square Inches = Width × Height Price = Square Inches × Rate Per Sq In
If your “Custom Frame” product price is used as the rate:
ratePerSqIn = product.price total = (width * height) * ratePerSqIn
If you also add matte/extra fees, apply them on top of the calculated total.