Monday, August 1, 2011

PrestaShip Tips - Virtual product download link problem at order history page

Today,I found a bug of PrestaShop at Order history page of my account area, the problem was found on PrestaShop 1.3x, but I confirmed that the same problem also happens in PrestaShop 1.4x (so far 1.4.4.0)

What is the issue.


This problem happens in specific scenario.
Usually there is a link on the product name to download the virtual products.

But if you have a virtual product (downloadable product) with a customization fields, then at My Account area, Order History page, the download link will not appear.





Here is my case:
I have download product (prestashop module), with one required text fields let customer to input store domain name. Before I set the customized field, everything works fine. But once I add the required customized filed, the link disappeared.

How to fix the issue.


To fix this problem, you need to modify the them file
YourStoreRoot/themes/YourStoreTheme/order-detail.tpl

You need to replace one line of code at location in this file as shown with code followed.





{if $product.download_hash && $invoice}
<a href="{$base_dir}get-file.php?key={$product.filename|escape:'htmlall':'UTF-8'}-{$product.download_hash|escape:'htmlall':'UTF-8'}" title="{l s='download this product'}">
<img src="{$img_dir}icon/download_product.gif" class="icon" alt="{l s='Download product'}" />
</a>
<a href="{$base_dir}get-file.php?key={$product.filename|escape:'htmlall':'UTF-8'}-{$product.download_hash|escape:'htmlall':'UTF-8'}" title="{l s='download this product'}">
{$product.product_name|escape:'htmlall':'UTF-8'}
</a>
{else}
{$product.product_name|escape:'htmlall':'UTF-8'}
{/if}




Here is screenshot after the problem is fixed.

1 comment:

Anonymous said...

THAAAAAAAAANNNNNNKKKKKKS so much !

24 hours I am trying to find a solution!