News:

Support the VirtueMart project and become a member

Main Menu

Notify

Started by VopoloS, October 29, 2016, 19:27:43 PM

Previous topic - Next topic

VopoloS

How to limit the click of a button "to notify" 1 time for 1 product per visitor? Now you can order the missing items a visitor at least 100 times! What for?

Jörgen

This is not a feature, there is simply no test that the email hasn´t been stored before. I expanded my notify function so that the admin also gets an e-mail notification, maybe I could also add this check.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

VopoloS

#2
Quote from: Jörgen on October 29, 2016, 20:05:39 PM
This is not a feature, there is simply no test that the email hasn´t been stored before. I expanded my notify function so that the admin also gets an e-mail notification, maybe I could also add this check.

regards

Jörgen @ Kreativ Fotografi

Hello, Jörgen.
Please tell me what code you need to add that there was such a check. Nothing like a test I found in the file notify.php We must look to the model function?

Thank you.

For Virtuemart 1 it was made as follows: function validate_add(&$d) {
global $vmLogger, $VM_LANG;
$db = new ps_DB;

$q = "SELECT waiting_list_id from #__{vm}_waiting_list WHERE ";
$q .= "notify_email='" . $d["notify_email"] . "' AND ";
$q .= "product_id='" . $d["product_id"] . "' AND notified='0'";
$db->query($q);
if ($db->next_record()) {
$vmLogger->err( $VM_LANG->_('VM_WAITING_LIST_ERR_ALREADY') );
return False;
}
if (!$d["notify_email"]) {
$vmLogger->err( $VM_LANG->_('VM_WAITING_LIST_ERR_EMAIL_ENTER') );
return False;
}


Now you need to VM 3   ;)

Jörgen

Hello

There is no such a test. You have to include this in the view.

regards

Jörgen @ Kreativ Fotografi

Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

VopoloS

#4
Quote from: Jörgen on October 29, 2016, 20:32:55 PM
Hello

There is no such a test. You have to include this in the view.

regards

Jörgen @ Kreativ Fotografi


You can find out more? I installed VM 3.0.14
Thank you!

Jörgen

Thank You for the code :)

I will see what I can do :)

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

VopoloS

#6
Hello, Jörgen!
Are there any solution already?

Н...SPAMа.. обещанного 3 гоSPAMа жSPAMут?