Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Woocommerce Checkout for Quotes Only

Tags:

woocommerce

How would go about using woocommerce without pricing but keeping the cart functionality? Id like the ability to add products to cart (changing button to to say add to quote) and then when checking out instead of going to payment gateway it would instead submit all the items in the cart for a quote. Once I receive the order I would contact the customer with a quote. You can edit an order in the admin so technically I could change the 0 cost items to the quoted prices and then notify the customer that their order/quote has been updated.

Could I just make all items have 0 cost and hide the prices on the front end ?

like image 903
user1791797 Avatar asked May 23 '13 23:05

user1791797


2 Answers

Set a price of '0' so the 'add to cart' buttons still show, but in your templates hide the price fields, and change the 'add to cart' labels to whatever is appropriate, so 'add to quote' or 'add to shortlist' or whatever you're using the cart for.

If you still want the checkout function disable all payment options except for 'cash on delivery', and change the title of this payment option to 'No Payment Required For Quotes' or similar. No payment is then required, yet the customer can create orders without paying for them

like image 179
crdunst Avatar answered Jan 02 '23 08:01

crdunst


It takes some digging to find all the right filters in WooCommerce to make this happen but once you find them, it's pretty straightforward. These are the various snippets I'm using to change "Cart" language to "Quote" and streamline the checkout process:

add_filter('woocommerce_product_single_add_to_cart_text', 'rental_single_product_add_to_cart',10,2);
add_filter('woocommerce_product_add_to_cart_text', 'rental_single_product_add_to_cart',10,2);
function rental_single_product_add_to_cart( $title,$product ) {
    return 'Add to Quote';
}

add_action('woocommerce_widget_shopping_cart_before_buttons', 'rental_before_mini_cart_checkout',10);
function rental_before_mini_cart_checkout(){
    //change buttons in the flyout cart
    echo '
        <p class="buttons" style="display: block;">
                <a href="'.esc_url( wc_get_checkout_url() ).'" class="button checkout wc-forward">Submit for  Quote</a>
        </p>
    ';
}

add_filter('woocommerce_billing_fields','rental_billing_fields',10,1);
function rental_billing_fields($fields){
    unset($fields['billing_country']);
    unset($fields['billing_address_1']);
    unset($fields['billing_address_2']);
    unset($fields['billing_city']);
    unset($fields['billing_state']);
    unset($fields['billing_postcode']);

    return $fields;
}

add_filter('woocommerce_checkout_fields','rental_checkout_fields',10,1);
function rental_checkout_fields($fields){
    //change comment field labels
    $fields['order']['order_comments']['label'] = 'Notes';
    return $fields;
}

add_filter('woocommerce_order_button_text','rental_order_button_text',10,1);
function rental_order_button_text($text){
    return 'Submit to Request Confirmed Quote';
}

This plus the suggestion from /u/crdunst regarding payment methods should make switching to a Quote submission a breeze!

like image 44
Andrew Cafourek Avatar answered Jan 02 '23 08:01

Andrew Cafourek