Accepting credit cards, warehouses, and shipping and fulfilling orders
Hello everyone, I am trying to add a note to the orders of my store, the content of the note is a json but I see that not all the orders are added the note, what could be happening? Thank you in advance for your help.
The code I use is the following:
<script>
(function ($) {
$(document).on("page:load page:change", function () {
if (Shopify.Checkout.step === 'payment_method') {
var Origen = 'WEB';
{% if customer.tags contains 'EMBAJADOR' %} Origen = 'EMBAJADOR';{% endif %}
setObjectNote(Origen);
}
});
function setObjectNote(origen){
var ObjNote = {}
var myInput = document.getElementById("checkout_billing_note");
if (myInput == null){
var nota= '<div data-address-field="note" data-autocomplete-field-container="true" style="display: none;" class="field field--optional"><div class="field__input-wrapper"><label class="field__label field__label--visible" for="checkout_billing_note">Origen (opcional)</label><input placeholder="Origen (opcional)" autocomplete="billing note" autocorrect="off" data-backup="note" class="field__input" size="30" type="text" name="checkout[note]" id="checkout_billing_note"></div></div>'
$("form[data-payment-form='']").append(nota)
myInput = document.getElementById("checkout_billing_note");
}else
{
myInput.value = "";
}
ObjNote.Origen = origen;
myInput.value = JSON.stringify(ObjNote);
}
}) (Checkout.$);
</script>
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025