Author Topic: Change subject of the "Back In Stock" e-mail notification, how?  (Read 158 times)

loppan

  • Jr. Member
  • **
  • Posts: 128
    • CRASHDÏET Official Website
Hi,

spent all evening yesterday trying to figure this one out, but didn't manage to, so I'm kindly asking for help now ;).

I'm on VM 3.2.12 and Joomla! 3.8.3.

When I send "back in stock"-notifications to the users on my waiting list, and use the default template, the subject of the e-mail turns out to be :

"Back in stock : %s", where %s is the actual product. I'd like to change this. I've searched everywhere but can't find the line "Back in stock" in any language file.

Tried to investigate further, and I found some clues in administrator/components/com_virtuemart/models/waitinglist.php, on line 93 :

Code: [Select]
if (empty($subject)) {
$subject = vmText::sprintf('COM_VIRTUEMART_PRODUCT_WAITING_LIST_EMAIL_SUBJECT', $item->product_name);
}

Full of hope, I know searched for the "COM_VIRTUEMART_PRODUCT_WAITING_LIST_EMAIL_SUBJECT" language constant instead. I found out that it's actually set to :

Code: [Select]
COM_VIRTUEMART_PRODUCT_WAITING_LIST_EMAIL_SUBJECT="%s has arrived!"
, so that just created more confusion. Even changing the constant didn't change the subject, so this has got to be set somewhere else. I also tried adding a language override for that constant, and it didn't help either.

I'm actually kind of surprised that I'm having such issues with something that I normally would easily know how to do, but on this one I'm simply stuck.

Kindly asking for advice here :)

Million thanks in advance. Best regards!

Peter

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1463
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Change subject of the "Back In Stock" e-mail notification, how?
« Reply #1 on: March 05, 2018, 10:39:43 am »
Code: [Select]
if (empty($subject)) {

This suggests that the call can be overridden and you should look in the template and see if there is some override for notify. Otherwise You should create an override for notify in the virtuemart views.

Unpacking the VM code locally and search for the string "Back in stock" should also help.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)