I’ve been using the Additional Scripts box on the checkout settings to display a content box based on order tags and fulfilment status.
It says ‘Additional scripts is deprecated. your current customizations, then recreate the customizations you want to keep using pixels in [customer events] and app blocks in the editor.’
I can’t seem to find any examples of how to migrate this using either pixels or app blocks - is it possible?
I am not using Shopify Plus.
Here’s the code:
<script>
const tags = {{ checkout.order.tags | json }};
const fulfillment = {{ checkout.order.fulfillment_status | json }};
let progress_message = '';
if (fulfillment == 'partial') {
progress_message = 'Orders with multiple items are manufactured and shipped separately as soon as possible.<br><br>Your mats still in production are ';
}
if (fulfillment == 'unfulfilled') {
progress_message = 'Your mats are ';
}
if (progress_message) {
if (tags.includes('x READYFORSHIPPING')) {
progress_message += 'packed and on their way to Evri. You will be emailed your tracking links shortly.';
}
else if (tags.includes('x EMBROIDERY')) {
progress_message += 'now being embroidered.';
}
else if (tags.includes('x SEWING_MACHINIST')) {
progress_message += 'currently being sewn.';
}
else if (tags.includes('x CUTTER')) {
progress_message += 'being expertly cut by a CNC cutting machine to fit your vehicle.';
}
else {
progress_message += 'ready to go into production. Our team are getting ready.';
}
Shopify.Checkout.OrderStatus.addContentBox(
'<div class="text-container"><h2>Order status</h2><p>' + progress_message + '</p></div>'
)
}
</script>