Startseite » E-Commerce » How to Create Catalog With “Request for Price” Using WooCommerce

    How to Create Catalog With “Request for Price” Using WooCommerce

    WooCommerce offers a great way to list your products and makes it pretty easy for your customers to buy and for you to manage your orders. Sometimes, however, you may not want to actually sell your things but rather just showcase them.

    In this article I'll show you how to easily create an awesome catalog and provide a price request option by using only inherent WooCommerce options and a few pretty basic customization snippets.

    Why create a Catalog?

    Creating a catalog of products instead of a classic webshop can be beneficial for many reasons.

    It may come in handy if you:

    • Don't want to sell online. You'll just need to show your catalog online and people will pop into your physical store somewhere and get busy buying.
    • May want to provide your services at a custom price for your customers or if you cannot name a price until you acquire a special component (that you don't know the acquisition price of).
    • Cannot afford a plugin that would customize price based on the amount in the cart or by targeted shipping locations, methods and/or product sizes or some other custom values.
    • Don't want your competitors to know your costs.
    • Don't want to sell or showcase your products to just any buyer.

    Why use WooCommerce for this?

    WooCommerce comes with a lot of options out of the box, making your catalog that much easier to manage and use. By default, you can add a bunch of attributes and other data to your products, create categories and put tags on your stuff. It's also easier to separate your catalog from your blog or site.

    You can also suggest relevant wares for each product or have WooCommerce automatically suggest them for you. Furthermore, your visitors will be able to filter and/or sort your stuff as they please, to make it easier for them to find the item they are looking for.

    Also, creating a WooCommerce catalog lets you provide an easy price request option for your potential customers. By allowing them to put the products into a cart, they will be able to create a wishlist and ask for the price for items in the list. You will also get their address and/or email address if you want to and your price requests will get stored as Orders.

    The step-by-step guide

    Before we start, you should decide whether or not you want to provide a price request option for the products you present.

    Step 1: Setting (or not Setting) Prices

    (I) Without price request

    If you don't want any price requests, leave the price field empty. In this case WooCommece will not show the shop-related form fields, so you won't see any amount fields, prices or add to cart buttons.

    The good news is if you choose this cataloging method, you are already finished. Just add stuff to your brand new catalog and you're good to go!

    (II) With price request

    If you want to allow your customers to request price, you start out by making your products free. Set prices to 0.

    This way, when we're done, your visitors will be able to put your catalog products on a wishlist without having to spend a dime.

    Step 2: Shop options

    This step is going to be even easier as no code is required for it. You want to make sure to set the following in your admin area:

    • Rename your original Cart and Checkout pages to 'Wishlist' and 'Request prices', respectively (Pages)
    • Disallow the use of coupons to avoid discount notices on various shop-related pages (WooCommerce > Settings > Checkout tab)
    • Disable every payment method to ensure none of those show on your checkout page (WooCommerce > Settings > Checkout tab)
    • Disable shipping altogether, or if you want visitors to decide whether to request shipping price, enable and relabel two different shipping methods and set them up both to be FREE
    • Disable registration on checkout and my account page and turn off displaying log in reminders unless you want to handle users on your catalog site as well (WooCommerce > Settings > Accounts tab)
    • Disable every single customer email, or if you want to send a confirmation email about the requests to the customer, just disable the completed order emails to avoid unnecessary duplicates and invoices about free orders (that virtually won't even exist) (WooCommerce > Settings > Emails tab)

    Step 3: Relabeling

    In this step we'll make sure that your site looks nothing like you're giving away stuff for free. For this reason we'll rewrite your buttons and hide free notices.

    Just add the code below to your theme's functions.php or to your very own plugin.

    3.1: No 'Free' label

    The first and foremost substep is to hide free shipping notices and labels on the single product page and the product loops e.g. shop and product category pages.

    add_filter( 'woocommerce_free_price_html', 'hide_free_price_notice'); add_filter( 'woocommerce_variable_free_price_html', hide_free_price_notice' ); add_filter( 'woocommerce_variation_free_price_html', 'hide_free_price_notice' ); function hide_free_price_notice( $price )  return"; 

    3.2: Button labels

    While creating your catalog we are gradually transforming your cart into a wishlist and your checkout page into a price request form. First we need to relabel the buttons.

    add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' ); function woo_custom_cart_button_text()  return __( 'Add to Wishlist', 'woocommerce' );  add_filter( 'woocommerce_product_add_to_cart_text', 'woo_custom_cart_button_text' ); function woocommerce_button_proceed_to_checkout()  $checkout_url = WC()->cart->get_checkout_url(); "> ?>  add_filter( 'woocommerce_order_button_text', create_function(", 'return "Send me an offer";' ) );

    3.3: Hide your free prices everywhere

    WooCommerce shows your $0 prices in your cart (or, in this case, the Wishlist) so we must remove those columns. You have two options for that.

    One, you can use CSS by adding this to your child theme's style.css.

    .cart_totals h2, .cart_totals .shop_table , .cart-subtotal, .order-total, .woocommerce-shipping-fields, .product-total display:none; 

    Two, you can delete the unwanted columns altogether. In order to do this, we'll overwrite the cart template files as follows:

    1. Create a woocommerce folder with a cart subfolder in your (child) theme's folder so you'll end up with something like this: wp-content/themes/mytheme/woocommerce/cart/
    2. Download and open the original woocommerce cart.php with a text editor; the file should be here: wp-content/plugins/woocommerce/templates/cart/
    3. Delete these lines: and the section starting with and ending in and the section starting with and ending in
    4. Download and open the original woocommerce cart-totals.php with a text editor; the file is where you found cart.php
    5. Delete these lines:

      and the whole table, starting with and ending with
    6. Upload both files you have just edited into the woocommerce/cart folder within your theme directory

    If you allowed users any sort of shipping options in Step 2 above, we need to disable the free shipping notice as well, like so:

    add_filter( 'woocommerce_cart_shipping_method_full_label', 'remove_free_label', 10, 2 ); function remove_free_label($full_label, $method) $full_label = str_replace("(Free)","",$full_label); return $full_label; 

    Step 4: Email text settings

    We're getting really close to having our very own WooCommerce catalog with the price request option. In fact, if in Step 2, you disabled every customer email altogether, you can just proceed to the Step 5.

    If you want to send customer confirmation (as it is very elegant), we just need to make sure that we have our email subjects right and that we don't send any $0 prices, and also maybe rewrite our email text a bit.

    4.1. Email subject and heading

    In the admin area, WooCommerce > Settings > Emails tab, you need to rewrite Processing order, because new requests will be in a processing status as customers are unable to instantly pay for them. For clarity, it's best to rewrite your very own admin notification email (New order).

    4.2. Remove price from emails

    By default, the prices are sent with the order confirmation, so we need to overwrite the original email templates.

    1. Download and open the original woocommerce email-order-items.php with a text editor; the file should be here: wp-content/plugins/woocommerce/templates/emails/plain
    2. Delete this line:echo "\n" . sprintf( __( 'Cost: %s', 'woocommerce' ), $order->get_formatted_line_subtotal( $item ) );
    3. Download and open the original woocommerce email-order-details.php with a text editor; the file should be here: wp-content/plugins/woocommerce/templates/emails/plain
    4. Delete these lines:
      if ( $totals = $order->get_order_item_totals() )  foreach ( $totals as $total )  echo $total['label'] . "\t " . $total['value'] . "\n";  
    5. Upload both files you just edited into the woocommerce/emails/plain folder within your theme directory

    4.3. Rewrite flavor texts

    By default, WooCommerce will introduce your emails by the following: "Your order has been received and is now being processed. Your order details are shown below for your reference".

    If you want to overwrite this, you need to follow these 3 steps:

    1. download and open the original woocommerce customer-processing-order.php with a text editor; the file should be here: wp-content/plugins/woocommerce/templates/emails/
    2. rewrite the line responsible for the text above as you wish:echo __( "Your order has been received and is now being processed. Your order details are shown below for your reference:", 'woocommerce' ) . "\n\n";
    3. upload the file you just edited into the woocommerce/emails folder within your theme directory

    Step 5: Enjoy

    Now that you have your very own WooCommerce-powered catalog, you may sit back and enjoy what you've created. When anyone creates a wishlist and send you a price request, you'll receive an email about it, plus their request will show up in your admin area under WooCommerce > Orders.

    Every order will contain the email address of your customer-to-be, so you can manually send them your price offer, or maybe even contact them on phone.

    Editor's note: This is written by Marton Fekete for Hongkiat.com. Marton is a Hungarian site developer recently hooked on WordPress. He is a redesign enthusiast and freelance content writer who likes playing RPGs in his free time.

    © Savtec
    Nützliche Informationen und Tipps zur Webentwicklung. Programmierung, Webdesign, CSS, HTML, JAVASCRIPT. Konfigurieren und installieren Sie WINDOWS neu. Erstellung von Websites und Anwendungen von Grund auf neu.