• Resolved tarikbisevac

    (@tarikbisevac)


    I have an order bump on my checkout page. But I can’t find setting to change the order bump button text. Do I need to change that via JavaScript? If so, do you have any tips for me?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @tarikbisevac,

    Thank you for choosing our product and writing in!

    You can easily change that using the Loco Translate plugin.

    You can find the “Add” string in CartFlows Pro.

    Read more: https://cartflows.com/docs/change-cartflows-strings-using-loco-translate/

    Best,

    Thread Starter tarikbisevac

    (@tarikbisevac)

    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);
    });

    Plugin Support Aamir

    (@aamiribsf)

    Hello @tarikbisevac,

    Glad that you were able to sort it OUT.

    Thanks for sharing the code. That will really help others having the same issue.

    Please feel free to get in touch if you need help with anything.

    Thank you & Have a great day ahead!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change Order Bump Button Content’ is closed to new replies.