Need to update a product note dynamically based on the product price during checkout, while preserving any note the customer already typed by appending extra text instead of replacing it.
Key proposed approach:
Use JavaScript (JS) to watch the note <textarea> input, for example on keypress.
Get the product price from the page using an element ID or CSS class.
Apply a condition such as: if the price is less than 100, append a predefined note/message.
Keep the existing customer note and add the extra text after it.
Technical points mentioned:
textarea: the text input field for notes.
keypress: a JavaScript event triggered when the user types.
append: adding text to existing content rather than overwriting it.
Current status:
No complete code solution was provided.
The discussion remains open, with only a high-level JS-based direction given.
i have managed to add the note for the product when checking out the product. I need to update the note in the code depending on some price conditions from the prodcuts
like if the price is less then 100 i need to place a special note in the note . i prefer to append to the note in case the user has entered a note
It’s possible for you to implement but only if you know JS
Logic is
On keypress in note ‘textarea’ check the price of product. You can get product by ID/class use one which you preferred.
Once you get it in JS write down a condition
if product price is les than 100 then append your specific text.
You can find both ‘keypress’ and ‘append’ function on google.