Hello again.
Im using a litle moded prolist sidebox wich displays all products of curent category when you are on product info page.
However I want to add class=selected to the curent product image in the prolist sidebox when on cirent product product info page.
example page
the prolist sidebox is in the left sidebar, and there are several images of products from the same category. I want to add class="selected" to the image witch ID is the same as the curent product info ID
here is the code in prolist.php located in my modules/sidebox page
PHP Code:
<?php
if (($current_page_base == 'product_info') and ((in_array($cPath,explode(",",'133,122'))) or strpos($cPath, '134_') === 0)){
require($template->get_template_dir('tpl_prolist.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes') . '/tpl_prolist.php');
$title .= '↓ Върни се към ↓<br/><a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $_GET['cPath'], 'NONSSL') . '" title="' .zen_get_categories_name((int)$current_category_id). '" >' . zen_get_categories_name((int)$current_category_id) . '</a><br/>';
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);}
elseif ($_GET["main_page"]=="product_info"){
require($template->get_template_dir('tpl_prolist.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes') . '/tpl_prolist.php');
$allowed4 = array_merge(range('a', 'z'), range('A', 'Z'),range(0, 9), array(' ', '+', '/', '-', '*'));
$strippedcat2 = zen_get_categories_name((int)$current_category_id);
$array4 = str_split($strippedcat2);
$title .= '↓ Върни се към ↓<br/><a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $_GET['cPath'], 'NONSSL') . '" title="' .implode('', array_intersect($array4, $allowed4)). '" >' . implode('', array_intersect($array4, $allowed4)) . '</a><br/>';
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);}
?>
and here the code in my tpl_prolist.php dile in templates directory
PHP Code:
<?php
if (($current_page_base == 'product_info') and ((in_array($cPath,explode(",",'133,122'))) or strpos($cPath, '134_') === 0)){
require($template->get_template_dir('tpl_prolist.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes') . '/tpl_prolist.php');
$title .= '↓ Върни се към ↓<br/><a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $_GET['cPath'], 'NONSSL') . '" title="' .zen_get_categories_name((int)$current_category_id). '" >' . zen_get_categories_name((int)$current_category_id) . '</a><br/>';
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);}
elseif ($_GET["main_page"]=="product_info"){
require($template->get_template_dir('tpl_prolist.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes') . '/tpl_prolist.php');
$allowed4 = array_merge(range('a', 'z'), range('A', 'Z'),range(0, 9), array(' ', '+', '/', '-', '*'));
$strippedcat2 = zen_get_categories_name((int)$current_category_id);
$array4 = str_split($strippedcat2);
$title .= '↓ Върни се към ↓<br/><a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $_GET['cPath'], 'NONSSL') . '" title="' .implode('', array_intersect($array4, $allowed4)). '" >' . implode('', array_intersect($array4, $allowed4)) . '</a><br/>';
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);}
?>
Thanks in addvance
Bookmarks