Author Topic: Fix URL in Order Confirmation email  (Read 24331 times)

hubfub

  • Beginner
  • *
  • Posts: 38
Fix URL in Order Confirmation email
« on: October 26, 2008, 16:10:25 pm »
Hi,

When I place an order on my VM, the order confirmation email comes through fine BUT the URL at the bottom where it says:

View the order by following the link below. Goes to http://shop/?page=account.order_details&order_id=4

obviously this URL is not the correct one for my shop - how do I correct this?

jmds

  • Guest
Re: Fix URL in Order Confirmation email
« Reply #1 on: October 26, 2008, 16:44:39 pm »
Check you have the correct site urls entered in the 'URL' and 'SECUREURL' fields in the 'administrator/components/com_virtuemart/virtuemart.cfg.php' file

hubfub

  • Beginner
  • *
  • Posts: 38
Re: Fix URL in Order Confirmation email
« Reply #2 on: October 26, 2008, 16:49:55 pm »
yeah its correct in there

jmds

  • Guest
Re: Fix URL in Order Confirmation email
« Reply #3 on: October 26, 2008, 17:01:17 pm »
ok, this is a long shot but can you look at the file 'administrator/components/com_virtuemart/classes/ps_checkout.php and see if lines 1806 and 1807 (or there abouts) read:

Code: [Select]
$shopper_order_link = $sess->url( SECUREURL ."index.php?page=account.order_details&order_id=$order_id", true, false );
$vendor_order_link = $sess->url( SECUREURL ."index2.php?page=order.order_print&order_id=$order_id&pshop_mode=admin", true, false );

hubfub

  • Beginner
  • *
  • Posts: 38
Re: Fix URL in Order Confirmation email
« Reply #4 on: October 26, 2008, 17:04:44 pm »
yeah they do... ??

Maybe I can hardcode the URL into these two lines?

I;m new to PHP so how would I do this?

jmds

  • Guest
Re: Fix URL in Order Confirmation email
« Reply #5 on: October 26, 2008, 17:07:44 pm »
Not an ideal solution but you could try changing the lines to:

Code: [Select]
$shopper_order_link = $sess->url( "http://www.yoursite.com/index.php?page=account.order_details&order_id=$order_id", true, false );
$vendor_order_link = $sess->url( "http://www.yoursite.com/index2.php?page=order.order_print&order_id=$order_id&pshop_mode=admin", true, false );

and see if that helps.

hubfub

  • Beginner
  • *
  • Posts: 38
