Ok, I tried to post this last week and had trouble. I am trying again, hopefully it will show up this time.
DEMO: [URL=“http://aarbour.kodingen.com/cs-cart/index.php?dispatch=products.view&product_id=1”]http://aarbour.kodingen.com/cs-cart/index.php?dispatch=products.view&product_id=1[/URL]
This is a rather crude way to get this to work, but it does work. This can be reconfigured to be used with the Preview in a Digital Download. However, I needed this for a CD sample site. I am still working on it but it is working.
How Does This Work?
It checks for MP3 attachments and then displays the flash player at the Top of the Product Description.
There are two modifications:
-
\var.htaccess – Needs to be modified to allow the mp3 attachment access to the flash player.
<br />
Order deny,allow<br />
Deny from all<br />
<Files ~ "\.js$"><br />
order allow,deny<br />
allow from all<br />
</Files><br />
[B]<Files ~ "\.mp3$"><br />
order allow,deny<br />
allow from all<br />
</Files>[/B]<br />
```<br />
<br />
2) [B]\skins\basic\customer\blocks\product_tabs\description.tpl[/B] -- [I]You'll see the additional code at the top.[/I]<br />
```php
<br />
{if $attachments_data}<br />
<div id="mp3_attachments"><br />
{foreach from=$attachments_data item="file"}<br />
{if $file.filename|strstr:'.mp3'}<br />
{literal}<br />
<script type="text/javascript" src="http://wpaudioplayer.com/wp-content/plugins/audio-player/assets/audio-player.js?ver=2.0.4.1"></script> <br />
<script type="text/javascript"><br />
<!--<br />
AudioPlayer.setup("http://wpaudioplayer.com/wp-content/plugins/audio-player/assets/player.swf?ver=2.0.4.1", {width:"290"});<br />
//--><br />
</script><br />
{/literal} <br />
<br />
{assign var=mp3location value="`$config.http_location`/var/attachments/product/`$_REQUEST.product_id`/`$file.filename`"}<br />
<br />
<p id="audioplayer_{$file.attachment_id}">Mp3 sample is unable to load</p><br />
{literal}<br />
<script type="text/javascript"> <br />
<!--<br />
AudioPlayer.embed("{/literal}audioplayer_{$file.attachment_id}{literal}", {soundFile: "{/literal}{$mp3location}{literal}"});<br />
//--><br />
</script><br />
{/literal}<br />
{/if}<br />
{/foreach}<br />
</div><br />
{/if}<br />
<br />
{$product.full_description|default:$product.short_description|unescape}<br />