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>
User | RANK |
---|---|
6 | |
5 | |
5 | |
4 | |
4 |
Explore the 30-30-30 rule, a dynamic social media strategy for new businesses. Learn how t...
By Trevor Sep 20, 2023Discover how to leverage the often overlooked footer of your ecommerce site to gain custom...
By Skye Sep 15, 2023In this blog, we’ll be shining a light on Shopify Partners, Experts, and Affiliates. Who a...
By Imogen Sep 13, 2023