Jump to content
Oscar

function Mail :: Send prestashop date in subject

Recommended Posts

Hello
Prestashop 1.6.0.9
I am trying to include in the subject of the email that admin receives when there is a new order the day of the week that is at that moment but I do not get it to work. For example I want to receive as admin in the subject this:
  Oscar Cuenca, New order: # 4524 - YKSUCKDON - Monday
This is because I am using a CRM and I am interested in the email I receive to set the current day of the week in which the email was created.
What I do is this:
I add the variables:

$fecha = array("sunday","monday","twesday","Wednesday","Thursday","Friday","saturday");
		$dia = $fecha[date("w")];

In the file mailalerts.php, line approx 254

public function hookActionValidateOrder($params)
	{
		if (!$this->merchant_order || empty($this->merchant_mails))
			return;

		// Getting differents vars
		$context = Context::getContext();
		$id_lang = (int)$context->language->id;
		$id_shop = (int)$context->shop->id;
		$currency = $params['currency'];
		$order = $params['order'];
		$fecha = array("sunday","monday","Tuesday","miercoles","Thursday","Friday","saturday");
		$dia = $fecha[date("w")];
		$customer = $params['customer'];
		$configuration = Configuration::getM........

Once this is done, in this same file, line 466 in the Mail :: Send function

$mail_id_lang,
					'new_order',
					sprintf(Mail::l($customer->lastname.', '.'New order : #%d - %s'.', '.$dia, $mail_id_lang), $order->id, $order->reference),
					$template_vars,
					$merchant_mail,
					null,
					$customer->email,
					$configuration['PS_SHOP_NAME'],
					null,
					null,
					$dir_mail,
					null,
					$id_shop
				);

This done, it does not cause any effect. I still receiving the same subject:
  Oscar Cuenca, New order: # 4524 - YKSUCKDON
Without the day of the week.
If someone can help me, I'll thank you-

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More