• Resolved TOTLD

    (@totld)


    Hey there,

    Thanks for the nice simple plugin that turns the regular cart into a quote order! I was just wondering if you could advise the best way to achieve custom button labels?

    Currently the usual “Add to cart” button on the product pages is labelled “Request Quote”. Am I able to change this to “Add to quote cart”?

    The final button when placing the quote order needs to stay labelled as “Request Quote”, however, I’d like the button on the product page to read “Add to quote cart”, so that the user knows that they can add as many products as they like to the quote cart before requesting the final quote.

    I’ll be looking to change some other Woocommerce labels as well, however, I think that will be done within the Woocommerce plugin, therefor is not your problem ??

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author pinal.shah

    (@pinalshah)

    Hi @totld,

    Currently the plugin does not provide any settings using which you can easily change the text of the ‘Add to cart’ button on the Shop and product pages. However, you can achieve the same by pasting the below code in the functions.php file of your active theme.

    
    add_filter( 'woocommerce_product_add_to_cart_text', 'custom_change_button_text', 11 );
    add_filter( 'woocommerce_product_single_add_to_cart_text', 'custom_change_button_text', 11 );
                
    function custom_change_button_text() {
        
        global $post;
        $post_id = $post->ID;
        // check if setting is enabled
        $enable_quote = product_quote_enabled( $post_id );
        
        if ( $enable_quote ) {
            $cart_text = __( 'Add to Quote Cart', 'quote-wc' );
        } else {
            $cart_text = __( 'Add to Cart', 'quote-wc' );
        }
        
        return $cart_text;
    }
    

    The above code will help you change the text on the single product pages as well as the Shop page of your site.

    I hope this helps. Please let me know if you have any further queries.

    Thanks,
    Pinal

Viewing 1 replies (of 1 total)
  • The topic ‘Editing Button Labels’ is closed to new replies.