I'd like to implement a means for users to contact sellers about product listings. Similar to eBay's system, the contact seller link should be on each product listing, and automatically reference the product page it is on. Additionally, the seller should be able to publish the question to the product page too if the question is frequently asked.

I've considered Privatemsg and Webform module. Any tips. See issue on privatemsg here:
http://drupal.org/node/1136624

Comments

Stomper’s picture

Another suggestion from the PrivateMsg issue was the use of Author Contact module, I've created an issue on that module page too. Follow it here. http://drupal.org/node/1142752

trothwell’s picture

I'd like to see this functionality, It appears to be a popular feature. Is there anymore information relating to this?

Stomper’s picture

@ funke

No, no new information really. I think your best bet may be using the Author Contact module, although I have yet to use it. For basic question it should work, but the fancier stuff Ebay offers may need custom stuff.

trothwell’s picture

I went down the path of creating a module to alter the way the default comment system works. Seems to work well.

Stomper’s picture

@funke

Feel like sharing it? So what can your module do?

trothwell’s picture

Hey Stomper,

A lot can be done within comment.tpl.php

I went on the assumption that users cannot reply to "Questions" only specified users with permission can and only to a certain depth level.


/**
 * Implementation of hook_perm();
 *  Allows the module to restrict access to specific areas.
 */
function no_reply_perm() {
  return array('access reply page');
}
 
/**
 * Implementation of hook_commnet();
 */
function no_reply_comment(&$a1, $op) {
  if ($op == 'view' && arg(1) == 'reply' && !user_access('access reply page')) {
    drupal_set_message('You do not have access to this area.', 'error');
    drupal_goto('<front>');
  }
  
  if ($op == 'view' && arg(1) == 'reply') {
    drupal_set_title('Add Answer');
  }
  
  if ($op == 'edit') {
    drupal_set_title('Edit question');
  }
}

/**
 * Implementation of hook_form_alter();
 */
function no_reply_form_alter(&$form, $form_state, $form_id) {
$form['#validate'][] = 'no_reply_form_validate'; //prevent the user from seeing errors on the reply page
}

/**
 * Custom handler
 * Outputs the form errors on the node page for product comments
 */
function no_reply_form_validate($form, &$form_state) {
  $errors = form_get_errors();
  if (!empty($errors)) {
    drupal_goto('node/' . $form_state['values']['nid']);
  }
}

/**
 * Implementation of hook_preprocess_box();
 */
function no_reply_preprocess_box(&$vars, $hook) {
   if (strtolower($vars['title']) == 'post new comment') {
    $vars['title'] = 'Product Questions';
   }
}

From here i added a snippet within comment.tpl.php

    if ($comment->depth == 0) {
      echo 'Question:';
    } 
    else {
      echo 'Answer:';
    }
  

Not to much done here but potentially it can be built on and prevent users from accessing certain paths and areas, we can even modify the output to the admin replying with an answer.

Hope this helps you, feel free to shoot some Q's at me.

Stomper’s picture

@Funke

I'm assuming your module would display comments in the default manner ie. below the content body. Is there any way I could specify that the "question" would not be displayed below the body by default, and allow the "answerer" ie. the node author, to decide whether it should be displayed on the node page?

trothwell’s picture

Yes it doesn't adjust the position the comments are outputted. (remains below the form).

You could do a dodgy and just leave the comment (question) as unpublished to prevent it from being displayed.

I'm not sure what your goal is, are you trying to display comments (questions) above the form? There are other modules which allow you to make comments appear in a block. http://drupal.org/project/commentblock

Stomper’s picture

@Funke

I'd like to replicate Ebay's seller question system. I guess their's does display the questions underneath the content body. I guess my issue is being able to allow the seller to decide whether to publish them or not.

Additionally, I think the module you suggest for comments in a block is closer to what I want, I don't want a long stream of questions, instead something small perhaps with a scroll bar or I could just create a View.

meganedesigns’s picture

I know this thread is rather old, but I was searching for a similar solution this week. In my searches I also came across EntityForm and Entity Registrations. Perhaps one of those modules would help you (or a future searcher like myself) as well!

gmaximus’s picture

I done this by creating a content type for the question, with a node reference field linking it to the product.

Then used views to display the questions on the product page.

As for the "Contact seller" link, I use Node Reference URL Widget to put the link on the product page.

In terms of only displaying certain questions, you could easily add a "display question" field to the question content type, then filter by it on the view.

Then answers can be comments or an answer content type, using the same technique. I personally do the later and also allow users to vote on questions...

Think that was about it... You'll need to understand views, in particular arguments and possibly relationships too.... Hope this helps...

Stomper’s picture

@11, I'm thinking the EVA module would work well at attaching the view to the product node too, right?

gmaximus’s picture

@12 Hi Stomper....

I use Views attach being as I'm using Drupal 6... EVA looks like the Drupal 7 version but I have no experience with Drupal 7 as yet...

Those modules will let you attach the view to the node. Then you can go to the manage fields page on the product content type and move the position of the view to where you want on the node...

Alternatively, it could be done by just creating a view with a block display. Then set up the argument to be the reference field of the question and set the default to be the node id from the url. Then place the block in a appropriate region.... Hope that helps...

Stomper’s picture

Thanks for the explanation. Makes sense. Another approach too, similar to your panel-block approach, would be using the Panelizer module to add a panel to your "product" content type, and display your "feedback" view in that panel.

gmaximus’s picture

Feedback view? you mean the "questions" view...

I've posted a feedback system here: https://drupal.org/comment/8204557#comment-8204557

I could do with some help with this MP issue too: https://drupal.org/node/2140045

Stomper’s picture

Right, the "questions" view.

I'm not too familiar with your other MP issue, what would be a typical use case?

gmaximus’s picture

@ stomper

I've updated that issue about the bulk operations now, in hope that anybody may like to help sponsor it. The modules described in that issue will ultimately replace the sellers order fulfillment screen. With bulk operations for the sellers and nice filters for the orders... I think this will greatly improve the seller experience.