• Resolved jennifersanchez

    (@jennifersanchez)


    Hi! is it possible publish enquiry and the answers by default? it means, when the user ask, it publish in this moment.
    Thanks!!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author WC Lovers

    (@wclovers)

    it means, when the user ask, it publish in this moment.

    – Where it will be publish?

    Thread Starter jennifersanchez

    (@jennifersanchez)

    Hi! In the product page, in section of enquiry.

    Thread Starter jennifersanchez

    (@jennifersanchez)

    Hi! i can resolved it with the templates! but i cant prevent the double reply by the vendor.
    I added this code in my funtion.php but it hide always the form. Any suggest?
    Thanks!!

    add_action( 'wcfmcap_is_allow_enquiry_reply', function() {
    	?>
      
      <script>
    jQuery("#wcfm_inquiry_reply_send_button").click(function(e)) {
        e.preventDefault();
        jQuery('#wcfm_new_reply_listing_expander').hide();
        
    }
      });
      </script>
    Plugin Author WC Lovers

    (@wclovers)

    i can resolved it with the templates! but i cant prevent the double reply by the vendor.

    – Do you want to restrict vendors to post only one reply for an Inquiry?

    Thread Starter jennifersanchez

    (@jennifersanchez)

    Hi! yes, can you guide me how to do it?
    Thanks!

    Plugin Author WC Lovers

    (@wclovers)

    Please use this snippet for the purpose-

    add_filter( 'wcfmcap_is_allow_enquiry_reply', function( $is_allow ) {
    	global $WCFM, $wp, $wpdb;
    	if( wcfm_is_vendor() ) {
    		if( isset( $wp->query_vars['wcfm-enquiry-manage'] ) && !empty( $wp->query_vars['wcfm-enquiry-manage'] ) ) {
    			$inquiry_id = absint( $wp->query_vars['wcfm-enquiry-manage'] );
    			$wcfm_enquiry_replies = $wpdb->get_results( "SELECT * from {$wpdb->prefix}wcfm_enquiries_response WHERE <code>enquiry_id</code> = " . $inquiry_id );
    			if( !empty( $wcfm_enquiry_replies ) && count( $wcfm_enquiry_replies ) >= 1 ) {
    				$is_allow = false;
    			}
    		}
    	}
    	return $is_allow;
    }, 750 );
    Thread Starter jennifersanchez

    (@jennifersanchez)

    Greats! it works perfect!!
    Thanks very much =)

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘enquiry’ is closed to new replies.