After adding the additional files, there is a link which appears on the bottom of the product details page allowing the user the download the file you just added.
Unfortunately with our setup, the generated URL for the downloadable file was incorrect. Debugging this issue was painful as I was unable to get XDebug to work properly. The Apache child process on my local development environment just keep crashing when ever I have the debugger attached, but this is a long story possibly for another separate entry. It turns out the components/com_virtuemart/router.php was missing the shop.getfile entry and I have to manually added it back it. Inside the virtuemartBuildRoute function add the shop.getfile case into the switch statement. It will look something like this:
case 'shop.getfile'; $segments[] = 'products_getfile'; $segments[] = $query['product_id']; $segments[] = $query['file_id']; unset($query['product_id']); unset($query['file_id']); break;
Then in the virtuemartParseRoute function, add the corresponding code to handing the routing statement created above. It will look something like this:
case 'products_getfile': $vars['page'] = "shop.getfile"; if(isset($segments[1])){ $vars['product_id'] = $segments[1]; } if(isset($segments[2])){ $vars['file_id'] = $segments[2]; } break;
Adding the above code back in and the additional file links for products works again!
I would like to submit a patch to Virtuemart. Unfortunately, it appears the development issue tracker at http://dev.virtuemart.net is not open to public submissions. Hopefully this problem is eventually spotted and fixed by the Virtuemart development team.
Thank you very much, just saved me loads of time! I'm not sure which version of Virtuemart you were using but it worked for v1.1.4
ReplyDeleteGood work :)
Thanks for the comment. I am quite new to the blogger scene and I am glad my posting is helping fellow developers like yourself.
ReplyDeleteHi, thank you for your tip which is correct and hopefully will be fixed soon.
ReplyDeleteBut there is one important thing to say: VM does NOT need "Legacy mode". I am sure: i have installed dozens of shops for me, my customers, and testing purposes.
Are you sure you are not still using the VM package for Joomla 1.0?
Thanx, Leonard! You sure saved me a great deal of time!
ReplyDelete