Re: Fix URL in Order Confirmation email
« Reply #6 on: October 26, 2008, 17:17:20 pm »
nope.. no luck :(

jmds

  • Guest
Re: Fix URL in Order Confirmation email
« Reply #7 on: October 26, 2008, 17:25:40 pm »
Ok, how about checking the file 'components/com_virtuemart/themes/default/templates/order_emails/confirmation_email.tpl.php' and see if it is hard coded in there.

and if you do not have this file can you please post the version of Virtuemart you are using.

hubfub

  • Beginner
  • *
  • Posts: 38
Re: Fix URL in Order Confirmation email
« Reply #8 on: October 26, 2008, 17:32:42 pm »
Im using Joomla 1.5.7 with VM 1.1.2

I have this file and I believe the relevant section reads:
Code: [Select]
<?php
// EMAIL FOOTER MESSAGE 
if( $is_email_to_shopper ) {
$footer_html "<br /><br />".$VM_LANG->_('PHPSHOP_CHECKOUT_EMAIL_SHOPPER_HEADER2')."<br />";

if( VM_REGISTRATION_TYPE != 'NO_REGISTRATION' ) {
$footer_html .= "<br /><a title=\"".$VM_LANG->_('PHPSHOP_CHECKOUT_EMAIL_SHOPPER_HEADER5')."\" href=\"$order_link\">"
$VM_LANG->_('PHPSHOP_CHECKOUT_EMAIL_SHOPPER_HEADER5')."</a>";
}
$footer_html .= "<br /><br />".$VM_LANG->_('PHPSHOP_CHECKOUT_EMAIL_SHOPPER_HEADER3')."<br />";
$footer_html .= $VM_LANG->_('CMN_EMAIL').": <a href=\"mailto:" $from_email."\">".$from_email."</a>";
// New in version 1.0.5
if( @VM_ONCHECKOUT_SHOW_LEGALINFO == '1' && !empty( $legal_info_title )) {
$footer_html .= "<br /><br />____________________________________________<br />";
$footer_html .= '<h5>'.$legal_info_title.'</h5>';
$footer_html .= $legal_info_html.'<br />';
}
} else {
$footer_html '<br /><br /><a title="'.$VM_LANG->_('PHPSHOP_CHECKOUT_EMAIL_SHOPPER_HEADER5').'" href="'.$order_link.'">'
$VM_LANG->_('PHPSHOP_CHECKOUT_EMAIL_SHOPPER_HEADER5').'</a>';
}
echo 
$footer_html;
?>


I have not made any modifications to the files.. perhaps I could hardcode the URL in here?

jmds

  • Guest
Re: Fix URL in Order Confirmation email
« Reply #9 on: October 26, 2008, 17:41:11 pm »
You could try changing the bit that reads:

Code: [Select]
if( VM_REGISTRATION_TYPE != 'NO_REGISTRATION' ) {
$footer_html .= "<br /><a title=\"".$VM_LANG->_('PHPSHOP_CHECKOUT_EMAIL_SHOPPER_HEADER5')."\" href=\"$order_link\">"
. $VM_LANG->_('PHPSHOP_CHECKOUT_EMAIL_SHOPPER_HEADER5')."</a>";
}


to

Code: [Select]
if( VM_REGISTRATION_TYPE != 'NO_REGISTRATION' ) {
$footer_html .= "<br /><a title=\"".$VM_LANG->_('PHPSHOP_CHECKOUT_EMAIL_SHOPPER_HEADER5')."\" href=\"http://www.yourshop.com/index.php?option=com_virtuemart&page=account.order_details&order_id=4$order_id\">"
. $VM_LANG->_('PHPSHOP_CHECKOUT_EMAIL_SHOPPER_HEADER5')."</a>";
}

you will need to change the else bit below to use the same idea. If this does not work I am afraid I may be stumped.

hubfub

  • Beginner
  • *
  • Posts: 38
Re: Fix URL in Order Confirmation email
« Reply #10 on: October 27, 2008, 06:31:55 am »
worked like a charm.. i wonder wat was wrong though before the hardcoding -.-

thanks so much!

jmds

  • Guest
Re: Fix URL in Order Confirmation email
« Reply #11 on: October 27, 2008, 08:50:01 am »
Glad to help, just keep a note of the files you have modified so when you upgrade you can reapply the fix if required.

Not sure why you had the problem but if you are running ok now that is the main thing.

a.tripicchio

  • Beginner
  • *
  • Posts: 12
Re: Fix URL in Order Confirmation email
« Reply #12 on: January 30, 2009, 17:42:13 pm »
Hi,

I am using

  • Joomla 1.5.9
  • VirtueMart 1.1.3
  • Artio JoomSEF 3.2.3 + VirtueMart SEF extension 2.0.0

and my URL and SECUREURL are the same, that is I'm not using https.

I fixed the problem passing $ignoreSEF=true to $sess->url in file
Code: [Select]
administrator/components/com_virtuemart/classes/ps_checkout.phpat lines 1803-4:
Before:
Code: [Select]
                $shopper_order_link = $sess->url( SECUREURL ."index.php?page=account.order_details&order_id=$order_id", true, false);
                $vendor_order_link = $sess->url( SECUREURL ."index2.php?page=order.order_print&order_id=$order_id&pshop_mode=admin", true, false);
After:
Code: [Select]
                $shopper_order_link = $sess->url( SECUREURL ."index.php?page=account.order_details&order_id=$order_id", true, false, true);
                $vendor_order_link = $sess->url( SECUREURL ."index2.php?page=order.order_print&order_id=$order_id&pshop_mode=admin", true, false, true );


FYI, the method is declared in file
Code: [Select]
administrator/components/com_virtuemart/classes/ps_session.phpat line 499.

Hope this helps somebody else.

Alfredo

demsey

  • Beginner
  • *
  • Posts: 7
Re: Fix URL in Order Confirmation email
« Reply #13 on: March 11, 2009, 16:13:52 pm »
Hi and Thank you a.tripicchio for that solution.

Now I am receiving email and my domain is showing up, but in admin email link looks like this:

Code: [Select]
http://www.mydomain.com/index2.php?page=order.order_print&order_id=37&pshop_mode=admin&option=com_virtuemart&Itemid=1
There isn't administrator in this address that means after click it displays order without joomla and virtuamart interface.

Could you help me to get something like this:

Code: [Select]
http://www.mydomain.com/administrator/index2.php?page=order.order_print&order_id=37&pshop_mode=admin&option=com_virtuemart&Itemid=1
I tried edit ps_checkout.php and change that but I still receive emails without administrator part in URL address.

a.tripicchio

  • Beginner
  • *
  • Posts: 12
Re: Fix URL in Order Confirmation email
« Reply #14 on: March 11, 2009, 16:30:13 pm »
Hi,

I guess you could add the string "administrator/" in $shopper_order_link and $vendor_order_link, just before index.php or index2.php

However, I prefer having the frontend link in the order email, because that's the only way in for my customers. If I want to view an order, I don't use the link, I just go in the backend.

Alfredo