Inquiry button on each cell of main shop loop

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Viewing 8 reply threads
  • Author
    Posts
    • #133279
      ing.rapparini
      Participant

      Hi I need the inquiry button (that in my case is “CONTACT THE SELLER”) on each cell of the main shop product loop.
      See pic.
      Code to add?
      Thanks

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

      Hi,
      Thanks for getting in touch with us!
      You can try the following snippet-

      add_action( 'woocommerce_after_shop_loop_item_title', function() {
          if ( ! wcfm_is_store_page() && apply_filters( 'wcfm_is_pref_inquiry_button', true ) ) {
              echo do_shortcode( '[wcfm_inquiry]' );
          }
      }, 3 );

      Add this code to your child theme’s functions.php
      In case you do not have a child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/
      Let me know how it goes.
      Thanks!

    • #133409
      ing.rapparini
      Participant

      OK, it works,
      but I DO NOT need to replicate the same button on the single product page!

      Because I need to personalize it separately. (Maybe with only a link/writing)

      If I try now both are personalized in the same way.

    • #134968
      Sushobhan
      Keymaster

      Hi,
      In that case, you can use this modified code-

      add_action( 'woocommerce_after_shop_loop_item_title', function() {
          if ( ! wcfm_is_store_page() && apply_filters( 'wcfm_is_pref_inquiry_button', true ) ) {
              echo '<div class="product_loop_inquiry_button_wrap">' . do_shortcode( '[wcfm_inquiry]' ) . '</div>';
          }
      }, 3 );

      So now you’ll have a div with class name product_loop_inquiry_button_wrap. You can then use CSS to change the appearance of this button.
      Thank You!

    • #135065
      ing.rapparini
      Participant

      It does NOT work…

      The class name on the button remain: wcfm_catalog_enquiry

    • #135073
      Sushobhan
      Keymaster

      Hi,
      The code I share doesn’t change the wcfm_catalog_enquiry class name. It just adds a wrapper div (with class name product_loop_inquiry_button_wrap) outside of the inquiry button. So now you can write specific CSS styles applicable for enquiry button for this page only. Like this-

      .product_loop_inquiry_button_wrap .wcfm_catalog_enquiry {
          background: #ff0000;
          color: #fff;
      }
      

      Thank You!

    • #135079
      ing.rapparini
      Participant
      This reply has been marked as private.
    • #135108
      Sushobhan
      Keymaster

      Hi,
      It’s working. I have added ‘!important’ to increase the priority of our style. That’s it.
      Thank You!

    • #135288
      ing.rapparini
      Participant

      It works!!!
      THANKS!!!!

Viewing 8 reply threads
  • You must be logged in to reply to this topic.