Page 1 of 2

Guest checkout cannot view invoice link form email

Posted: Thu Dec 17, 2009 8:54 am
by montanaflynn
I just tried using testing with guest checkout and then manually updating the status from pending to shipped and I got an email that has a link but it redirects to the sign in page, how could a guest buyer see his invoice?

Re: Guest checkout cannot view invoice link form email

Posted: Thu Dec 17, 2009 11:27 pm
by i2Paq
Not.

Re: Guest checkout cannot view invoice link form email

Posted: Mon Jan 04, 2010 10:12 pm
by christopherdarling
I don't think this is possible really, as the person has used the checkout without an account. I think the best way around this is perhaps for Opencart to implement two email templates, one for a Guest and one for a Member. Or, perhaps just have a standard email with no link, but attach a PDF copy of the invoice.

Re: Guest checkout cannot view invoice link form email

Posted: Tue Jan 05, 2010 12:10 am
by Qphoria
its a simple fix.

1. EDIT: catalog/model/checkout/order.php

2. FIND:

Code: Select all

$message .= $language->get('mail_new_order_invoice') . "\n";
3. REPLACE WITH:

Code: Select all

if (!isset($this->session->data['guest'])) {
	$message .= $language->get('mail_new_order_invoice') . "\n";
}

Re: Guest checkout cannot view invoice link form email

Posted: Wed Sep 22, 2010 11:55 am
by Seven
What is the same fix for 1.4.9.1? I don't find that snippet there.

Re: Guest checkout cannot view invoice link form email

Posted: Wed Sep 22, 2010 12:04 pm
by Qphoria
there should be no need since 1.4.6

Re: Guest checkout cannot view invoice link form email

Posted: Wed Sep 22, 2010 12:06 pm
by Seven
I just this minute noticed that. The guest email I was looking at was when the order status changed. It still provides a link.

Re: Guest checkout cannot view invoice link form email

Posted: Wed Sep 22, 2010 12:32 pm
by Qphoria
ah ok.

Re: Guest checkout cannot view invoice link form email

Posted: Wed Sep 22, 2010 1:44 pm
by Seven
If I preferred to not send an unusable link to an unregistered customer during order status changes, would it be better to change the verbiage in catalog/language/english/mail/order_update.php to something like "If you registered when you made your purchase, you can use the following link to view the details...blah, blah, blah" or change something in the update function in catalog/model/checkout/order.php to keep the link from showing up for unregistered customers, but still let them know of the status update?

Or, is there a solution already out there that I totally missed somehow?

Re: Guest checkout cannot view invoice link form email

Posted: Thu Sep 23, 2010 2:05 am
by Seven
My eyeballs hurt from looking at this. I'm no developer and don't really read php. I'm pretty sure the area I need to be looking at is in catalog/language/english/mail/order_update.php, but I'm not sure how to tell it to omit the text_invoice and store_url IF the order was from a guest checkout. Does the system even store that they were a guest after the initial order confirmation?

Thanks in advance for any help (especially you Obi-Wan Q-Nobi).

Re: Guest checkout cannot view invoice link form email

Posted: Thu Sep 23, 2010 11:48 am
by Seven
I finally found it. I just changed the verbiage a little in admin/language/english/mail/order.php.

Re: Guest checkout cannot view invoice link form email

Posted: Fri Sep 24, 2010 2:09 am
by i2Paq
Seven wrote:I finally found it. I just changed the verbiage a little in admin/language/english/mail/order.php.
What did you change?

Re: Guest checkout cannot view invoice link form email

Posted: Fri Sep 24, 2010 3:54 am
by Seven
I just changed the verbiage a little bit. I know it may seem like such a small detail to even worry about, but if a small bit of text like this potentially fields calls or emails about a provided link not working then it's served it's purpose as far as I'm concerned.

Before:

Code: Select all

$_['text_invoice']      = 'To view your order click on the link below:';
After:

Code: Select all

$_['text_invoice']      = 'If you registered with us when you made your purchase, you may view your order by clicking on the link below:';

Re: Guest checkout cannot view invoice link form email

Posted: Thu Dec 15, 2011 5:21 pm
by fourgood
is there a more elegant way than just change the wording but still provide a not working link?

Re: Guest checkout cannot view invoice link form email

Posted: Fri Dec 16, 2011 1:10 am
by straightlight
fourgood wrote:is there a more elegant way than just change the wording but still provide a not working link?
There might be a way of keeping the link if the order ID may be assigned to the customer's session array so that when the guest either registers an account or login into his account at the completion of checkout to re-gather the current order ID and to show the invoice based on this ID before the actual order ID gets unset when successful.

The only problem is when the customer would close the browser and clear all cookies and cache and would like to see the invoice from email, this obviously won't work since all sessionized data will be cleared as well.

Re: Guest checkout cannot view invoice link form email

Posted: Fri Dec 16, 2011 5:02 pm
by fourgood
and maybe something like input fields for guests where they can enter their order_id + their e-mail to see the invoice?

or the possibilitie to create an account afterwards and then see the orders that were made before with the same e-mail address?

Re: Guest checkout cannot view invoice link form email

Posted: Fri Dec 16, 2011 10:20 pm
by straightlight
I already sent that suggestion yesterday here: http://forum.opencart.com/viewtopic.php?f=110&t=48597 ;)

Re: Guest checkout cannot view invoice link form email

Posted: Fri Feb 10, 2012 1:35 am
by faustgertz
Hi,

Here is a vqmod I used that I believe takes care of this problem.

Code: Select all

<modification>
	<id>Prevent guests from receiving links to invoices upon order updates in admin interface</id>
	<version>1.0.0</version>
	<vqmver>1.0.2</vqmver>
	<author>Faust Gertz</author>
	<file name="admin/model/sale/order.php">
		<operation>
			<search position="before"><![CDATA[$message .= $language->get('text_invoice') . "\n";]]></search>
			<add><![CDATA[if ($order_query->row['customer_id']) {]]></add>
		</operation>
		<operation>
			<search position="after"><![CDATA[$message .= html_entity_decode($order_query->row['store_url'] . 'index.php?route=account/invoice&order_id=' . $order_id, ENT_QUOTES, 'UTF-8') . "\n\n";]]></search>
			<add><![CDATA[}]]></add>
		</operation>	
	</file>
</modification>
Hope this helps someone.

Re: Guest checkout cannot view invoice link form email

Posted: Fri Feb 10, 2012 7:21 am
by straightlight
Would it be possible to clarify this XML file regarding the <id> line and the subject of this topic ?

Re: Guest checkout cannot view invoice link form email

Posted: Thu Mar 08, 2012 12:33 am
by straightlight