order confirmation email, wrong products, order and site shop link

Started by bytelord, July 08, 2012, 21:19:07 PM

Previous topic - Next topic

bytelord

Hello,

I am working with VM208c and j256. I have joomla installed on mydomain.com/site and virtuemart seo link is mydomain.com/site/eshop.

When a shopper order something either with registering an account or checkout as a Guest there are issues with the mails received by vendor and shopper.

in the shopper order email the following links are wrong.

1. Order link:
   http://www.mydomain.com/index.php?option=com_virtuemart&view=orders&layout=details&order_number=1a0f07&order_pass=p_93217
   instead of
   http://www.mydomain.com/site/index.php?option=com_virtuemart&view=orders&layout=details&order_number=1a0f07&order_pass=p_93217
   (joomla installation folder not applied)

2. Product links
    http://www.mydomain.com//site/index.php/eshop/category/product-detail
    instead of
    http://www.mydomain.com/site/index.php/eshop/category/product-detail
    (one more "/" is been applied")

3. Store link:
    http://www.medomain.com/http://www.mydomain.com/site/index.php/eshop
    instead of
    http://www.mydomain.com/site/index.php/eshop

the same error links produced also in the vendor notification e-mail.

Also in VM 2 Backend when i try print orders or product a pdf invoice the links has the same errors as above.

Does anyone know why this is happen and how can i fix it?

Thanks in advance.



Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

bytelord

i find where the issue is and the links are not produced correctly at least for the products at the moment.

Inside template invoice\tmpl\invoice_items.php between at line 45-52 we have

$product_link = JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $item->virtuemart_category_id .
'&virtuemart_product_id=' . $item->virtuemart_product_id );
$baseUrl = shopFunctionsF::getBaseUrl();
// product link must be an absolute URL.

$product_link=$baseUrl.$product_link;

//$product_link =JURI::root().'index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $item->virtuemart_category_id .'&virtuemart_product_id=' . $item->virtuemart_product_id;


The issue is in lines 47 and 50 where the baseurl is been merged to to product link. So something goes wrong with  shopFunctionsF::getBaseUrl() and doesn't make links correct. I think that the same function produces some sef issues.

So if you leave on line 45 or 52 it will work fine and produce the links correctly.

result:

$product_link = JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $item->virtuemart_category_id .
'&virtuemart_product_id=' . $item->virtuemart_product_id );
//$baseUrl = shopFunctionsF::getBaseUrl();
// product link must be an absolute URL.

//$product_link=$baseUrl.$product_link;

//$product_link =JURI::root().'index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $item->virtuemart_category_id .'&virtuemart_product_id=' . $item->virtuemart_product_id;

Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

Milbo

Please enable the commented stuff again and use


$product_link = shopFunctionsF::getBaseUrl().JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $item->virtuemart_category_id .
'&virtuemart_product_id=' . $item->virtuemart_product_id ,false,-1);
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

malaclypse

Sorry, but this issue is not solved at all.

For one, the answers only concern the product links. If i get it right, the link is generated in

$product_link =shopFunctionsF::getBaseUrl().JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $item->virtuemart_category_id .
'&virtuemart_product_id=' . $item->virtuemart_product_id ,false,-1);


But in the following lines:
$baseUrl = shopFunctionsF::getBaseUrl();
...
$product_link=$baseUrl.$product_link;


Which means that the BaseUrl is added twice. So you have to comment them out.

The other thing being that there is no answer concerning the order and store link, which are also broken in 2.0.8c

alatak

Hello,

It is due to a problem with the editor we are using.
To fix the problem go in file components/com_virtuemart/views/invoice/tmpl/invoice_items.php

and put that line on one line
<a class="default" title="<?php echo $this->vendor->vendor_store_name ?>" href="<?php echo  shopFunctionsF::getBaseUrl().JRoute::_('index.php?option=com_virtuemart&view=orders&layout=details&order_number='.$this->orderDetails['details']['BT']->order_number.'&order_pass='.$this->orderDetails['details']['BT']->order_pass); ?>">


this will remove the tabs that have been included , and breaking the routing.

I will be fixed for the version 2.0.8.d

bytelord

I have solve with other way the vendor link but i didn't post it. I mark the thread as unsolved until the code be tested as recommended from the developers.

Thanks
BL

Quote from: malaclypse on July 09, 2012, 12:50:31 PM
Sorry, but this issue is not solved at all.

For one, the answers only concern the product links. If i get it right, the link is generated in

$product_link =shopFunctionsF::getBaseUrl().JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $item->virtuemart_category_id .
'&virtuemart_product_id=' . $item->virtuemart_product_id ,false,-1);


But in the following lines:
$baseUrl = shopFunctionsF::getBaseUrl();
...
$product_link=$baseUrl.$product_link;


Which means that the BaseUrl is added twice. So you have to comment them out.

The other thing being that there is no answer concerning the order and store link, which are also broken in 2.0.8c
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

bytelord

Hello Milbo,

I make the changes as you suggest but doesn't fix the issue. The url that produced is:

mydomain.com/http://myadmain.com/site/eshop.....

i try also comment the other lines of code but i get the same results.

Quote from: Milbo on July 09, 2012, 11:57:55 AM
Please enable the commented stuff again and use


$product_link = shopFunctionsF::getBaseUrl().JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $item->virtuemart_category_id .
'&virtuemart_product_id=' . $item->virtuemart_product_id ,false,-1);

Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!


bytelord

Hello

Nothing happens either, i get the same results with the urls.

Thanks.

Quote from: alatak on July 10, 2012, 17:21:02 PM
Hello

The correct fix is this one:
http://forum.virtuemart.net/index.php?topic=104988.msg349554#msg349554
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

DaggaTora

Joomla 2.5.17 | VM2.0.26d | PHP 5.3.28

bytelord

Hello,

Still in version 208e the store link at footer of the mails is wrong. The other two issues has been resolved and works (order link, products links).

Store link:
    http://www.medomain.com/http://www.mydomain.com/site/index.php/eshop
    instead of
    http://www.mydomain.com/site/index.php/eshop

Please if you can fixed to the next release of 208

thanks
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

DaggaTora

Quote from: DaggaTora on July 16, 2012, 10:25:16 AM
Quote from: alatak on July 10, 2012, 17:21:02 PM
Hello

The correct fix is this one:
http://forum.virtuemart.net/index.php?topic=104988.msg349554#msg349554

This worked with 2.0.8c

In 2.0.8d i still get the error and this solution doesn't work  :'(

Neither in 1.0.8e. To make this work I had to comment line 47 and 48.
Joomla 2.5.17 | VM2.0.26d | PHP 5.3.28

Thomas Kampp

This has not been fixed in Virtuemart 2.0.18a, and the proposed fixes in this thread is NOT working.
What to do?

Also there is no guideline on what line to put the prosed (but have tried all)
<a class="default" title="<?php echo $this->vendor->vendor_store_name ?>" href="<?php echo  shopFunctionsF::getBaseUrl().JRoute::_('index.php?option=com_virtuemart&view=orders&layout=details&order_number='.$this->orderDetails['details']['BT']->order_number.'&order_pass='.$this->orderDetails['details']['BT']->order_pass); ?>">
Danish Joomla Services: www.toolmaster.dk
Danish Joomla Services: www.joomla-konsulent.dk
Danish Joomla Hosting: www.joomla-hosting.dk
Danish Smart Home: www.smart-home-konsulent.dk
Danish Subject Blog: www.sutra.dk