no confirmation e-mail with 100% coupon

  • Posts: 151
  • Thank you received: 9
12 years 1 month ago #70820

Hi,

As a reward for buying a product I give away a free product. Normally this costs 39 Euro and via AwoCoupon they get a 100% discount coupon.

When they checkout, after entering the coupon code, price goes to zero and the order status goes to confirmed at once.

However the confirmation e-mail is not sent. I also cannot open the e-mail for viewing/editing when I try to change the order status in the back end back to created an then again back to confirmed. The HTML-email, in the pop-up window stays white.

Any idea what the problem is?

Maurice

Last edit: 12 years 1 month ago by Maurice.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 1 month ago #70895

Hi,

That sounds like you have an error in the confirmation email generation.
Did you change anything in it ?

If you turn on the "error reporting" and debug mode options of the joomla configuration and try again, do you get some errors ?

Please Log in or Create an account to join the conversation.

  • Posts: 151
  • Thank you received: 9
12 years 3 weeks ago #72813

Hi Nicolas,

I found that the not opening of the HTML e-mail in the pop-up window was a web browser related issue. It only happens with Firefox. When I use Chrome, the HTML mail is visible.

An error in the e-mail template would also affect e-mails that ARE sent. But this is not the case and it looks the email template is okay.

Still, confirmation emails are NOT sent when a customer uses a 100% discount coupon. When he/she enters the coupon in the checkout page, price goes to zero (as expected) and therefore the payment options disappear.

The first e-mail is sent to the customer (that the order had been received).
The second email is NOT sent (that tells them that the order has been paid).

If a user uses a less than 100% coupon and still has to pay at least something, both emails are sent out correct.

So I must open EVERY order that has been ordered with a 100% coupon code, manually set the status from "confirmed" back to "received" without sending a notification. And then change the status again back to "confirmed", and notifying the customer.

Please help.


Kind regards,
Maurice

Last edit: 12 years 3 weeks ago by Maurice.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 3 weeks ago #73147

Hi,

So for the popup not opening for one browser, it might be a javascript error on your pages because of a conflict with another plugin on your website.

For the confirmation email that's actually normal.
When the order is free, the validate free order plugin will change the status of the order during its creation. There won't be a status change triggered. So only the order creation email is sent, not the order status notification email.

If you want to change the code:

function onBeforeOrderCreate(&$order,&$send_email){
		if(empty($order) || !isset($order->order_full_price))
			return;
		if(bccomp($order->order_full_price,0,5)==0){
			$order->order_status = 'confirmed';
		}
	}
to:
function onAfterOrderCreate(&$order){
		if(empty($order) || !isset($order->order_full_price))
			return;
		if(bccomp($order->order_full_price,0,5)==0){
			$orderObj = new stdClass();
			$orderObj->order_status = 'confirmed';
			$orderObj->history->history_notified = 1;
			$orderObj->order_id = $order->order_id;
			$orderClass = hikashop_get('class.order');
			$orderClass->save($orderObj);
		}
	}

in the file plugins/hikashop/validate_free_order/validate_free_order.php

Please Log in or Create an account to join the conversation.

  • Posts: 151
  • Thank you received: 9
12 years 3 weeks ago #73151

Hi Nicolas,

Thank you. I changed the onAfterOrderCreate funtion to this code and indeed the confirmation e-mail is now sent. This is good!
I am only missing the HikaSerial code that belongs to the product.

Kind regards,
Maurice

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 3 weeks ago #73414

Can you try with that plugin ?

Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum