Thank you, but I have solved the issue on the harder way.
I would give you one advice, since that I couldn’t find this article in the documentation: change the name or something. Since that ‘change strings’ is not very intuitive.
Here is my harder solution, since that I had to override the function that does change the string in the button. This is just a showoff, hahah.
Here is the code:
`document.addEventListener(‘DOMContentLoaded’, function() {
var orderButton = document.getElementsByClassName(‘wcf-bump-add-to-cart’)[0];
var isOrdered = false;
orderButton.textContent = ‘YES! ADD TO MY ORDER’;
const config = { attributes: true };
function callback(mutationList, observer) {
var target = mutationList[0].target
if (mutationList[0].attributeName === ‘class’) {
if (isOrdered) {
target.textContent = ‘YES! ADD TO MY ORDER’
isOrdered = false;
} else {
target.textContent = ‘ADDED TO ORDER’
isOrdered = true;
}
}
}
const observer = new MutationObserver(callback);
observer.observe(orderButton, config);
});