Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Re: How to add a customer metafield as a note attribution to an order?

How to add a customer metafield as a note attribution to an order?

premmels
Excursionist
19 0 4

Hi there,

some of my customers have a VAT ID in a metafield with the key "vatNumber" that has a value like "DE123456789".

 

In order for my invoice app to read this VAT ID, I need to add it to an oder as a note attribution like

  name: vat-id

  value: DE123456789

 

For most things like that I'm using the Shopify Flow app. Unfortunately there doesn't seem to be an action "Add note attribution".

 

Is there any way to add this as a note attribution?

 

Thanks,

Patrick

Replies 7 (7)

Brett_Helium
Shopify Partner
286 54 129

Hey @premmels,

Using Shopify Flow, it is definitely possible to update the order note itself. I am not aware of anything different than this that is specifically called a "note attribution", so I'm not sure if you're looking for something different.

If you just need to update the note itelf, you could use something like this, wich would set "vat-id: DE123456789" as the note:

Brett_Helium_0-1698432889294.png

 

Brett | Helium
- Customer Fields ✪✪✪✪✪ (360+ reviews)
- Meteor Mega Menu ✪✪✪✪✪ (290+ reviews)
- Strike Automatic Discounts NEW!
premmels
Excursionist
19 0 4

Thanks for the reply. "Note attribution" does indeed seem to be s.th. different from a "note" in Shopify. I have to say it's very well documented and the only possibility I found was to ask here.

gr_trading
Shopify Partner
1948 145 204

Hi @premmels 

 

You can custom-code the add-to-cart event or cart page to add note_attribute.

 

Use below script code to add note and note_attribute 

jQuery.post(window.Shopify.routes.root + 'cart/update.js', { attributes: {'repeat order':__note_val } },function(){
              window.location.href = '/cart';
            });

 

Hope this will help...

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee
premmels
Excursionist
19 0 4

Thank you! I only have very limited experience with JS/jQuery and have to play around with it to see if it works.

Actually, do you see any possibility to add the note_attribution to the order AFTER the sale? On the thank you page for example?

gr_trading
Shopify Partner
1948 145 204

Hi @premmels ,

 

Updation in order object of Shopify is possible only by an APP.

 

So if you are not able to achieve it using flow APP, we can create a custom APP to achieve the same.

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee
premmels
Excursionist
19 0 4

Hm, too bad. I was hoping not to need another app (additional code and possible problems with other apps) but rather just some code. Thank you, I'll try it out.

gr_trading
Shopify Partner
1948 145 204

Not related, but scripting can work in your case.

 

Just curious why you want to add note_attribute after completion of order as script will only run when there will be GST no in customer account.

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee