Hello,
I am using Multimerch and I would like to ask, if anyone knows if I can allow from the admin panel the messages to be sent between customers and vendors.
I would like to control which messages could be sent and which could not be sent, after I read them.
Any ideas how to do that?
Thank you in advance.
Martin, founder of MultiMerch here - thanks for using our product!
At the moment MultiMerch does not have a moderation/preapproval system for private messages. You as the administrator can monitor all conversations between customers and vendors as well as take part in conversations yourself, but it's not possible to block specific messages from getting sent or approve them manually.
This is possible as a custom modification, but I generally advise against this as it makes the conversation system slow and inefficient. Instead, I recommend explicitly defining conversation rules and focusing on building a user base of trusted vendors who will not break them
At the moment MultiMerch does not have a moderation/preapproval system for private messages. You as the administrator can monitor all conversations between customers and vendors as well as take part in conversations yourself, but it's not possible to block specific messages from getting sent or approve them manually.
This is possible as a custom modification, but I generally advise against this as it makes the conversation system slow and inefficient. Instead, I recommend explicitly defining conversation rules and focusing on building a user base of trusted vendors who will not break them
Hello Martin,
Thank you for your answer!
Except from defining conversation rules and communicating with them too, how can I manually notify them if they try to send a phone number or email? This would be great to have.
Can I add some piece of code to alert them when they are in the message box?
Thank you for your answer!
Except from defining conversation rules and communicating with them too, how can I manually notify them if they try to send a phone number or email? This would be great to have.
Can I add some piece of code to alert them when they are in the message box?
Which version of MultiMerch are you currently using?
If you really need a filter like that, you can add an extra check to our message submission function in the conversation controller that would try to match a phone number (or anything else) via regex in the message being submitted and prevent submission if it's the case.
If you really need a filter like that, you can add an extra check to our message submission function in the conversation controller that would try to match a phone number (or anything else) via regex in the message being submitted and prevent submission if it's the case.
I use Multimerch_marketplace_8.7.2.
I developed a php script where it checks if an email or a telephone number appears in a string and prompts some message.
The message submission function in the conversation controller is located in ../admin/controller/multimerch/conversation.php?
The script should take as a parameter the message (instead of the sample string I created) and allow the submission or not if it finds email/telephone number.
I developed a php script where it checks if an email or a telephone number appears in a string and prompts some message.
The message submission function in the conversation controller is located in ../admin/controller/multimerch/conversation.php?
The script should take as a parameter the message (instead of the sample string I created) and allow the submission or not if it finds email/telephone number.
That is great thank you!
My script was
I tried to enable inside the function by writing :
but I could not get the messages I was trying to output. Any ideas on how to implement it?
My script was
Code: Select all
<?php
$string = "bla bla pickachudomain.com MIME-Version: balbasurdomain.com bla bla bla papakidomain.com 222 eurw ";
$matches = array();
$pattern = '/[a-z\d._%+-]+@[a-z\d.-]+\.[a-z]{2,4}\b/i';
$matches2 = array();
$pattern2 = '/[0-9]{3}[\-][0-9]{7}|[0-9]{3}[\s][0-9]{7}|[0-9]{3}[\s][0-9]{3}[\s][0-9]{4}|[0-9]{10}|[0-9]{3}[\-][0-9]{3}[\-][0-9]{4}/';
preg_match_all($pattern,$string,$matches);
preg_match_all($pattern2,$string,$matches2);
print_r($matches);
print_r($matches2);
if (empty($matches[0])&&empty($matches2[0]) ) {
echo "Arrays are empty. Submit the message.";
}
else {
echo "Found matches. Do not submit the message or prompt alert" ;
}
?>
Code: Select all
$json = array();
$matches = array();
$pattern = '/[a-z\d._%+-]+@[a-z\d.-]+\.[a-z]{2,4}\b/i';
$matches2 = array();
$pattern2 = '/[0-9]{3}[\-][0-9]{7}|[0-9]{3}[\s][0-9]{7}|[0-9]{3}[\s][0-9]{3}[\s][0-9]{4}|[0-9]{10}|[0-9]{3}[\-][0-9]{3}[\-][0-9]{4}/';
preg_match_all($pattern,$message_text,$matches);
preg_match_all($pattern2,$message_text,$matches2);
if (empty($matches[0])&&empty($matches2[0]) ) {
echo "Arrays are empty. Submit the message.";
}
else {
$json['errors'][] = $this->language->get('ms_error_empty_message');
$this->response->setOutput(json_encode($json));
return;
}
if (empty($message_text)) {
$json['errors'][] = $this->language->get('ms_error_empty_message');
$this->response->setOutput(json_encode($json));
return;
}
This function is called via ajax, so it needs to return the value as a $json array instead of simply outputting it. If you're displaying a new error message, you need to initialize the $json['errors'] array and return it via setOutput in the same way we do it by default:
$json['errors'][] = $this->language->get('ms_error_empty_message');
$this->response->setOutput(json_encode($json));
$json['errors'][] = $this->language->get('ms_error_empty_message');
$this->response->setOutput(json_encode($json));
Who is online
Users browsing this forum: No registered users and 35 guests