Viewing 1 replies (of 1 total)
  • Plugin Author info.propoza

    (@infopropoza)

    We do not have such a functionality yet, however you could make use of the add_action and add_filter to accomplish what you want.

    For example to change the button text “Add to cart” you can make use of the filters “woocommerce_product_single_add_to_cart_text” and “woocommerce_product_add_to_cart_text”.
    Simply add a function like the one below to your functions file found at Appearance->Editor.

    function propoza_button_text()
    {
        return __(‘Add product to Quote', 'propoza’);
    }

    Next you need to register the function to the filter by adding

    add_filter('woocommerce_product_single_add_to_cart_text', 'propoza_button_text');
    add_filter('woocommerce_product_add_to_cart_text', 'propoza_button_text’);

    Removing the prices can be done in a similar way. Add the next function:

    function quote_only_mode()
    {
        remove_action('woocommerce_proceed_to_checkout','woocommerce_button_proceed_to_checkout');
        remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
        remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
    
        add_filter( 'woocommerce_get_price_html', 'hide_all_wc_prices');
        add_filter( 'woocommerce_cart_item_price', 'hide_all_wc_prices');
        add_filter( 'woocommerce_cart_item_subtotal', 'hide_all_wc_prices');
    }

    This function removes the “Proceed to checkout” button and adds filter to the prices. Next you should register this function to the “init” action.

    add_action('init','quote_only_mode’);

Viewing 1 replies (of 1 total)
  • The topic ‘Need "get a quote" and no prices’ is closed to new replies.