Home Forums WoodMart support forum custom js doesn’t work.

custom js doesn’t work.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #590804

    FrancescoJav
    Participant

    I inserted this script in the custom section because I don’t want to show the available pieces.
    Then the script checks if there is the text: “n availability” I replace it with a text “Immediate Availability”. If it says “out of stock” it doesn’t matter.

    var stockElement = document.querySelector(‘.woocommerce-variation-availability .stock.in-stock’);
    if (stockElement) {
    var stockText = stockElement.textContent.trim();
    if (stockText !== ‘Esaurito’ && stockText.match(/^\d+\sdisponibili$/)) {
    stockElement.textContent = ‘Disponibilità Immediata’;
    }
    }

    #590937

    Hung Pham
    Keymaster

    Hi peppec87,

    Thanks for reaching to us.

    It looks like you want to translate or change words, if so:

    + In order to change / translate words. Please make sure you synced the strings first before changing / translating WooCommerce, WoodMart Core plugins and WoodMart theme. You can refer to article

    https://xtemos.com/docs-topic/theme-translation/

    + You are also need to select the language for the backend and theme settings for admin from the admin user profile, please edit the user’s profile and then select the language for that user it will show the same on the backend.

    Regards,

    #591053

    FrancescoJav
    Participant

    Hi,

    I don’t want to translate but I want to hide the number of available pieces and replace the wording with the writing “immediate availability!

    #591156

    Hung Pham
    Keymaster

    Hi peppec87,

    Unfortunately, it requires customization to make it work, which is out of our basic support.

    Thanks for understanding our limitations. Let me know if you have any questions.

    Kind Regards

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)