Advertisement:

Author Topic: [SOLVED]Contact Counter - Changes  (Read 708 times)

sravani

  • Newbie
  • *
  • Posts: 15
[SOLVED]Contact Counter - Changes
« on: August 27, 2016, 02:08:36 pm »
Hi,

I'm using latest osclass version on my website and installed 'Contact Counter' plugin.
Im able to see increase in contact counter(in managed listings of admin panel) when user sends inquiry email.
It is happening due to following code. Counter increase code is attached to email_item_inquiry hook

osc_add_hook('hook_email_item_inquiry', 'contact_counter_increase');
//osc_add_hook('contact_form', 'contact_counter_increase');
function contact_counter_increase($item) {
    ModelContactCounter::newInstance()->increaseItemStat($item['id']) ;
}

But I want to increase the counter when contact button(which opens above email form) is clicked not when the email is sent.
Can any guide me how to change hook from email_inquiry to button click
« Last Edit: August 28, 2016, 02:39:25 am by sravani »