
Originally Posted by
crazycucumber
Hello "fancie" Phil
Glad you got it sorted - I too am using this addon but could not find an official support thread for it !
Have you worked out how to remove price ?
price isn't something i need my customers to search on - just all the attributes that I am adding to the products as a read only.
2nd on my wish list is to pull this from being a sidebox to include in the main page ( category page ) so it would dynamically change for each different category but in the main page rather than on a sidebox.
Other than that loving it - keep it up Phil !
Hello crazycucumber!
Pretty sure you can just remove the price code from the template though I havent tried it.. no sure if it need 'blank' entries when a query is submitted on the form or if it will just be as if none were selected.
as for having different things on different categories, I would suggest you use the normal functionality of sideboxes and use IF statements based on the currenty category id and wrap it around your various boxes.. same aplies for this though I guess, if it needs all to be visible it wont work.
so in
includes/templates/your_template/sideboxes/tpl_dynamic_filter.php
try commenting out this code:
PHP Code:
/********************************************start price range link/check boxes***************************************************/
if (count($priceArray) > 0) {
$priceGap = floor(($max - $min) / (FILTER_MAX_RANGES - 1));
if (FILTER_MIN_PRICE > 0 && $priceGap < FILTER_MIN_PRICE) $priceGap = FILTER_MIN_PRICE;
if (FILTER_MAX_PRICE > 0 && $priceGap > FILTER_MAX_PRICE) $priceGap = FILTER_MAX_PRICE;
$group = DYNAMIC_FILTER_PREFIX . str_replace(' ', '', DYNAMIC_FILTER_PRICE_GROUP);
$resetParms[] = $group;
$parameters = zen_get_all_get_params();
$dropdownDefault = str_replace('%n', DYNAMIC_FILTER_PRICE_GROUP, DYNAMIC_FILTER_DROPDOWN_DEFAULT);
$priceCount = 0;
$prices = '';
for ($start = $min - 0.5; $start < $max; $start = $end + 0.01) {
$end = round($start + $priceGap);
if ($end < $max) $text = $currency_symbol . round($start * $conversion_rate) . ' -- ' . $currency_symbol . round($end * $conversion_rate);
else $text = $currency_symbol . round($start * $conversion_rate) . ' and over';
foreach($priceArray as $price ){
if ($start <= $price && $end >= $price) {
if (isset($_GET[$group]) && in_array($start . '--' . $end,$_GET[$group])) $linkClass = 'selected';
else $linkClass = 'enabled';
break;
} else $linkClass = 'disabled';
}
$onClick = '';
if (FILTER_GOOGLE_TRACKING != 'No') $onClick .= $trackingStart . '\'filterAction\', \'' . ($linkClass != 'selected' ? 'addFilter' : 'removeFilter') . '\', \'' . $pageName . ';' . DYNAMIC_FILTER_PRICE_GROUP . '=' . $start . '-' . $end . '\'' . $trackingEnd;
if (FILTER_STYLE == 'Checkbox - Single') $onClick .= ' this.form.submit();';
if (FILTER_METHOD != 'Hidden' || $linkClass != 'disabled') {
$hrefLink = $group . '[]=' . $start . '--' . $end;
switch(strtok(FILTER_STYLE, " ")) {
case 'Checkbox':
$prices .= '<li class="dFilterLink">' . zen_draw_checkbox_field($group . '[]', $start . '--' . $end, (isset($_GET[$group]) && in_array($start . '--' . $end,$_GET[$group]) ? true : false), ($linkClass == 'disabled' ? 'disabled="disabled"' : '') . ($onClick != '' && FILTER_STYLE == 'Checkbox - Single' ? ' onclick="' . $onClick . '"' : '')) . $text . '</li>';
break;
case 'Link':
$prices .= '<li class="dFilterLink"><a class="' . $linkClass . '"' . ($linkClass != 'disabled' ? ' rel="nofollow" href="' . zen_href_link($_GET['main_page'], ($linkClass != 'selected' ? $parameters . $hrefLink : str_replace(array($hrefLink,'&'.$hrefLink), array("",""), $parameters)), 'NONSSL') . '"' . ($onClick != '' ? ' onclick="' . $onClick . '"' : '') : '') . ' >' . $text . '</a></li>';
break;
case 'Dropdown':
$prices .= '<option value="' . $start . '--' . $end . '"' . ($linkClass == 'selected' ? ' selected="selected"' : '') . ($linkClass == 'disabled' ? ' disabled="disabled"' : '') . ($onClick != '' && FILTER_STYLE == 'Dropdown - Single' ? ' onclick="' . $onClick . '"' : '') . ' >' . $text . '</option>';
break;
}
}
++$priceCount;
}
$content .= '<hr width="90%" size="0" />';
$content .= '<div><div class="dFilter"><p class="dFilterHeading">' . DYNAMIC_FILTER_TEXT_PREFIX . DYNAMIC_FILTER_TEXT_PRICE . DYNAMIC_FILTER_TEXT_SUFFIX . '</p>';
if (isset($_GET[$group]) && array_filter($_GET[$group])) $content .= '<div class="dFilterClear"><a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array($group)), 'NONSSL') . '">' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'clear_filter.png', DYNAMIC_FILTER_BUTTON_CLEAR_FILTER_ALT) . '</a></div>';
if (strtok(FILTER_STYLE, " ") == 'Dropdown') $content .= '<select name="' . $group . '[]" class="dFilterDrop"' . (FILTER_STYLE == 'Dropdown - Single' ? ' onchange="this.form.submit();"' : '') . '>' . '<option value=""' . (!isset($_GET[$group]) || !array_filter($_GET[$group]) ? ' selected="selected"' : '') . '>' . $dropdownDefault . '</option>';
else $content .= '<ul' . ($priceCount > FILTER_MAX_OPTIONS ? (FILTER_OPTIONS_STYLE == 'Scroll' ? ' class="dFilterScroll">' : ' class="dFilterExpand">') : '>');
$content .= $prices;
if (strtok(FILTER_STYLE, " ") == 'Dropdown') $content .= '</select>';
else $content .= '</ul>';
if (FILTER_OPTIONS_STYLE == 'Expand' && $priceCount > FILTER_MAX_OPTIONS) $content .= '<a class="dFilterToggle" href="#">More' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'arrow_more.gif', 'More', '', '', 'class="dFilterToggleImg"') . '</a>';
$content .= '</div></div>';
}
/********************************************end price range link/check boxes***************************************************/
not tried and tested, so back up beofre you try..
Bookmarks