Wellrad - Customer name in subject to shop

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Post Reply
Sordon
Posts: 30
Joined: Thu Jun 26, 2008 3:18 pm
Location: Germany

Wellrad - Customer name in subject to shop

Post by Sordon » Fri Aug 26, 2011 1:45 pm

Hello,

I'm using the Wellrad shop plugin version 1.2 RC. I guess I have a simple problem to solve, but unfortunately I do not know PHP enough to solve it myself.

In the email that is sent to the shop owner I would like to have the name of the customer. I looked into the PHP module wrs_frontend_controller.php and found the following code where the subject is created:

Code: Select all

$mail->Subject = $this->viewProvider->mail['notify'];
In the same module also the customer name is available and is stored in the variable $customerName.

What has to be changed to add the customer name to the subject that it looks like this: AN ORDER - John Doe

Best Regards,
Sordon

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Wellrad - Customer name in subject to shop

Post by cmb » Fri Aug 26, 2011 3:04 pm

Hello Sordon,

the following should be a general solution to your problem:

Code: Select all

$mail->Subject = sprintf($this->viewProvider->mail['notify'], $customerName);
 
Then adjust wellrad/languages/en.php according to your needs, e.g.:

Code: Select all

$lang['mail']['notify'] = "AN ORDER - %s";
 
This way you can even have: "John Doe has placed an order!", by changing:

Code: Select all

$lang['mail']['notify'] = "%s has placed an order!";
I've not tested, but basically this should work.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Sordon
Posts: 30
Joined: Thu Jun 26, 2008 3:18 pm
Location: Germany

Re: Wellrad - Customer name in subject to shop

Post by Sordon » Mon Aug 29, 2011 10:30 pm

Hello Christoph,

thanks a lot. The code you provided works as expected. I think this is an essential enhancement to the shop. It really helps to keep an overview on the orders.

Best Regards,
Sordon

Post Reply