Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2014
    Location
    Los Angeles
    Posts
    41
    Plugin Contributions
    0

    Default Append or Add Product Media Clip Link to Product Listing

    Hello,

    I have the SNAF mod installed and I am trying to add a link to the product's media clip from 'tpl_product_music_info_display' to display directly after the product Name in the product listing. I was trying to add this code to '/modules/product_listing' and 'tpl_product_all_default' but have had no luck. Is there any way to either append this code to the Product Name or replace an un-needed value (maybe weight) with this code to have access in admin section to add Media Clips to Product Listing?

    Code:
    <!--bof Media Manager -->
    <div id="mediaManager" class="productMusic"><?php
    /**
     * display the products related media clips
     */
     require($template->get_template_dir('/tpl_modules_media_manager.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_media_manager.php'); ?>
    <br class="clearBoth" /></div>
    <!--eof Media Manager -->

    Thanks!

    www.hiphopbeatz.com/2014

  2. #2
    Join Date
    Apr 2014
    Location
    Los Angeles
    Posts
    41
    Plugin Contributions
    0

    Default Re: Append or Add Product Media Clip Link to Product Listing

    I something like this in product_lisiting.php anything close. Sorry I am new to zencart and php.

    Code:
            case 'PRODUCT_LIST_NAME':
            $lc_align = '';
            if (isset($_GET['manufacturers_id'])) {
              $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ;
            } else {
    		require(DIR_WS_MODULES . zen_get_module_directory('media_manager.php'));
    		if ($zv_product_has_media) {
    		while (list($za_media_key, $za_media) = each($za_media_manager)) {
    		    $zv_counter1 = 0;
    			while(list($za_clip_key, $za_clip) = each($za_media_manager[$za_media_key]['clips'])) {
              $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '<div class="mediaTypeLink"><span class="Play" href="' echo zen_href_link(DIR_WS_MEDIA  . $za_clip['clip_filename'], '', 'NONSSL', false, true, true); . '" target="_blank"><img src="images/play_button.png"/>' . echo '<span class="mediaClipFilename">' . $za_clip['clip_filename'] . '</span>' . (!empty($za_clip['clip_type']) ? '<span class="mediaClipType"> (' . $za_clip['clip_type'] . ')</span>' : '') . '</span></div></div>';
            } } } }
            break;

  3. #3
    Join Date
    Apr 2014
    Location
    Los Angeles
    Posts
    41
    Plugin Contributions
    0

    Default Re: Append or Add Product Media Clip Link to Product Listing

    Courtesy of DrByte.

    Code:
            case 'PRODUCT_LIST_NAME':        $lc_align = '';
            $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id'] > 0) ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
            // bof: display media clip filenames
            $_GET['products_id'] = $listing->fields['products_id'];
            require(DIR_WS_MODULES . zen_get_module_directory('media_manager.php'));
            if ($zv_product_has_media) {
              while (list($za_media_key, $za_media) = each($za_media_manager)) {
                while(list($za_clip_key, $za_clip) = each($za_media_manager[$za_media_key]['clips'])) {
                  $lc_text .= $za_clip['clip_filename'];
                }
              }
            }
            unset($_GET['products_id'], $za_media_manager, $zv_product_has_media);
            // eof: display media clip filenames
            break;
            case 'PRODUCT_LIST_MANUFACTURER':

    Adds great functionality for music sites..

    If you use this code, donations always appreciated at: www.zen-cart.com/donate

 

 

Similar Threads

  1. apostrophe problem with Media Clip
    By redheadskater in forum General Questions
    Replies: 10
    Last Post: 30 Jan 2011, 08:17 AM
  2. Replies: 0
    Last Post: 13 May 2009, 04:04 PM
  3. Replies: 0
    Last Post: 13 Mar 2009, 10:00 PM
  4. Product Listing Modification to Include Link to Media Manager Preview
    By sleastack in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 Mar 2008, 12:25 AM
  5. Media Manager/Listen to MP3 link in categories product listing?
    By Ian Davies in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 21 Sep 2006, 01:42 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR