MP3 Player MOD Problems

I have been trying my hardest to implement a MP3 player into CS-Cart (In a way that is usable for a client)



I will start by stating what I want to happen.



I wish every item in category view, and in product view, to have a small flash player that plays a sample for each item. All the sample MP3’s will be named by product ID, so if the product ID is 91211 then the mp3 will be 91211.mp3



I added a flash player without any issues, and it works with me “hard setting” the MP3. But I understand that to automatically set the MP3 on a per product basis, using the $product.product_id as a title.



I have tried using this code to allow this











It seems PHP doesnt pass the right variables to the player within the product view, and instead tries to play "<?php echo $mp3_file;?>">" which, obviously doesnt work. It would be good to add this within the template somehow, to save me having to add it to each individual product manually... Is this possible?

Any help appreciated, Im sure this would help many others too!

regards
Jon

You can’t use in a Smarty template.



You need to use {php} … {/php}



[url]Search Results for "docsv2" | Smarty

using {php} seems to do the same?



is it because I am putting this into the product decription and not elsewhere?

You might try using the smarty {literal} tag around your flash code in conjunction with the {php} tag around the php code. If that doesn’t work I would put it directly into the tpl file and not the description variable.

You cannot put smarty, php, or any variables in a Product description wysiwyg editor, all of that is stripped out for security reasons.

Would anyone be able to point me in the right direction as to what .tpl file I would need to edit to place the code in:



Product Description

Small Description (eg the little description in the category view)



Regards

Jon

[quote name=‘scibot’]Would anyone be able to point me in the right direction as to what .tpl file I would need to edit to place the code in:



Product Description

Small Description (eg the little description in the category view)



Regards

Jon[/QUOTE]



Same for me. I’m also interested in setting up a similar thing. Anyone have any solutions?

Looks like I found my answer. gginorio has already posted a solution. Here’s the link to his mod:



[url]http://cscartplugins.com/cs-cart-2.0.15-mp3-attachment-player-addon.html[/url]

Thanks for the link.



That is actually my second Addon ever.

I sent you a pm about one of these questions but I’m posting here just in case it didn’t go through as I have an additional question:


  1. With that mod, can one select from the different styles of mp3 player or does it always have to be the “mini” setting? The reason why I’m asking is because I would like the “classic” setting if possible.



    I’m going to be setting up another website in the next 5 months or so in which I will be selling sheet music via downloadable files - specifically PDF’s. I would be using the mp3 player to play a sample mp3 file of the sheet music in question. So, for my next question:


  2. Since I won’t be selling the Mp3 that the mod would be sampling, will that confuse the mod at all as I would be having it pull from a file that is not the primary file being sold?



    Thanks.

I left all the different versions of DewPlayer in the directory



Find the file:

skins/{YOUR_SKIN}/customer/addons/attachments/blocks/product_tabs/attachments.tpl



You’ll see the flash file it currently links to.



Look in the /lib/dewplayer/ folder to see the other flash files available. Simple choose another flash file.



As for using samples, remember that the mod is pretty simple. Whatever you add as an attachment it will play. It does not play the product or any files you have to pay to download. That was my intention when I built it. Simply attach a preview and it’ll be available to listen to.

Wonderful! Thanks so much. :slight_smile:

I am too in need of adding a flash player to the cs-cart CD tracks which will play a sample track. I need to know the code and where to enter it in which .tpl file so each track will get the right sample by the ID# of the full track