Inquiries Tab message

Tagged: ,

This topic contains 9 replies, has 2 voices, and was last updated by Avatar Sushobhan 1 week ago.

  • Author
    Posts
  • #92126
    Avatar
    sadoun
    Participant

    When the product doesn’t have any inquirie, the Inquiries Tab shows:

    General Inquiries
    There are no inquiries yet.

    Can I change that to something different:

    For example:

    1) If there are no inquiries on the product yet, I want the message to say:

    Contact the vendor to inquire about this product.
    [Button to contact the vendor]

    2) If there are publically displayed inquiries, I want the message after the “publically displayed inquiries” to say:

    Contact the vendor to inquire about this product.
    [Button to contact the vendor]

  • #92549
    Avatar
    Sushobhan
    Keymaster

    There are two part of the answer-
    First, changing strings – You can do that easily using string translation(no coding involved). You can use Loco translate plugin for this purpose. (How to use Loco translate – https://www.youtube.com/watch?v=ZUPhsoUm-QE)
    Alternatively, you can override the template file located at:
    wc-frontend-manager\views\enquiry\wcfm-view-enquiry-tab.php

    Second, for adding the [Button to contact the vendor] – use the following code to achieve this
    add_filter('wcfm_is_pref_enquiry_button', '__return_false');
    Add this code to your child theme’s functions.php
    In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/

    • #93133
      Avatar
      sadoun
      Participant

      Thank you for your reply. I will try LOCO as you have suggested

      I tried the code it added a button in the inquiry tab as I wanted, but took away the “main inquiry button” I have under the add to cart button. Can you modify the code to allow the two buttons?

  • #93205
    Avatar
    Sushobhan
    Keymaster

    Please give me a snapshot of the issue.

  • #93427
    Avatar
    sadoun
    Participant

    When I add the code, it adds a button in the inquiry tab, but the existing button (the orange one in the attached snapshot) disappears. I want to keep both if possible. Or even add the form inside the inquiry tab.

    Attachments:
    You must be logged in to view attached files.
  • #93603
    Avatar
    Sushobhan
    Keymaster

    Use the following snippet to do that.

    add_filter( 'wcfm_is_pref_enquiry_button', '__return_false' );
    function my_wcfm_enquiry_button() {
        echo do_shortcode('[wcfm_enquiry]');
    }
    add_action( 'woocommerce_single_product_summary', 'my_wcfm_enquiry_button', 35 );

    Thanks!

  • #95827
    Avatar
    sadoun
    Participant

    Yes, that worked nicely. How can I match the color of the buttons?

  • #95992
    Avatar
    Sushobhan
    Keymaster

    You can do that via css. Which one you want to change the one inside ‘Inquiries’ tab or the one after ‘Add to Cart’ button?

    • #96162
      Avatar
      sadoun
      Participant

      I want to change the one inside ‘Inquiries’ tab to match the one after ‘Add to Cart’ button

  • #96166
    Avatar
    Sushobhan
    Keymaster

    Then you can use ‘span.add_enquiry’ class to change the appearance of that button using css like the following-

    span.add_enquiry {
    background: blue; //use the color you want to use
    }

You must be logged in to reply to this topic.