Support » Plugin: WooCommerce » Need to add my newsletter after the shop

  • Resolved facis

    (@facis)


    Hi Everyone,

    i have a big problem :/

    I need to add my newsletter after the woocommerce shop page.

    I already tried that one:
    function woa_content_after_shop() {
    echo “<p><center>[mc4wp_form id=”000″]</center></p>”;
    }

    add_action( ‘woocommerce_after_shop_loop’, ‘woa_content_after_shop’);

    but the functions.php can’t do it without crashing 😀

    And the other problem, if that would work is that the newsletter is between the last product and the last checkbox for deciding how many products per page.

    I just need a way to add my newsletter: [mc4wp_form id=”000″] behind the whole shop page but bevor the footer.

    Please help! 😀

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    It could be easier to add it inside the footer, in a widget 🙂 woocommerce_after_shop_loop affects all shop pages showing products.

    If you insist on code, ensure the ‘quotes’ are not curly. That will break. Also, you have double quotes on the outside, and inside, which are not escaped. Swap the outer quotes to single quotes.

    Thread Starter facis

    (@facis)

    Thank you for the answer! I am doing it for someone else and he insists on having it between the end of the shop and the footer…

    I changed the quotes but it still crashes :S and is there no possibility to get it behind the shop section and before the footer? :/

    Thanks!

    I don’t think you can stick a shortcode in an echo, you would need to use the do_shortcode() function, so:

    echo '<p><center>';
    echo do_shortcode('[mc4wp_form id="000"]');
    echo '</center></p>';
    

    Sorry not tested.

    Validate your php using this service before running it:
    http://phpcodechecker.com/
    Valid code may not work but at least it shouldn’t crash.

    Thread Starter facis

    (@facis)

    thanks a lot ill try!!! 🙂

    Thread Starter facis

    (@facis)

    it worked you are awesome! Thanks a lot.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Need to add my newsletter after the shop’ is closed to new replies.