2

(First of all, sorry for bad english)

If there are people here using wordpress as cms, you probably realize that you dont need comment system that much. Esspecially custom post types like products need a contact form system that saves coming input.

What i am dreaming but cant coding:

Changing comment system for custom post types. Let me explain on an example: Lets say we have a custom post type thats using for product list. We dont need/want customer comments on this product but we want customers send us what they are thinking on this product. So they will use this "custom comment type" system and sending us a comment but this comment is not publishing on website and in admin panel, when we reply to comment, wordpress will send that reply as e-mail.

So we can see all new contact form inputs about this product in a list as archieved in wordpress comment table and we can reply them from admin panel. When product is updated or a special discount or something, we will have a list of customers that previously asked a question about it so we can contact them again about new updates.

In background, as performance, product custom post type not need to load comments so this will reduce database queries.

What do you think about it? Possible?

3

3 Answers 3

3

I also (ab?)use comments for "private" replies to posts, like product inquiries, suggestions, answers to contests, ... The advantage is that they are stored in the database and displayed in the interface without extra code from me (sometimes I add a filter to improve the formatting). Spam filtering and e-mail notifications are easy extras.

I think it is possible to create a custom comment type framework on top of the current system, thus as a plugin without internal changes. Maybe, if I ever find the time, I'll experiment with that...

1
2

If you are unsure about something i wrote here: Please use a dictionary english/turkish.

What do you think about it? Possible?

Yes.

when we reply to comment, wordpress will send that reply as e-mail.

You will have to use some sort of comment notification for this. This would then send an e-mail if you posted a reply to the "comment".

and we can reply them from admin panel

This won't be too easy. Easier would be to use something like

if ( current_user_can('some_capability') ) 
{
    comment_form(); // shows the comment form
}

in your templates, which will make the comment form only visible for people who are

  • logged in and
  • have the appropriate capability

and then reply directly on your public page. Everything else would be much more complicated.

0

You can use a simple form to get the customers comments on the product and replay by mail.

here is something i used long time ago and i should do the job for you, its a simple form with minor validation, just change: Your_mail to your mail address

if (isset ($_post['submit'] && $post_['my_action'] == 'product_comment'){
    if (wp_verify_nonce($_POST['product_comment'],'p_comment')){ 
    global $post;
        $error =  false;
        $em = array();
        if (!isset($_post['pc_name'])){
            $em[] = __('Name');
            $error = true;
        }
        if (!isset($_post['pc_email'])){
            if ($error){$em[] = __(', Email');
            }else{
                $error = true;
                $em[] = __(', Email');
            }

        }
        if (!isset($_post['pc_phone'])){
            if ($error){$em[] = __(', Phone');}
            else{
                $em[] = __('Phone');
                $error = true;
            }
        }
        if (!isset($_post['cp_feedback'])){
            if ($error){$em[] = __(', Your Feedback');
            }
            else{
                $em[] = __('Your Feedback');
                $error = true;
            }
        }
        if (!$error){
            $subject = 'New '. $post->post_title . ' Feedback';
            $M = "Name: $_post['pc_name'] \n
            Email: $_post['pc_email']\n
            Phone: $_post['pc_phone']\n
            Feedback: $_post['cp_feedback']";
            wp_mail('Your_mail',$subject, $M);

        }
    }else{
        $em[] = 'squrity error';
        $error = true;
    }
}
<h3><?php _e('Leave Your Feedback'); ?></h3>
<?php if($error){
            echo _e('please correct the following: <br/>');
            foreach ($em as $e){
                echo $e;
            }} ?>
<form id="product-comment" name="product-comment" action="" method="post">
<p><?php _e('Name'); ?></p>
<p><input type="text" name="pc_name" id="pc_name"></p>
<p><?php _e('Email'); ?></p>
<p><input type="text" name="pc_email" id="pc_email"></p>
<p><?php _e('phone'); ?></p>
<p><input type="text" name="pc_phone" id="pc_phone"></p>
<p><?php _e('Your Feedback'); ?></p>
<textarea tabindex="4" rows="13" cols="50%" id="cp_feedback" name="cp_feedback"></textarea>
<?php wp_nonce_field('update-p_comment','product_comment'); ?>
<input type="hidden" name="my_action" value="product_comment">
<input type="submit" name="submit" value="send">
</form>
1
  • well, dont get me wrong but i have gravityforms developer version. I am not looking for a contact form tbh. Maybe i couldnt explain enough :-/ Apr 8, 2011 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.