Author Topic: order confirmation email, wrong products, order and site shop link  (Read 6125 times)

bytelord

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
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

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
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

Code: [Select]
$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:

Code: [Select]
$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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10018
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Please enable the commented stuff again and use
Code: [Select]

$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);
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

malaclypse

  • Beginner
  • *
  • Posts: 9
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

Code: [Select]
$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:
Code: [Select]
$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

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2047
    • alatak.net
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
Code: [Select]
<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

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
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

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

Code: [Select]
$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:
Code: [Select]
$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

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
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.

Please enable the commented stuff again and use
Code: [Select]

$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!

alatak

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2047
    • alatak.net

bytelord

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
Re: order confirmation email, wrong products, order and site shop link
« Reply #8 on: July 10, 2012, 18:11:41 pm »
Hello

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

Thanks.

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

  • Jr. Member
  • **
  • Posts: 253
Re: order confirmation email, wrong products, order and site shop link
« Reply #9 on: July 16, 2012, 10:25:16 am »
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  :'(
Joomla 2.5.17 | VM2.0.26d | PHP 5.3.28

bytelord

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
Re: order confirmation email, wrong products, order and site shop link
« Reply #10 on: July 17, 2012, 17:24:18 pm »
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

  • Jr. Member
  • **
  • Posts: 253
Re: order confirmation email, wrong products, order and site shop link
« Reply #11 on: July 17, 2012, 17:57:28 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

  • Jr. Member
  • **
  • Posts: 61
  • Joomla Developer
    • Toolmaster.dk
Re: order confirmation email, wrong products, order and site shop link
« Reply #12 on: February 09, 2013, 16:34:52 pm »
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)
Code: [Select]
<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