Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Append or Add Product Media Clip Link to Product Listing

Append or Add Product Media Clip Link to Product Listing

Views: 947

Results 1 to 3 of 3
15 Apr 2014, 2:41 AM
#1
jenniferxo avatar

jenniferxo

New Zenner

Join Date:
Apr 2014
Location:
Los Angeles
Posts:
41
Plugin Contributions:
0

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?

<!--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!

https://www.hiphopbeatz.com/2014

16 Apr 2014, 12:48 AM
#2
jenniferxo avatar

jenniferxo

New Zenner

Join Date:
Apr 2014
Location:
Los Angeles
Posts:
41
Plugin Contributions:
0

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.

        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;
20 Apr 2014, 4:58 AM
#3
jenniferxo avatar

jenniferxo

New Zenner

Join Date:
Apr 2014
Location:
Los Angeles
Posts:
41
Plugin Contributions:
0

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

Courtesy of DrByte.

        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: https://www.zen-cart.com/donate