Добрый день.
Характеристики
Joomla 1.5.18
Virtuemart 1.4
Проблема:
Поставил фильтр товаров vm product picker, в настройках модуля указал не отображаться на flypage, но проблема в том, что место модуля пустое т.е карточка товара сужается, что является очень критичным.
Прошу подсказать как указать условие для этого модуля, чтобы он не просто был скрыт,а вообще не выводился (т.е чтобы карточка товара была на всю ширину).
Все возможные темы на этом форуме и в интернете я просмотрел и перепробовал, но ничего не получилось.
В самом index.php шаблона позиции не прописаны.
Шаблон gk_mystore - код ниже:
Буду очень признателен за помощь.
<?php
/*
#------------------------------------------------------------------------
# myStore - May 2010 (for Joomla 1.5)
#
# Copyright (C) 2007-2010 Gavick.com. All Rights Reserved.
# License: Copyrighted Commercial Software
# Website: http://www.gavick.com
# Support: support@gavick.com
#------------------------------------------------------------------------
# Based on T3 Framework
#------------------------------------------------------------------------
# Copyright (C) 2004-2009 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
# @license - GNU/GPL, http://www.gnu.org/copyleft/gpl.html
# Author: J.O.O.M Solutions Co., Ltd
#------------------------------------------------------------------------
*/
if (file_exists(JPATH_SITE.DS.'components'.DS.'com_joomlastats'.DS.'joomlastats.inc.php'))
include_once(JPATH_SITE.DS.'components'.DS.'com_joomlastats'.DS.'joomlastats.inc.php');
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
include_once (dirname(__FILE__).DS.'libs'.DS.'gk.template.helper.php');
$tmpl = GKTemplateHelper::getInstance($this, array('ui', GK_TOOL_SCREEN, GK_TOOL_MENU, 'main_layout', 'direction'));
//Calculate the width of template
$tmplWidth = '';
$tmplWrapMin = '100%';
switch ($tmpl->getParam(GK_TOOL_SCREEN)){
case 'auto':
$tmplWidth = '97%';
break;
case 'fluid':
$tmplWidth = intval($tmpl->getParam('gk_screen-fluid-fix-gk_screen_width'));
$tmplWidth = $tmplWidth ? $tmplWidth.'%' : '90%';
break;
case 'fix':
$tmplWidth = intval($tmpl->getParam('gk_screen-fluid-fix-gk_screen_width'));
$tmplWrapMin = $tmplWidth ? ($tmplWidth+1).'px' : '771px';
$tmplWidth = $tmplWidth ? $tmplWidth.'px' : '770px';
break;
default:
$tmplWidth = intval($tmpl->getParam(GK_TOOL_SCREEN));
$tmplWrapMin = $tmplWidth ? ($tmplWidth+1).'px' : '983px';
$tmplWidth = $tmplWidth ? $tmplWidth.'px' : '982px';
break;
}
$tmpl->setParam ('tmplWidth', $tmplWidth);
$tmpl->setParam ('tmplWrapMin', $tmplWrapMin);
//Main navigation
$gk_menutype = $tmpl->getMenuType();
$gkmenu = null;
if ($gk_menutype && $gk_menutype != 'none') {
$gkparams = new JParameter('');
$gkparams->set( 'menutype', $tmpl->getParam('menutype', 'mainmenu') );
$gkparams->set( 'menu_images_align', 'left' );
$gkparams->set( 'menupath', $tmpl->templateurl().'/gk_menus');
$gkparams->set('menu_images', 1); //0: not show image, 1: show image which set in menu item
$gkparams->set('menu_background', 1); //0: image, 1: background
$gkparams->set('mega-colwidth', 200); //Megamenu only: Default column width
$gkparams->set('mega-style', 1); //Megamenu only: Menu style.
$gkparams->set('rtl',($tmpl->getParam('direction')=='rtl' || $tmpl->direction == 'rtl'));
$gkmenu = $tmpl->loadMenu($gkparams, $gk_menutype);
}
//End for main navigation
$layout = $tmpl->getLayout ();
if ($layout) {
$tmpl->display($layout);
}
А также код самого модуля фильтра (может там надо что-то исправить):
<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
/**
* VirtueMart PRODUCT PICKER
*MODIFIED FROM Cherry Picker Dummy Module
*
* @package VirtueMart PRODUCT PICKER - modified from Cherry Picker Dummy
* @copyright Copyright © 2009 Maksym Stefanchuk All rights reserved.
* @license http://www.gnu.org/licenses/gpl.html GNU/GPL
** http://www.galt.ck.ua
*
* MODIFIED BY Anthony Chan
*/
global $mosConfig_absolute_path, $vm_mainframe, $sess;
// Load the VirtueMart main parse code
if( file_exists(dirname(__FILE__).'/../../components/com_virtuemart/virtuemart_parser.php' )) {
require_once( dirname(__FILE__).'/../../components/com_virtuemart/virtuemart_parser.php' );
} else {
require_once( dirname(__FILE__).'/../components/com_virtuemart/virtuemart_parser.php' );
}
$displayonflypage = $params->get( 'displayonflypage', '' );
$page = vmGet( $_REQUEST, 'page', '' );
$tmp_product_type_id = vmGet( $_REQUEST, 'product_type_id', '' );
//$totalproductcount = vmGet($_SESSION ,'productcount', ''); //HACKED the shop.browse page by adding $_SESSION['productcount']=$num_rows after $num_rows is defined
//and get the session value here to avoid a large query to find the num of products
if ( (!($page != 'shop.browse' && !$displayonflypage) or !empty($tmp_product_type_id)) ) {
$type_of_pretext = $params->get( 'type_of_pretext', '' );
$static_pretext = $params->get( 'static_pretext', '' );
$dynamic_pretext = $params->get( 'dynamic_pretext', '' );
$show_totalproducts = $params->get( 'show_totalproducts', '' );
$pretext_totalproducts = $params->get( 'pretext_totalproducts', '' );
$posttext_totalproducts = $params->get( 'posttext_totalproducts', '' );
$showfieldcount = $params->get( 'showfieldcount', '1' );
$show_pt_publish = $params->get( 'show_pt_publish', '1' );
$use_custom_params = $params->get( 'use_custom_params', '0' );
$user_product_type_id = $params->get( 'user_product_type_id', '1');
$theme = $params->get( 'theme', '' );
$category_id = vmGet( $_REQUEST, 'category_id', '' );
$product_type_id = '';
$pti = '';
$Itemid = JRequest::getInt( 'Itemid', null );
$db = new ps_DB;
$q = "SELECT * FROM `#__{vm}_product_type_parameter` WHERE `product_type_id` ='$user_product_type_id' ORDER BY parameter_list_order";
$db->setQuery($q);
$pti = $db->loadObjectList();
$pticounts=count($pti);
$product_type_id = $pti[0]->product_type_id;
if (!empty($product_type_id)) {
$filter = array();$filterurl = array();$filter_paramurl=array();$where='';$paramquery='';$filterquery=array();$value='value';
for ($i=0;$i<=$pticounts;$i++){
if (!$pti[$i]->product_type_id){break;}
//$paramquery .= ' , `'.$pti[$i]->parameter_name.'` ';
$tmp_url = "product_type_".$product_type_id."_".$pti[$i]->parameter_name;
$filter[$i] = vmGet($_REQUEST, $tmp_url, "");
$filter_comp = vmGet($_REQUEST, $tmp_url."_comp", "");
if ($pti[$i]->parameter_type != "V" && $pti[$i]->parameter_multiselect == "Y") {
$filterurl[$i] = '&product_type_'.$product_type_id.'_'.$pti[$i]->parameter_name.'_comp=in';
$filter_paramurl[$i] = '&product_type_'.$product_type_id.'_'.$pti[$i]->parameter_name.'[]=';
$filterquery[$i] = " (`".$pti[$i]->parameter_name."`= '".$value."') AND ";
} elseif ($pti[$i]->parameter_type == "V" && $pti[$i]->parameter_multiselect == "N") {
$filterurl[$i] = '&product_type_'.$product_type_id.'_'.$pti[$i]->parameter_name.'_comp=find_in_set';
$filter_paramurl[$i] = '&product_type_'.$product_type_id.'_'.$pti[$i]->parameter_name.'=';
$filterquery[$i] = " (FIND_IN_SET('".$value."',REPLACE(`".$pti[$i]->parameter_name."`,';',','))) AND ";
} elseif ($pti[$i]->parameter_type == "V" && $pti[$i]->parameter_multiselect == "Y") {
if ( !empty($filter_comp) ) { $comp = $filter_comp; } else { $comp = 'find_in_set_all'; }
$filterurl[$i] = '&product_type_'.$product_type_id.'_'.$pti[$i]->parameter_name.'_comp='.$comp.'';
$filter_paramurl[$i] = '&product_type_'.$product_type_id.'_'.$pti[$i]->parameter_name.'[]=';
$filterquery[$i] = " (FIND_IN_SET('".$value."',REPLACE(`".$pti[$i]->parameter_name."`,';',','))) AND ";
} else {
$filterurl[$i] = '&product_type_'.$product_type_id.'_'.$pti[$i]->parameter_name.'_comp=texteq';
$filter_paramurl[$i] = '&product_type_'.$product_type_id.'_'.$pti[$i]->parameter_name.'=';
$filterquery[$i] = " (`".$pti[$i]->parameter_name."`= '".$value."') AND ";
}
if ($filter[$i] !=NULL) {
if (!is_array($filter[$i])){
$where.=str_replace($value,$filter[$i],$filterquery[$i]);
}
else{
foreach ($filter[$i] as $filtervalue){
$where.=str_replace($value,$filtervalue,$filterquery[$i]);}
}
}
}
}
if (!empty($product_type_id) && count($pti[0]) > 0) {
$where .= '(`#__{vm}_product`.`product_publish` = "Y" AND `#__{vm}_product`.`product_id` = `#__{vm}_product_category_xref`.`product_id`) '.
'AND (`#__{vm}_product_category_xref`.`product_id` = `#__{vm}_product_type_'.$product_type_id.'`.`product_id`)';
if ($category_id){
$categories = ps_product_category::get_child_list($category_id); //Hack to include subcategory
$cats = array($category_id);
foreach ($categories as $cat)
{
$cats[] = $cat['category_id'];
}
$where .= " AND (`#__{vm}_product_category_xref`.`category_id` IN ( " . implode(', ', $cats).'))';
unset ($categories, $cats);
}
$q = 'SELECT DISTINCT `#__{vm}_product_type_'.$product_type_id.'`.`product_id`, `category_id` '.
'FROM `#__{vm}_product_type_'.$product_type_id.'`, `#__{vm}_product`, `#__{vm}_product_category_xref`, `#__{vm}_product_product_type_xref`, `#__{vm}_product_type` '.
'WHERE ('.$where.')';
if (!$show_pt_publish) {
$q .= ' AND (`#__{vm}_product_product_type_xref`.`product_type_id` = `#__{vm}_product_type`.`product_type_id` AND `#__{vm}_product_type`.`product_type_publish` = "Y" )';
}
if ( CHECK_STOCK && PSHOP_SHOW_OUT_OF_STOCK_PRODUCTS != "1" ) {
$q .= ' AND `#__{vm}_product`.`product_in_stock` > 0';
}
//$db->setQuery($q);
//$res = $db->loadObjectList();
//$count = count($res);
$productsfound = '';
$productsfound = count($res);
//$productsfound=$totalproductcount;
$baseurl =& JURI::getInstance()->toString();//'index.php?option=com_virtuemart&page=shop.browse&Itemid='.$Itemid.'&category_id='.$category_id;
$baseurl.=strpbrk($baseurl, '?')? '':'?';//stupid way to add a query string
$doc =& JFactory::getDocument();
switch ( $theme ) {
case "1": $doc->addStyleSheet( 'modules/mod_vm_product_picker/css/amazon.css' ); break;
case "2": $doc->addStyleSheet( 'modules/mod_vm_product_picker/css/sakura.css' ); break;
case "3": $doc->addStyleSheet( 'modules/mod_vm_product_picker/css/bluenight.css' ); break;
}
// SHOW PRE-TEXT
if ( $type_of_pretext == 2 ) {
echo '<div class="cherry_pretext">'.$static_pretext .'</div>';
}
elseif ( $type_of_pretext == 1 ) {
if (!empty($category_id)) {
$q = "SELECT `category_name` FROM `#__{vm}_category` WHERE `category_id` = $category_id";
$db->query($q);
echo '<div class="cherry_pretext">'.$dynamic_pretext.' '. '<span class="pretext_dynamic">'.$db->f("category_name"). '</span></div>';
}
else { // if no category_id then show STATIC PRE-TEXT
echo '<div class="cherry_pretext">'.$static_pretext.'</div>';
}
}
else {}
?>
<div id="leftNav">
<div id="leftNavContainer">
<?php // display parameter label on top
for ($y=0;$y<=$pticounts;$y++){
if (!$pti[$y]->product_type_id){break;}
echo '<h2>'. $pti[$y]->parameter_label .'</h2>';
echo '<ul>';
$requestfilter=array();//Setting value to substitute the filter[] array, prevent looping again in the foreach loop
if ($filter[$y]){
if (!is_array($filter[$y])){
$requestfilter[0]=$filter[$y];
}else{
foreach ($filter[$y] as $filterfield){$requestfilter[]=$filterfield;}
}
}
$fields = explode( ";", $pti[$y]->parameter_values );
foreach ($fields as $field) {
$q = "SELECT DISTINCT `#__{vm}_product_type_$product_type_id`.`product_id`
FROM `#__{vm}_product_type_$product_type_id`, `#__{vm}_product`, `#__{vm}_product_category_xref` ";
if ($pti[$y]->parameter_type != "V" && $pti[$y]->parameter_multiselect == "Y") {
$tempstr = $pti[$y]->parameter_name;
$q .= "WHERE `$tempstr` = '$field' ";
}
elseif ($pti[$y]->parameter_type == "V" && $pti[$y]->parameter_multiselect != "Y") {
$tempstr = $pti[$y]->parameter_name;
$q .= "WHERE FIND_IN_SET('$field',REPLACE(`$tempstr`,';',',')) ";
}
elseif ($pti[$y]->parameter_type == "V" && $pti[$y]->parameter_multiselect == "Y") {
$tempstr = $pti[$y]->parameter_name;
$q .= "WHERE FIND_IN_SET('$field',REPLACE(`$tempstr`,';',',')) ";
}
else {
$tempstr = $pti[$y]->parameter_name;
$q .= "WHERE `$tempstr` = '$field' ";
}
$q .= 'AND ('.$where.')';
if( CHECK_STOCK && PSHOP_SHOW_OUT_OF_STOCK_PRODUCTS != "1") {
$q .= ' AND `#__{vm}_product`.`product_in_stock` > 0';
}
$db->setQuery($q);
$count = count($db->loadObjectList());
// FORM THE URLs
$url = '';
$url .= $filterurl[$y].$filter_paramurl[$y].$field;
$url = $baseurl.'&product_type_id='.$product_type_id.''.$url;
if ($showfieldcount) {
if ( $count != 0 ) {
if (in_array($field, $requestfilter)){//if the value is in URL, show a 'X' next to the value
echo '<li style="margin-left: 14px;"> ' .$field.''.$pti[$y]->parameter_unit .' <sup><a href="'.str_replace($filterurl[$y].$filter_paramurl[$y].$field,'',$url).'">X</a></sup></li>';
}
else{
echo '<li style="margin-left: 14px;"> <a style="display:inline;" href="' .$url. '" > ' .$field.''.$pti[$y]->parameter_unit.'<span class="narrowValue"> ('. $count .') </span> </a> </li>';
}
}
} else {
if ( $count != 0 ) {
echo '<li style="margin-left: 14px;"> <a href="' .$url. '" > ' .$field.''.$pti[$y]->parameter_unit.' </a> </li>';
}
}
}
echo '</ul>';
}
//}
// SHOW TOTAL PRODUCTS FOUND
if ($show_totalproducts) {
echo '<li style="padding: 0px 0px 8px 5px;"><span class="totalproducts_pretxt">'.$pretext_totalproducts.'</span> <span class="totalproducts_qty">'.$productsfound.'</span> <span class="totalproducts_posttxt">'.$posttext_totalproducts.'</span></li>';
}
?>
</div>
</div>
<?php
} // if (!empty($product_type_id))
} // if ( !($page == 'shop.product_details' && !$displayonflypage) )
?>
Заранее всем спасибо.