Storefront Widgets
PromoSync populates rich metafield data that you can display on your storefront. This guide shows how to implement common widgets using Liquid templates.
Looking for the no-code approach? PromoSync offers drag-and-drop app extension blocks that require no theme code changes. See Theme App Extensions.
Using Claude Code? Install the PromoSync skill and Claude will write these widgets for your theme with the correct metafield shapes.
Overview
PromoSync stores product data in Shopify metafields under the psrestful namespace. These metafields can be accessed in your theme’s Liquid templates to create dynamic displays.
Tier Pricing Block
Display quantity-based pricing tiers on product pages. Tier pricing is stored at the variant level in part_price_array.
The Data Structure
// variant.metafields.psrestful.part_price_array
[
{"quantityMin": 24, "price": 1250},
{"quantityMin": 48, "price": 1100},
{"quantityMin": 144, "price": 950},
{"quantityMin": 288, "price": 825}
]Note: Prices are stored as integers in cents (1250 = $12.50). Shopify’s money filter already expects cents, so pass the value straight to it: {% raw %}{{ tier.price | money }}{% endraw %}. Don’t divide by 100 first, or $12.50 renders as $0.13.
Basic Implementation
Add to your product template (sections/main-product.liquid or similar):
{% raw %}{% assign tiers = product.selected_or_first_available_variant.metafields.psrestful.part_price_array.value %}
{% if tiers and tiers.size > 0 %}
<div class="tier-pricing-widget">
<h3>Volume Pricing</h3>
<table class="tier-pricing-table">
<thead>
<tr>
<th>Quantity</th>
<th>Price Each</th>
<th>You Save</th>
</tr>
</thead>
<tbody>
{% assign base_price = tiers.first.price %}
{% for tier in tiers %}
{% assign savings = base_price | minus: tier.price | times: 100 | divided_by: base_price %}
<tr>
<td>{{ tier.quantityMin }}+</td>
<td>{{ tier.price | money }}</td>
<td>
{% if savings > 0 %}{{ savings }}%{% else %}-{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}{% endraw %}Styling the Tier Pricing Table
.tier-pricing-widget {
margin: 20px 0;
padding: 15px;
background: #f9f9f9;
border-radius: 8px;
}
.tier-pricing-widget h3 {
margin: 0 0 15px 0;
font-size: 16px;
font-weight: 600;
}
.tier-pricing-table {
width: 100%;
border-collapse: collapse;
}
.tier-pricing-table th,
.tier-pricing-table td {
padding: 10px;
text-align: left;
border-bottom: 1px solid #eee;
}
.tier-pricing-table th {
font-weight: 600;
font-size: 12px;
text-transform: uppercase;
color: #666;
}
.tier-pricing-table td:last-child {
color: #2a9d3a;
font-weight: 500;
}Compact Tier Display
For a more compact display:
{% raw %}{% assign tiers = product.selected_or_first_available_variant.metafields.psrestful.part_price_array.value %}
{% if tiers and tiers.size > 0 %}
<div class="tier-badges">
{% for tier in tiers %}
<span class="tier-badge">
<strong>{{ tier.quantityMin }}+</strong>
<span>{{ tier.price | money }}</span>
</span>
{% endfor %}
</div>
{% endif %}{% endraw %}Location Decorations Block
Display available decoration methods and locations.
The Data Structure
// product.metafields.psrestful.location_decorations
[
{
"locationId": 70,
"decorations": [
{
"default": false,
"decorationId": 950,
"priceIncludes": false,
"decorationName": "Embroidery",
"maxImprintColors": 99
},
{
"default": true,
"decorationId": 951,
"priceIncludes": false,
"decorationName": "Screen Print",
"maxImprintColors": 6
}
],
"locationName": "FRONT",
"locationRank": 2,
"maxDecoration": 0,
"minDecoration": 0,
"defaultLocation": false,
"decorationsIncluded": 0
},
{
"locationId": 71,
"decorations": [
{
"default": false,
"decorationId": 950,
"priceIncludes": false,
"decorationName": "Embroidery",
"maxImprintColors": 99
}
],
"locationName": "LEFT CHEST",
"locationRank": 1,
"maxDecoration": 0,
"minDecoration": 0,
"defaultLocation": true,
"decorationsIncluded": 0
}
]Implementation
{% raw %}{% assign locations = product.metafields.psrestful.location_decorations.value %}
{% if locations and locations.size > 0 %}
<div class="decoration-options">
<h3>Decoration Options</h3>
<div class="decoration-locations">
{% for location in locations %}
<div class="decoration-location">
<h4>{{ location.locationName }}{% if location.defaultLocation %} (Default){% endif %}</h4>
<ul class="decoration-methods">
{% for dec in location.decorations %}
<li>
<span class="method-name">{{ dec.decorationName }}</span>
{% if dec.maxImprintColors %}
<span class="colors">Up to {{ dec.maxImprintColors }} colors</span>
{% endif %}
{% if dec.default %}
<span class="default-badge">Default</span>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endfor %}
</div>
</div>
{% endif %}{% endraw %}Styling Decorations
.decoration-options {
margin: 20px 0;
}
.decoration-locations {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 15px;
}
.decoration-location {
padding: 15px;
background: #f5f5f5;
border-radius: 8px;
}
.decoration-location h4 {
margin: 0 0 10px 0;
font-size: 14px;
font-weight: 600;
}
.location-size {
font-size: 12px;
color: #666;
margin-bottom: 10px;
}
.decoration-methods {
list-style: none;
padding: 0;
margin: 0;
}
.decoration-methods li {
display: flex;
justify-content: space-between;
padding: 5px 0;
border-bottom: 1px solid #e0e0e0;
}
.decoration-methods li:last-child {
border-bottom: none;
}
.setup-charge.free {
color: #2a9d3a;
}Specifications Block
Specifications such as garment measurements are stored per variant in specification_array, in the PromoStandards Specification shape.
The Data Structure
// variant.metafields.psrestful.specification_array
[
{"specificationType": "Length", "SpecificationUom": "Inches", "measurementValue": "28"},
{"specificationType": "Chest", "SpecificationUom": "Inches", "measurementValue": "20"}
]Implementation
{% raw %}{% assign specs = product.selected_or_first_available_variant.metafields.psrestful.specification_array.value %}
{% assign material = product.metafields.psrestful.primary_material %}
{% if specs or material %}
<div class="product-specifications">
<h3>Specifications</h3>
<dl class="specs-list">
{% if material %}
<dt>Material</dt>
<dd>{{ material }}</dd>
{% endif %}
{% for spec in specs %}
<dt>{{ spec.specificationType }}</dt>
<dd>{{ spec.measurementValue }} {{ spec.SpecificationUom }}</dd>
{% endfor %}
</dl>
</div>
{% endif %}{% endraw %}The supplier’s marketing bullets (fabric weight, features and similar) are in the product-level marketing_points metafield: a JSON array of {"pointType": "...", "pointCopy": "..."}.
{% raw %}{% assign points = product.metafields.psrestful.marketing_points.value %}
{% if points and points.size > 0 %}
<ul class="features-list">
{% for point in points %}
<li>{{ point.pointCopy }}</li>
{% endfor %}
</ul>
{% endif %}{% endraw %}Brand and Lead Time Block
Show the brand, the product line and the supplier’s lead time.
{% raw %}{% assign brand = product.metafields.psrestful.brand %}
{% assign line_name = product.metafields.psrestful.line_name %}
{% assign lead_time = product.metafields.psrestful.lead_time %}
<div class="product-source">
{% if brand %}
<span class="product-brand">{{ brand }}</span>
{% endif %}
{% if line_name %}
<span class="product-line">{{ line_name }}</span>
{% endif %}
{% if lead_time %}
<span class="product-lead-time">Ships in about {{ lead_time }} days</span>
{% endif %}
</div>{% endraw %}psrestful.supplier_code holds the PromoStandards supplier code (for example SanMar). Most stores keep it off the storefront.
Inventory
PromoSync writes supplier stock into Shopify’s own inventory levels, not into a metafield. Use the standard Liquid objects, for example variant.inventory_quantity and variant.available, to show stock on the storefront.
Writing Your Own Theme Block
PromoSync already ships a configurable PromoSync Tier Pricing app block (see Volume Pricing Theme Extension). If you need your own markup, a theme block in your theme’s blocks/ folder is a good starting point.
Block Schema
Create blocks/tier-pricing.liquid in your theme:
{% raw %}{% assign tiers = product.selected_or_first_available_variant.metafields.psrestful.part_price_array.value %}
{% if tiers and tiers.size > 0 %}
<div class="tier-pricing-block" {{ block.shopify_attributes }}>
{% if block.settings.show_title %}
<h3 class="tier-pricing-title">{{ block.settings.title }}</h3>
{% endif %}
<table class="tier-pricing-table">
<thead>
<tr>
<th>{{ block.settings.quantity_label }}</th>
<th>{{ block.settings.price_label }}</th>
</tr>
</thead>
<tbody>
{% for tier in tiers %}
<tr>
<td>{{ tier.quantityMin }}+</td>
<td>{{ tier.price | money }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
{% schema %}
{
"name": "Tier Pricing",
"settings": [
{
"type": "checkbox",
"id": "show_title",
"label": "Show title",
"default": true
},
{
"type": "text",
"id": "title",
"label": "Title",
"default": "Volume Pricing"
},
{
"type": "text",
"id": "quantity_label",
"label": "Quantity column label",
"default": "Quantity"
},
{
"type": "text",
"id": "price_label",
"label": "Price column label",
"default": "Price Each"
}
]
}
{% endschema %}{% endraw %}JavaScript Enhancements
Dynamic Price Calculator
Add a quantity-based price calculator:
// tier-pricing-calculator.js
class TierPricingCalculator {
constructor(element) {
this.element = element;
this.tiers = JSON.parse(element.dataset.tiers);
this.quantityInput = element.querySelector('[data-quantity-input]');
this.priceDisplay = element.querySelector('[data-price-display]');
this.totalDisplay = element.querySelector('[data-total-display]');
this.bindEvents();
}
bindEvents() {
this.quantityInput.addEventListener('input', () => this.calculate());
}
calculate() {
const quantity = parseInt(this.quantityInput.value) || 0;
const tier = this.findTier(quantity);
if (tier) {
// Prices are in cents, convert to dollars
const priceInDollars = tier.price / 100;
const total = priceInDollars * quantity;
this.priceDisplay.textContent = this.formatMoney(priceInDollars);
this.totalDisplay.textContent = this.formatMoney(total);
}
}
findTier(quantity) {
for (let i = this.tiers.length - 1; i >= 0; i--) {
if (quantity >= this.tiers[i].quantityMin) {
return this.tiers[i];
}
}
return this.tiers[0];
}
formatMoney(dollars) {
return '$' + dollars.toFixed(2);
}
}
// Initialize
document.querySelectorAll('[data-tier-calculator]').forEach(el => {
new TierPricingCalculator(el);
});Usage in Template
{% raw %}{% assign tiers = product.selected_or_first_available_variant.metafields.psrestful.part_price_array.value %}
{% if tiers %}
<div data-tier-calculator data-tiers='{{ tiers | json }}'>
<input type="number" data-quantity-input value="24" min="1">
<span>Price: <span data-price-display></span></span>
<span>Total: <span data-total-display></span></span>
</div>
{% endif %}{% endraw %}Note: The JavaScript calculator receives prices in cents and should convert to dollars for display.
Best Practices
1. Check for Data Existence
Always check if metafield data exists before rendering:
{% raw %}{% assign tiers = variant.metafields.psrestful.part_price_array.value %}
{% if tiers and tiers.size > 0 %}
<!-- Render widget -->
{% endif %}{% endraw %}2. Provide Fallbacks
Show graceful fallbacks when data is missing.
3. Keep It Fast
Avoid complex calculations in Liquid. Use JavaScript if needed.
4. Mobile-First Design
Ensure widgets work well on mobile devices.
5. Test with Multiple Products
Test widgets with products that have varying amounts of data.
Troubleshooting
Widget Not Showing
- Verify the product has the metafield data
- Check the metafield namespace (
psrestful) - Ensure the product was synced recently
- Check for Liquid syntax errors
Data Not Updating
- Tier prices (
part_price_array) are refreshed by Update Prices and Update Metafields. Other metafields are refreshed by Update Metafields. Run the one you need on the product - Inventory updates Shopify’s inventory levels only, so it never changes a metafield
- Check the result email for the product’s skip reason
Styling Issues
- Check for CSS conflicts with your theme
- Use specific selectors to avoid conflicts
- Test in theme preview mode