Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › Inquiry button on each cell of main shop loop
- This topic has 8 replies, 2 voices, and was last updated 4 years, 5 months ago by ing.rapparini.
- AuthorPosts
- May 20, 2020 at 1:04 am #133279ing.rappariniParticipant
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?
ThanksAttachments:
You must be logged in to view attached files. - May 20, 2020 at 9:57 am #133401SushobhanKeymaster
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! - May 20, 2020 at 10:58 am #133409ing.rappariniParticipant
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.
- May 25, 2020 at 1:23 pm #134968SushobhanKeymaster
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! - May 25, 2020 at 7:38 pm #135065ing.rappariniParticipant
It does NOT work…
The class name on the button remain: wcfm_catalog_enquiry
- May 25, 2020 at 7:49 pm #135073SushobhanKeymaster
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!
- May 25, 2020 at 8:13 pm #135079ing.rappariniParticipantThis reply has been marked as private.
- May 25, 2020 at 9:08 pm #135108SushobhanKeymaster
Hi,
It’s working. I have added ‘!important’ to increase the priority of our style. That’s it.
Thank You! - May 26, 2020 at 11:41 am #135288ing.rappariniParticipant
It works!!!
THANKS!!!!
- AuthorPosts
- You must be logged in to reply to this topic.