Insert PHP
I'm struggling with this code (2 posts)

  1. raiban
    Posted 2 years ago #


    I'm adding this to the Product Short Description to try and change the "Add to Cart" to "Pre-order", but it doesn't work (N.B. the PHP works fine when adding it to functions.php, but that changes all the buttons and I only want it for some pages):


    add_filter( 'add_to_cart_text', 'woo_custom_cart_button_text' );
    add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' );
    add_filter( 'woocommerce_product_add_to_cart_text', 'woo_custom_cart_button_text' );
    function woo_custom_cart_button_text()
    return __( 'Pre-order', 'woocommerce' );

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]


    Any idea why this is?
    The theme I'm using is woocommerce one called Blaszok.

    Any help will be deeply appreciated as I'm at my wits end with this :(

  2. WillBontrager
    Plugin Author

    Posted 2 years ago #

    Sorry, I can't help with Woo Commerce.

    This page might help with the scope issue.


    For future reference, although I appreciate the starts, let me ask that you please use the Support area for support.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Insert PHP
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.