checkFilterOrder($orderby); if ($orderby != $orderbyCfg) { $orderbyTxt = '&orderby=' . $orderby; } $manufacturerTxt = ''; $manufacturerLink = ''; if (VmConfig::get('show_manufacturers')) { $manuM = VmModel::getModel('manufacturer'); vmSetStartTime('mcaching'); $mlang = vmLanguage::getUseLangFallback(); if (TRUE) { $cache = VmConfig::getCache('com_virtuemart_orderby_manus', 'callback'); $cache->setCaching(TRUE); $manufacturers = $cache->get( array ('VirtueMartModelManufacturer', 'getManufacturersOfProductsInCategory'), array($virtuemart_category_id, VmConfig::$vmlang, $mlang) ); vmTime('Manufacturers by Cache', 'mcaching'); } else { $manufacturers = $manuM->getManufacturersOfProductsInCategory( $virtuemart_category_id, VmConfig::$vmlang, $mlang ); vmTime('Manufacturers by function', 'mcaching'); } // manufacturer link list $manufacturerLink = ''; $virtuemart_manufacturer_id = vRequest::getInt('virtuemart_manufacturer_id', 0); if (!empty($virtuemart_manufacturer_id)) { $manufacturerTxt = '&virtuemart_manufacturer_id=' . $virtuemart_manufacturer_id; } if (count($manufacturers) > 0) { if (count($manufacturers) > 1) { $manufacturerLink = ''; if ($virtuemart_manufacturer_id > 0) { $allLink = str_replace($manufacturerTxt, $fieldLink, ''); $allLink .= '&virtuemart_manufacturer_id=0'; $valueLink = JRoute::_($allLink . $orderbyTxt . $orderDirLink, FALSE); $manufacturerLink .= ''; } foreach ($manufacturers as $mf) { $l = str_replace( $manufacturerTxt, '', $fieldLink ) . '&virtuemart_manufacturer_id=' . $mf->virtuemart_manufacturer_id . $orderbyTxt . $orderDirLink ; $link = JRoute::_($l, FALSE); if ($mf->virtuemart_manufacturer_id != $virtuemart_manufacturer_id) { $manufacturerLink .= ''; } else { $manufacturerLink .= ''; $currentManufacturerLink = ''; } } } else if ($virtuemart_manufacturer_id > 0) { $currentManufacturerLink = ''; } else { $currentManufacturerLink = ''; } } } /* order by link list*/ $orderByLink = ''; $fields = VmConfig::get('browse_orderby_fields'); if (count($fields) > 1) { $orderByLink = ''; foreach ($fields as $field) { $dotps = strrpos($field, '.'); if ($dotps !== FALSE) { $prefix = substr($field, 0, $dotps + 1); $fieldWithoutPrefix = substr($field, $dotps + 1); } else { $prefix = ''; $fieldWithoutPrefix = $field; } $text = vmText::_( 'COM_VIRTUEMART_' . strtoupper( str_replace( array (',', ' '), array ('_', ''), $fieldWithoutPrefix ) ) ); $field = explode('.', $field); if (isset($field[1])) { $field = $field[1]; } else { $field = $field[0]; } $link = JRoute::_($fieldLink . $manufacturerTxt . '&orderby=' . $field, FALSE); // echeck whether this is the active one $orderby = vRequest::getString('orderby', $orderbyCfg); $orderby = $productModel->checkFilterOrder($orderby); $dotps = strrpos($orderby, ','); if ($dotps !== FALSE) { $prefix = substr($orderby, 0, $dotps + 1); $orderby = substr($orderby, $dotps + 1); } $selected = ($field == $orderby) ? ' selected' : ''; $orderByLink .= '' . $text . ''; } } // full string list if ($orderby == '') { $orderby = $orderbyCfg; } $orderby = strtoupper($orderby); $dotps = strrpos($orderby, '.'); if ($dotps !== FALSE) { $prefix = substr($orderby, 0, $dotps + 1); $orderby = substr($orderby, $dotps + 1); } else { $prefix = ''; } // $orderByList = '
'; $orderByList .= ''; $orderByList .= ''; $orderByList .= '
'; $manuList = ''; if (VmConfig::get('show_manufacturers') && count($manufacturers) > 0) { $manuList = '
'; $manuList .= ''; $manuList .= ''; $manuList .= '
'; } $orderbyLists = array ('orderby' => $orderByList, 'manufacturer' => $manuList); echo self::renderVmSubLayoutAsGrid( 'vm-grid-item', array ('order-by-lists' => $orderbyLists, 'options' => array ('items_per_row' => array ('xs' => 1, 'sm' => 2, 'md' => 2, 'lg' => 2, 'xl' => 2,), 'show_vertical_line' => TRUE,),) );