Stock-Up Switch
Move monthly subscribers to a bigger, less frequent order in one click.


This block reads live subscription data, so it only runs inside a real customer portal. The animation shows what subscribers see.
What it does
A card on the subscription page that offers a bigger supply on a longer schedule: the selected products go to a set quantity (for example ×3) and delivery moves to a longer schedule (for example every 3 months). Before the subscriber clicks, it lists every change, including the other items on the subscription that will move to the new schedule, and says the next order date stays the same. One click changes the schedule, then the quantities, then reloads the page. It only shows on active, non-prepaid subscriptions on a qualifying schedule, and stays hidden for anyone already at or above the starting quantity you set.
Why it exists
For subscription brands selling consumables people use on a steady schedule (supplements, coffee, snacks, personal care), where most subscribers buy one unit a month. Moving them to a larger, less frequent order means fewer shipments per customer, which lowers fulfillment and shipping cost per unit, and a stocked-up subscriber has fewer renewal moments where they might skip or cancel. It takes one click and no support ticket, instead of editing quantity and frequency separately.
The code
Paste it as-is, or download stock-up-switch.html<!--
Skio custom block: one-click "stock up" upsize + cadence change
Store: YOUR_STORE
Generated by the Stock-Up Block Builder. Paste this whole block into the
Custom block setting of your Skio customer portal. To change settings,
edit CONFIG below or re-generate from the builder.
What it does on the subscription page the customer is viewing:
1. Reads the subscription through the portal's own fetchSkioAPI helper
(the customer's own session; no API secret in this block).
2. Shows only if the subscription is ACTIVE, not prepaid, on one of
CONFIG.eligibleIntervals, has at least one selected product, and every
selected product is at or below CONFIG.maxStartingQuantity.
3. On click: changes the interval to CONFIG.newInterval (next order date
unchanged), THEN sets every selected product to CONFIG.targetQuantity.
Interval goes first so a partial failure never leaves a customer with
the bigger quantity on the old, more frequent schedule.
4. Reloads the page so the portal shows the new quantities and cadence.
-->
<div class="skio-upsize bg-bg-primary border-border-secondary rounded-border-radius" data-skio-upsize hidden>
<p class="skio-upsize__eyebrow" data-el="eyebrow"></p>
<h2 class="skio-upsize__title text-text-heading" data-el="title"></h2>
<p class="skio-upsize__body" data-el="body"></p>
<ul class="skio-upsize__list" data-el="list"></ul>
<div class="skio-upsize__others" data-el="others" hidden>
<p class="skio-upsize__subhead" data-el="othersTitle"></p>
<ul class="skio-upsize__list" data-el="othersList"></ul>
</div>
<div class="skio-upsize__cadence">
<span class="skio-upsize__label" data-el="deliveryLabel"></span>
<span class="skio-upsize__change">
<span class="skio-upsize__old" data-el="oldInterval"></span>
<span class="skio-upsize__arrow" aria-hidden="true">→</span>
<span class="skio-upsize__new" data-el="newInterval"></span>
</span>
</div>
<p class="skio-upsize__note" data-el="note"></p>
<button
type="button"
class="skio-upsize__btn bg-button-bg-primary text-button-text-primary hover:bg-button-bg-primary_hover rounded-border-radius"
data-el="button"
></button>
<p class="skio-upsize__status" data-el="status" role="status" aria-live="polite"></p>
</div>
<style>
.skio-upsize {
container-type: inline-size !important;
display: block !important;
width: 100% !important;
box-sizing: border-box !important;
margin: 0 !important;
padding: clamp(16px, 4cqw, 24px) !important;
border-width: 1px !important;
border-style: solid !important;
box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08) !important;
color: inherit !important;
font-family: inherit !important;
text-align: left !important;
}
.skio-upsize[hidden] { display: none !important; }
.skio-upsize * { box-sizing: border-box !important; }
.skio-upsize__eyebrow {
margin: 0 0 4px !important;
padding: 0 !important;
font-size: 12px !important;
font-weight: 600 !important;
letter-spacing: 0.06em !important;
text-transform: uppercase !important;
opacity: 0.75 !important;
}
.skio-upsize__title {
margin: 0 0 6px !important;
padding: 0 !important;
font-size: clamp(18px, 5cqw, 22px) !important;
font-weight: 700 !important;
line-height: 1.25 !important;
}
.skio-upsize__body {
margin: 0 0 14px !important;
padding: 0 !important;
font-size: 14px !important;
line-height: 1.45 !important;
opacity: 0.85 !important;
}
.skio-upsize__list {
list-style: none !important;
margin: 0 0 10px !important;
padding: 0 !important;
border-top: 1px solid rgba(127, 127, 127, 0.25) !important;
}
/* Portal themes often indent list items (margin/padding on li); reset all of it. */
.skio-upsize__list > .skio-upsize__item {
margin: 0 !important;
margin-inline-start: 0 !important;
padding-left: 0 !important;
padding-right: 0 !important;
padding-inline-start: 0 !important;
text-indent: 0 !important;
list-style: none !important;
}
.skio-upsize__list > .skio-upsize__item::before,
.skio-upsize__list > .skio-upsize__item::marker { content: none !important; display: none !important; }
.skio-upsize__item,
.skio-upsize__cadence {
display: flex !important;
align-items: baseline !important;
justify-content: space-between !important;
gap: 12px !important;
padding-top: 9px !important;
padding-bottom: 9px !important;
border-bottom: 1px solid rgba(127, 127, 127, 0.25) !important;
font-size: 14px !important;
line-height: 1.35 !important;
}
.skio-upsize__cadence {
margin: 0 0 12px !important;
padding-left: 0 !important;
padding-right: 0 !important;
flex-wrap: wrap !important;
row-gap: 2px !important;
}
/* Keep "Delivery" whole; on a narrow card the schedule change wraps below it instead. */
.skio-upsize__cadence .skio-upsize__label { flex: none !important; overflow-wrap: normal !important; }
.skio-upsize__cadence .skio-upsize__change { margin-left: auto !important; }
.skio-upsize__others[hidden] { display: none !important; }
.skio-upsize__subhead {
margin: 14px 0 6px !important;
padding: 0 !important;
font-size: 13px !important;
line-height: 1.4 !important;
opacity: 0.75 !important;
}
.skio-upsize__name,
.skio-upsize__label { min-width: 0 !important; overflow-wrap: anywhere !important; }
.skio-upsize__label { font-weight: 600 !important; }
.skio-upsize__change,
.skio-upsize__qty {
flex: none !important;
white-space: nowrap !important;
font-variant-numeric: tabular-nums !important;
}
.skio-upsize__old { opacity: 0.6 !important; text-decoration: line-through !important; }
.skio-upsize__arrow { margin: 0 6px !important; opacity: 0.6 !important; }
.skio-upsize__new { font-weight: 700 !important; }
.skio-upsize__note {
margin: 0 0 14px !important;
padding: 0 !important;
font-size: 13px !important;
line-height: 1.4 !important;
opacity: 0.75 !important;
}
.skio-upsize__btn {
display: inline-flex !important;
align-items: center !important;
justify-content: center !important;
gap: 8px !important;
width: 100% !important;
min-height: 44px !important;
margin: 0 !important;
padding: 10px 18px !important;
border: 0 !important;
font: inherit !important;
font-size: 15px !important;
font-weight: 600 !important;
cursor: pointer !important;
}
@container (min-width: 520px) {
.skio-upsize__btn { width: auto !important; min-width: 260px !important; }
}
.skio-upsize__btn:focus-visible {
outline: 2px solid currentColor !important;
outline-offset: 3px !important;
}
.skio-upsize__btn[disabled] { cursor: progress !important; opacity: 0.7 !important; }
.skio-upsize__btn[data-busy="true"]::before {
content: "" !important;
width: 14px !important;
height: 14px !important;
flex: none !important;
border: 2px solid currentColor !important;
border-right-color: transparent !important;
border-radius: 50% !important;
animation: skio-upsize-spin 0.8s linear infinite !important;
}
@keyframes skio-upsize-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
.skio-upsize__btn[data-busy="true"]::before { animation: none !important; }
}
.skio-upsize__status {
margin: 10px 0 0 !important;
padding: 0 !important;
font-size: 14px !important;
line-height: 1.4 !important;
}
.skio-upsize__status:empty { display: none !important; }
.skio-upsize__status[data-tone="success"] { font-weight: 600 !important; }
.skio-upsize__status[data-tone="error"] { font-weight: 600 !important; color: #b42318 !important; }
</style>
<script>
(function () {
/*
CONFIG reference
- products.productIds / variantIds: Shopify numeric IDs. productHandles: the
"/products/<handle>" part of a storefront URL. A line matches if any list matches.
- targetQuantity: quantity every selected product is set to.
- maxStartingQuantity: block only shows if every selected product is at or below this.
- eligibleIntervals / newInterval: interval is DAY, WEEK or MONTH.
- showOtherItems: list non-selected recurring items (their schedule changes too).
- style: "" = use the portal theme. standaloneCard: drop the portal's own
wrapper background/padding so this card stands on its own.
- copy tokens: {quantity}, {newInterval} ("every 3 months"), {supply}
("3-month supply"), {date} (next order date, note only).
*/
var CONFIG = {
"products": {
"productIds": [],
"variantIds": [],
"productHandles": [
"your-product-handle",
"another-product-handle"
]
},
"targetQuantity": 3,
"maxStartingQuantity": 2,
"eligibleIntervals": [
{
"interval": "MONTH",
"count": 1
},
{
"interval": "DAY",
"count": 30
}
],
"newInterval": {
"interval": "MONTH",
"count": 3
},
"showOtherItems": true,
"reloadDelaySeconds": 1.5,
"style": {
"standaloneCard": true,
"cornerRadius": "",
"cardBackground": "",
"cardBorder": "",
"textColor": "",
"buttonBackground": "",
"buttonText": ""
},
"copy": {
"eyebrow": "Stock up, order less often",
"title": "Switch to a {supply}",
"body": "Get more of what you already love in fewer deliveries. Here is exactly what changes:",
"othersTitle": "Also on this subscription. Same quantity, but these ship {newInterval} too:",
"deliveryLabel": "Delivery",
"note": "Your next order date stays {date}. You can change this anytime.",
"button": "Switch to {supply}",
"buttonBusy": "Updating your subscription…",
"success": "Done! Your subscription now ships {newInterval}.",
"error": "Something went wrong and your subscription was not changed. Please try again.",
"partialError": "Your delivery schedule was updated, but some quantities were not. Tap the button to finish, or contact support.",
"buttonRetry": "Finish updating quantities"
}
};
var SUBSCRIPTION_QUERY =
'query skioUpsizeSubscription($id: uuid!) {' +
' SubscriptionByPk(id: $id) {' +
' id status nextBillingDate prepaidDeliveryPolicyId' +
' BillingPolicy { interval intervalCount }' +
' SubscriptionLines(where: { removedAt: { _is_null: true } }) {' +
' id quantity customAttributes titleOverride' +
' ProductVariant { platformId title Product { platformId title slug } }' +
' }' +
' }' +
'}';
var EDIT_INTERVAL_MUTATION =
'mutation skioUpsizeInterval($input: SubscriptionEditIntervalInput!) {' +
' subscriptionEditInterval(input: $input) { subscriptionId }' +
'}';
var UPDATE_LINE_MUTATION =
'mutation skioUpsizeLine($input: UpdateSubscriptionLineInput!) {' +
' updateSubscriptionLine(input: $input) { ok }' +
'}';
var script = document.currentScript;
var root =
(script && script.parentNode && script.parentNode.querySelector('[data-skio-upsize]:not([data-init])')) ||
document.querySelector('[data-skio-upsize]:not([data-init])');
if (!root) return;
root.setAttribute('data-init', 'true');
var style = CONFIG.style || {};
var copy = CONFIG.copy || {};
var products = CONFIG.products || {};
// The portal wraps custom blocks in its own padded card ([data-skio-allow-lists]). Keep it
// hidden until this subscription qualifies; optionally strip its background/padding
// so this block's own card stands alone.
var wrapper = root.closest('[data-skio-allow-lists]');
function showWrapper(show) {
if (!wrapper) return;
if (show) {
wrapper.style.removeProperty('display');
if (style.standaloneCard) {
wrapper.style.setProperty('background', 'transparent', 'important');
wrapper.style.setProperty('padding', '0', 'important');
wrapper.style.setProperty('border', '0', 'important');
wrapper.style.setProperty('box-shadow', 'none', 'important');
}
} else {
wrapper.style.setProperty('display', 'none', 'important');
}
}
showWrapper(false);
function setImportant(node, prop, value) {
if (value) node.style.setProperty(prop, value, 'important');
}
setImportant(root, 'background', style.cardBackground);
setImportant(root, 'border-color', style.cardBorder);
setImportant(root, 'color', style.textColor);
if (style.cornerRadius !== '' && style.cornerRadius != null) {
setImportant(root, 'border-radius', Number(style.cornerRadius) + 'px');
}
function el(name) { return root.querySelector('[data-el="' + name + '"]'); }
var button = el('button');
setImportant(button, 'background', style.buttonBackground);
setImportant(button, 'color', style.buttonText);
if (style.cornerRadius !== '' && style.cornerRadius != null) {
setImportant(button, 'border-radius', Math.max(0, Number(style.cornerRadius) - 4) + 'px');
}
function shopifyId(value) {
var s = String(value == null ? '' : value);
var i = s.lastIndexOf('/');
return i === -1 ? s : s.slice(i + 1);
}
function lower(list) { return (list || []).map(function (s) { return String(s).toLowerCase(); }); }
var productIds = (products.productIds || []).map(shopifyId);
var variantIds = (products.variantIds || []).map(shopifyId);
var handles = lower(products.productHandles);
var targetQty = Number(CONFIG.targetQuantity) || 3;
var maxStart = CONFIG.maxStartingQuantity == null ? targetQty - 1 : Number(CONFIG.maxStartingQuantity);
var newInt = CONFIG.newInterval || { interval: 'MONTH', count: 3 };
function unitName(interval, n) {
var u = String(interval || '').toLowerCase();
return n === 1 ? u : u + 's';
}
function intervalText(interval, count) {
var n = Number(count);
return n === 1 ? 'Every ' + unitName(interval, 1) : 'Every ' + n + ' ' + unitName(interval, n);
}
function supplyText(interval, count) {
var n = Number(count);
if (interval === 'DAY' && n % 30 === 0) return n / 30 + '-month supply';
return n + '-' + String(interval || '').toLowerCase() + ' supply';
}
var tokens = {
quantity: String(targetQty),
newInterval: intervalText(newInt.interval, newInt.count).toLowerCase(),
supply: supplyText(newInt.interval, newInt.count),
};
function fill(text, extra) {
return String(text || '').replace(/\{(\w+)\}/g, function (m, key) {
if (extra && key in extra) return extra[key];
return key in tokens ? tokens[key] : m;
});
}
function isEligibleInterval(policy) {
if (!policy) return false;
return (CONFIG.eligibleIntervals || []).some(function (e) {
return e.interval === policy.interval && Number(e.count) === Number(policy.intervalCount);
});
}
function isAddOnLine(line) {
var attrs = line.customAttributes ? JSON.stringify(line.customAttributes) : '';
return attrs.indexOf('isOneTimeUpsell') !== -1 || attrs.indexOf('surpriseDelightUpsell') !== -1;
}
function isTargetLine(line) {
var pv = line.ProductVariant;
if (!pv || isAddOnLine(line)) return false;
if (variantIds.indexOf(shopifyId(pv.platformId)) !== -1) return true;
var p = pv.Product;
if (!p) return false;
if (productIds.indexOf(shopifyId(p.platformId)) !== -1) return true;
return Boolean(p.slug) && handles.indexOf(String(p.slug).toLowerCase()) !== -1;
}
function lineName(line) {
if (line.titleOverride) return line.titleOverride;
var pv = line.ProductVariant || {};
var product = (pv.Product && pv.Product.title) || 'Item';
return pv.title && pv.title !== 'Default Title' ? product + ' – ' + pv.title : product;
}
function formatDate(value) {
var d = new Date(value);
if (isNaN(d.getTime())) return '';
return d.toLocaleDateString(undefined, { month: 'long', day: 'numeric', year: 'numeric' });
}
function waitForHelper(timeoutMs) {
return new Promise(function (resolve, reject) {
var start = Date.now();
(function check() {
if (typeof window.fetchSkioAPI === 'function' && typeof window.getFirstSubscriptionId === 'function') {
resolve();
} else if (Date.now() - start > timeoutMs) {
reject(new Error('fetchSkioAPI helper not available'));
} else {
setTimeout(check, 100);
}
})();
});
}
function call(query, variables) {
return window.fetchSkioAPI(query, variables).then(function (res) {
if (!res || (res.errors && res.errors.length)) {
var msg = res && res.errors && res.errors[0] && res.errors[0].message;
throw new Error(msg || 'Request failed');
}
return res.data;
});
}
var state = null; // { subscriptionId, nextBillingDate, lineChanges, intervalDone, linesDone: {} }
function setStatus(text, tone) {
var s = el('status');
s.textContent = text || '';
if (tone) s.setAttribute('data-tone', tone); else s.removeAttribute('data-tone');
}
function setBusy(busy, label) {
button.disabled = busy;
button.setAttribute('data-busy', busy ? 'true' : 'false');
if (label) button.textContent = label;
}
function itemRow(line, rightNode) {
var li = document.createElement('li');
li.className = 'skio-upsize__item';
var name = document.createElement('span');
name.className = 'skio-upsize__name';
name.textContent = lineName(line);
li.appendChild(name);
li.appendChild(rightNode);
return li;
}
function render(sub, targetLines, otherLines) {
var list = el('list');
list.innerHTML = '';
targetLines.forEach(function (line) {
var change = document.createElement('span');
change.className = 'skio-upsize__change';
change.innerHTML =
'<span class="skio-upsize__old"></span><span class="skio-upsize__arrow" aria-hidden="true">→</span><span class="skio-upsize__new"></span>';
change.querySelector('.skio-upsize__old').textContent = '×' + line.quantity;
change.querySelector('.skio-upsize__new').textContent = '×' + targetQty;
change.setAttribute('aria-label', 'quantity ' + line.quantity + ' to ' + targetQty);
list.appendChild(itemRow(line, change));
});
var others = el('others');
var othersList = el('othersList');
othersList.innerHTML = '';
if (CONFIG.showOtherItems !== false && otherLines.length) {
el('othersTitle').textContent = fill(copy.othersTitle);
otherLines.forEach(function (line) {
var qty = document.createElement('span');
qty.className = 'skio-upsize__qty';
qty.textContent = '×' + line.quantity;
othersList.appendChild(itemRow(line, qty));
});
others.hidden = false;
} else {
others.hidden = true;
}
el('eyebrow').textContent = fill(copy.eyebrow);
el('eyebrow').hidden = !copy.eyebrow;
el('title').textContent = fill(copy.title);
el('body').textContent = fill(copy.body);
el('body').hidden = !copy.body;
el('deliveryLabel').textContent = fill(copy.deliveryLabel || 'Delivery');
el('oldInterval').textContent = intervalText(sub.BillingPolicy.interval, sub.BillingPolicy.intervalCount);
el('newInterval').textContent = intervalText(newInt.interval, newInt.count);
var date = formatDate(sub.nextBillingDate);
el('note').textContent = date && copy.note ? fill(copy.note, { date: date }) : '';
el('note').hidden = !el('note').textContent;
button.textContent = fill(copy.button);
root.hidden = false;
showWrapper(true);
}
function run() {
setStatus('');
setBusy(true, fill(copy.buttonBusy));
var steps = Promise.resolve();
if (!state.intervalDone) {
steps = steps.then(function () {
return call(EDIT_INTERVAL_MUTATION, {
input: {
subscriptionId: state.subscriptionId,
billingInterval: newInt.interval,
billingIntervalCount: Number(newInt.count),
nextBillingDate: state.nextBillingDate,
},
}).then(function (data) {
if (!data || !data.subscriptionEditInterval) throw new Error('Interval not updated');
state.intervalDone = true;
});
});
}
state.lineChanges.forEach(function (line) {
steps = steps.then(function () {
if (state.linesDone[line.id]) return;
return call(UPDATE_LINE_MUTATION, {
input: { subscriptionLineId: line.id, quantity: targetQty },
}).then(function (data) {
if (!data || !data.updateSubscriptionLine || !data.updateSubscriptionLine.ok) {
throw new Error('Line not updated');
}
state.linesDone[line.id] = true;
});
});
});
steps
.then(function () {
setBusy(true, fill(copy.button));
button.setAttribute('data-busy', 'false');
setStatus(fill(copy.success), 'success');
setTimeout(function () { window.location.reload(); }, (Number(CONFIG.reloadDelaySeconds) || 1.5) * 1000);
})
.catch(function (err) {
if (window.console && console.warn) console.warn('[skio-upsize]', err);
if (state.intervalDone) {
setBusy(false, fill(copy.buttonRetry));
setStatus(fill(copy.partialError), 'error');
} else {
setBusy(false, fill(copy.button));
setStatus(fill(copy.error), 'error');
}
});
}
button.addEventListener('click', function () {
if (state && !button.disabled) run();
});
waitForHelper(10000)
.then(function () {
var subscriptionId = window.getFirstSubscriptionId();
if (!subscriptionId || subscriptionId === 'undefined') return;
return call(SUBSCRIPTION_QUERY, { id: subscriptionId }).then(function (data) {
var sub = data && data.SubscriptionByPk;
if (!sub) return;
if (sub.status !== 'ACTIVE' || sub.prepaidDeliveryPolicyId || !sub.nextBillingDate) return;
if (!isEligibleInterval(sub.BillingPolicy)) return;
var lines = sub.SubscriptionLines || [];
var targetLines = lines.filter(isTargetLine);
if (!targetLines.length) return;
// A selected product above the starting cap = a deliberate quantity on this
// cadence (or one the switch would shrink), so don't offer the change.
var tooHigh = targetLines.some(function (l) { return l.quantity > maxStart; });
if (tooHigh) return;
state = {
subscriptionId: sub.id,
nextBillingDate: sub.nextBillingDate,
lineChanges: targetLines,
intervalDone: false,
linesDone: {},
};
var otherLines = lines.filter(function (l) { return !isTargetLine(l) && !isAddOnLine(l); });
render(sub, targetLines, otherLines);
});
})
.catch(function (err) {
if (window.console && console.warn) console.warn('[skio-upsize]', err);
});
})();
</script>
How to install
- Copy the code above, or download the .html file.
- Go to
Storefront→Customization→Blocks, then clickAdd block→Custom block. - Name it and paste the whole file into the code editor.
- Swap anything the file asks you to, like
[BRAND], product names or Quick Action IDs. The AI prompt below can walk you through it. - Save, drag it where you want it in the layout, then
Publish. Check it on a test subscription’s magic link with?forcePreview=true, since some scripts don’t run in Preview.
It ships with placeholder products (productHandles your-product-handle and another-product-handle), so the card stays hidden until you list your own. In CONFIG, list the eligible products in productHandles (the part after /products/ in a product link), productIds or variantIds, then set targetQuantity, eligibleIntervals (your current monthly schedule, e.g. MONTH 1 or DAY 30) and newInterval. Pick a newInterval that matches one of your existing selling plans. maxStartingQuantity controls who sees the card: with the sample settings (target 3, max 2), a subscriber getting 2 a month is offered 3 every 3 months, which is less product overall, so set it to 1 if that shouldn't happen. Every selected product goes to targetQuantity; other items keep their quantity but move to the new schedule too, and the card lists them before the click. It changes quantity and schedule only, never price, and the card shows no prices, so the next order (same date) bills for the bigger quantity. For a stock-up discount, create a quantity-based volume discount (in Skio: Grow › Volume Discounts) with the same products and “At least” your target quantity. One rule for all products allows mix and match; one rule per product requires the same product. If the schedule changes but a quantity doesn't, the card says so and the button finishes only the missing quantities. Card text and colors are in CONFIG.copy and CONFIG.style; leave the style values blank to use your portal theme. It uses Skio's portal API (fetchSkioAPI), so it needs a Skio customer portal.
Customize it with AI
Paste this prompt into Claude Code or Codex. It asks for the code and your brand and product details, then writes a version for your store.
I want to add a custom extension from customizeyourportal.xyz to my subscription customer portal. Walk me through customizing it for my brand, then write the finished code. EXTENSION Name: Stock-Up Switch (No. 21) Page: /blocks/stock-up-switch What it does: A card on the subscription page that offers a bigger supply on a longer schedule: the selected products go to a set quantity (for example ×3) and delivery moves to a longer schedule (for example every 3 months). Before the subscriber clicks, it lists every change, including the other items on the subscription that will move to the new schedule, and says the next order date stays the same. One click changes the schedule, then the quantities, then reloads the page. It only shows on active, non-prepaid subscriptions on a qualifying schedule, and stays hidden for anyone already at or above the starting quantity you set. My portal app: Skio WHAT THE BUILDER SAYS TO CUSTOMIZE It ships with placeholder products (productHandles your-product-handle and another-product-handle), so the card stays hidden until you list your own. In CONFIG, list the eligible products in productHandles (the part after /products/ in a product link), productIds or variantIds, then set targetQuantity, eligibleIntervals (your current monthly schedule, e.g. MONTH 1 or DAY 30) and newInterval. Pick a newInterval that matches one of your existing selling plans. maxStartingQuantity controls who sees the card: with the sample settings (target 3, max 2), a subscriber getting 2 a month is offered 3 every 3 months, which is less product overall, so set it to 1 if that shouldn't happen. Every selected product goes to targetQuantity; other items keep their quantity but move to the new schedule too, and the card lists them before the click. It changes quantity and schedule only, never price, and the card shows no prices, so the next order (same date) bills for the bigger quantity. For a stock-up discount, create a quantity-based volume discount (in Skio: Grow › Volume Discounts) with the same products and “At least” your target quantity. One rule for all products allows mix and match; one rule per product requires the same product. If the schedule changes but a quantity doesn't, the card says so and the button finishes only the missing quantities. Card text and colors are in CONFIG.copy and CONFIG.style; leave the style values blank to use your portal theme. It uses Skio's portal API (fetchSkioAPI), so it needs a Skio customer portal. HOW TO WORK 1. Ask me to paste the full code (the "Copy code" button on the page) or to give you the path to the downloaded stock-up-switch.html. Wait until you have it. 2. Read the whole file. List every value that is specific to the original brand or needs my input: brand name and [PLACEHOLDERS], product and variant names or IDs, prices, discount codes and reward amounts, Quick Action IDs or tokens, store domains and API endpoints, colors, fonts, logos and images, and any copy that names the original brand, products or offers. Include everything in the builder's notes above. 3. Ask me for those values in one numbered list, with the current value next to each, so I can answer or say "keep". If you can open web pages, offer to pull my brand colors, fonts, logo and product names from my store's URL. 4. Don't invent stats, reviews, IDs, prices or claims. If I don't have a value, leave a clearly marked TODO in the code and tell me. 5. Write the customized version as stock-up-switch-<my-brand>.html. Change only what my brand needs. Keep the logic, behavior and structure the same, and keep it one self-contained file (HTML, <style> and <script>). 6. Finish with a short list of what you changed, any TODOs left, and these install steps for Skio: 1. Go to `Storefront` → `Customization` → `Blocks`, then click `Add block` → `Custom block`. 2. Name it and paste the whole file into the code editor. 3. Save, drag it where you want it in the layout, then `Publish`. Check it on a test subscription’s magic link with `?forcePreview=true`, since some scripts don’t run in Preview.
Blocks are shared as-is by the people who built them. Read the code before you add it to your portal, and test it with a test subscriber first.