Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2009
    Posts
    43
    Plugin Contributions
    0

    Default music add on - flash player button

    Hi,

    We're using a 'music add on' with a sample preview option.
    Clicking the preview button will open a popup screen and play the sample with the client media player etc:

    http://www.dlsounds.com/music/index....=index&cPath=1

    the music addon calls a popup.php

    But in stead of the popup we want to use a mp3 flash player button.
    like this:
    http://www.songservice.it/index.php?main_page=index

    In tpl_preview_default.php i found this code:
    Code:
    //$song_mp3='<a href= "index.php?main_page=product_music_info&products_id='.(int)$products_id.'&products_preview='.$preview.'">mp3'.'</a>';
    
    //$song_mp3G='<a href= "index.php?main_page=product_music_info&products_id='.(int)$products_id.'&products_preview='.$preview_mp3G.'">mp3+G'.'</a>';
    
    //$song_wmv='<a href= "index.php?main_page=product_music_info&products_id='.(int)$products_id.'&products_preview='.$preview_wmv.'">WMV'.'</a>';
    
    if($preview_songs2->fields['products_attributes_mp3_preview'])
    {
    $preview=$preview_songs2->fields['products_attributes_mp3_preview'];
    
    $path = 'previews/'.$preview;
    $song = $preview;
    $song_mp3 = '<a href="javascript:popupWindow(\'popup.php?song='.$song.'&path='.$path.'\')">MP3</a>';
    
    }
    
    if($preview_songs2->fields['products_attributes_mp3G_preview'])
    	{
    $preview_mp3G=$preview_songs2->fields['products_attributes_mp3G_preview'];
    
    $path = 'previews/'.$preview_mp3G;
    $song = $preview_mp3G;
    $song_mp3G = '<a href="javascript:popupWindow(\'popup.php?song='.$song.'&path='.$path.'\')">mp3G</a>';
    }
    
    if($preview_songs2->fields['products_attributes_wmv_preview'])
    	{
    $preview_wmv=$preview_songs2->fields['products_attributes_wmv_preview'];
    $path = 'previews/'.$preview_wmv;
    
    $song = $preview_wmv;
    
    
    $song_wmv = '<a href="javascript:popupWindow(\'popup.php?song='.$song.'&path='.$path.'\')"><img src="includes/templates/classic/images/sound_preview.png" width="27" height="26" alt="preview" /></a>';
    
    }
    
    //'$_GET['main_page']'
    
    
    $products_link = '<a href="' . zen_href_link(zen_get_info_page($products_id), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $products_id) . '">' . BUTTON_IMAGE_MORE_INFO . '</a>';
    
    //$lc_button = '<a href="' . zen_href_link('index',  'action=buy_now&products_id=5' ) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
    
    //$lc_button = '<a href="' . zen_href_link('product_music_info',  'number_of_uploads=0&action=add_product&products_id='.$products_id ) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>'.zen_draw_hidden_field('products_id', $products_id).zen_draw_hidden_field('cart_quantity', '1');
    
    
    
    
    $lc_button = zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($products_id), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $products_id), 'post', 'enctype="multipart/form-data"') . '<input type="hidden" name="cart_quantity" value="' . (zen_get_buy_now_qty($products_id)) . '" maxlength="6" size="4" />' . zen_draw_hidden_field('products_id', $products_id) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';
    
    $the_button=$lc_button;
    //echo  $products_link;
    $add_to_cart=  zen_get_buy_now_button($products_id, $the_button, $products_link) .  zen_get_products_quantity_min_units_display($products_id);
    
    //echo $the_button;
    //echo zen_get_products_quantity_min_units_display($products_id)."********";
    
    //echo $add_to_cart;
    //$add_to_cart='<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_id) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
    
    //echo $_GET['main_page'];
    $name=$preview_songs2->fields['products_name'];
    
    //echo '<table class="'.$class_name.'" border="0" width="100%" cellspacing="0" cellpadding="0"><tr ><td width="50">'.$track_id.'</td><td width="150"><a href= "index.php?main_page=preview&title='.$name.'">'.$name.'</a></td><td width="130">'.'<a href= "index.php?main_page=preview&artistid='.$artist_id.'">'.$artist.'</a>'.'</td><td width="40">'.$track_duration.'</td><td width="100">'.$song_mp3.'&nbsp;'.$song_mp3G.'&nbsp;'.$song_wmv.'</td><td width="95">'.$add_to_cart.'</td></tr></table>';
    echo '<table class="'.$class_name.'" border="0" width="100%" cellspacing="0" cellpadding="0">
    		<tr >
    			<td width="30">'.$products_id.'</td>
    			<td width="130"><a href= "'.zen_href_link('preview','title='.$name).'">'.$name.'</a></td>
    			<td width="120">'.'<a href= "'.zen_href_link('preview','artistid='.$artist_id).'">'.$artist.'</a></td>
    			<td width="50">'.$song_wmv.'</td>
    			<td width="75">'.$the_button.'</td>
    		</tr>
    	  </table>';
    
    }
    $preview_songs2->moveNext();
    }
    //advanced_search_result
    //US end
    
    ?>
    Any idea how to adjust the code to get it working?

    Many thanks

    Pascal

  2. #2
    Join Date
    Aug 2009
    Posts
    43
    Plugin Contributions
    0

    Default Re: music add on - flash player button

    I decided to try a different approach. (adding a static mp3 flash player and a play button besides the products)

    http://www.zen-cart.com/forum/showthread.php?t=134689

    sorry for posting in 2 different topics!

 

 

Similar Threads

  1. Flash Music Player with buy button?
    By jami1955 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 23 Jun 2011, 10:59 AM
  2. Integrate Flash Music/Beats Player?
    By Yolanda in forum General Questions
    Replies: 0
    Last Post: 11 Sep 2010, 09:42 PM
  3. Adding a flash player button
    By digital-dj in forum General Questions
    Replies: 0
    Last Post: 18 Oct 2009, 04:19 PM
  4. Music player add-on?
    By hoodone in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 13 May 2009, 01:19 PM
  5. Wimpy Music Player, integrated with ADD To Cart?
    By davestrand in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 8 Mar 2007, 12:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg