• Resolved ssoulless

    (@ssoulless)


    Hello, the plugin is displaying wrong the checkbox, as it needs to be inside a span element with some classes in order to show properly, I had to go to the file

    /includes/class-mailchimp-woocommerce-newsletter.php

    and modify it manually, but I would like how can I modify this output without touching the plugin files, any idea?

Viewing 1 replies (of 1 total)
  • Plugin Support khungate

    (@khungate)

    Hi @ssoulless, thanks for reaching out. This sounds like it’s probably something needed in the specific theme (the default WordPress/Woo themes doesn’t require the span element), but you could add some javascript to the theme files.

    Here are official instructions on how to do that: https://developer.www.ads-software.com/themes/basics/including-css-javascript/. Here are the snippets:

    jQuery( window ).load(function() {

    // Please comment or remove the jQuery() lines you don’t want to add.

    /**
    * Wraps the checkbox input element, with a span element with custom classes
    */
    jQuery(‘#mailchimp_woocommerce_newsletter’).wrap(‘<span class=”custom-class”/>’);

    /**
    * Adds a css class to the checkbox label element
    */
    jQuery(“label[for=’mailchimp_woocommerce_newsletter’]”).addClass(‘new-class’);

    /**
    * Adds a css class to the span element inside checkbox label
    */
    jQuery(“label[for=’mailchimp_woocommerce_newsletter’] span”).addClass(‘other-class’);

    });

    Let us know if you have any follow up questions.

Viewing 1 replies (of 1 total)
  • The topic ‘How to modify the echo html of the checkbox without modifying the plugin files’ is closed to new replies.