<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
mm_showMyFileName(__FILE__);
function getChildsList( $tree ){
global $sess;
$res = '';
if( $tree ){
$res .= '<ul>';
foreach( $tree as $stree ){
$res .= '<li>';
$link = $sess->url( URL . 'index.php?option=com_virtuemart&page=shop.browse&category_id='.$stree['category_id'] );
$res .= '<a title="'.$stree["category_name"].'" href="'.$link.'">'.$stree["category_name"].'</a>';
if( $stree[ 'child_list' ] ) $res .= getChildsList( $stree[ 'child_list' ] );
$res .= '</li>';
}
$res .= '</ul>';
}
return $res;
}
$iCol = 10;
$bCol = 0;
$categories_row=1; //Количество отделяемых строк
if( !isset( $categories_per_row )) {
$categories_per_row = 10;
}
$cellwidth = intval( 100 / $categories_per_row );
if( empty( $categories )) {
return; // Do nothing, if there are no child categories!
}
?>
<br/>
<table width="100%" cellspacing="0" cellpadding="0">
<?php
foreach( $categories as $category ) {
if ($iCol == 1) { // this is an indicator wether a row needs to be opened or not
echo "<tr>\n";
}
?>
<td align="left" width="<?php echo $cellwidth ?>%" >
<br />
<a title="<?php echo $category["category_name"] ?>" href="<?php $sess->purl(URL."index.php?option=com_virtuemart&page=shop.browse&category_id=".$category["category_id"])?>">
<?php
if ( $category["category_thumb_image"] ) {
echo ps_product::image_tag( $category["category_thumb_image"], "alt=\"".$category["category_name"]."\"", 0, "category");
echo "<br /><br/>\n";
}
echo $category["category_name"];
echo $category['number_of_products'];
?>
</a><br/>
<?php
if( $category['child_list'] ){
echo getChildsList( $category['child_list'] );
}
?>
</td>
<?php
// Do we need to close the current row now?
if ($iCol == $categories_per_row) { // If the number of products per row has been reached
echo "</tr>\n";
$iCol = 1;
$bCol++;
}
else {
$iCol++;
}
if ($bCol == $categories_row) { // If the number of products per row has been reached
echo "<tr><td colspan=".$categories_per_row."><hr/></td></tr>\n"; //Вставляем разделитель
}
}
// Do we need a final closing row tag?
if ($iCol != 1) {
echo "</tr>\n";
}
?>
</table>
<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
/**
*
* @version $Id: shop.index.php 2409 2010-05-20 20:05:30Z soeren $
* @package VirtueMart
* @subpackage html
* @copyright Copyright (C) 2004-2007 soeren - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
require_once( CLASSPATH . 'ps_product.php');
require_once( CLASSPATH . 'ps_product_category.php');
$ps_product_category = new ps_product_category();
$ps_product = new ps_product();
// Show only top level categories and categories that are
// being published
$tpl = new $GLOBALS['VM_THEMECLASS']();
$category_childs = $ps_product_category->get_child_list(0);
function getSubCatergoryChildsList( $clist, $catid ){
$res_list = array();
foreach( $clist as $c_catid => $val ){
if( $val['category_parent_id'] == $catid ) $res_list[] = array('category_name'=>$val['category_name'],'category_id'=>$c_catid,'child_list'=>getSubCatergoryChildsList( $clist, $c_catid ));
}
return $res_list;
}
$cat_tree_array = $ps_product_category->getCategoryTreeArray();
for( $i=0; $i<count($category_childs); $i++ ){
$category_childs[$i]['child_list'] = getSubCatergoryChildsList( $cat_tree_array, $category_childs[$i]['category_id'] );
}
$tpl->set( 'categories', $category_childs );
//echo $vendor_store_desc;
$categories = $tpl->fetch( 'common/categoryChildlist.tpl.php');
$tpl->set( 'vendor_store_desc', $vendor_store_desc );
$tpl->set( 'categories', $categories );
$tpl->set('ps_product',$ps_product);
$tpl->set('recent_products',$ps_product->recentProducts(null,$tpl->get_cfg('showRecent', 5)));
if( file_exists( CLASSPATH.'payment/ps_paypal_api.php') ) {
require_once( CLASSPATH.'payment/ps_paypal_api.php');
if( ps_paypal_api::getPaymentMethodId() && ps_paypal_api::isActive() ) {
// PayPal API / Express
$lang = jfactory::getLanguage();
$lang_iso = str_replace( '-', '_', $lang->gettag() );
$paypal_buttonurls = array('en_US' => 'https://www.paypal.com/en_US/i/logo/PayPal_mark_60x38.gif',
'en_GB' => 'https://www.paypal.com/en_GB/i/bnr/horizontal_solution_PP.gif',
'de_DE' => 'https://www.paypal.com/de_DE/DE/i/logo/lockbox_150x47.gif',
'es_ES' => 'https://www.paypalobjects.com/WEBSCR-600-20100105-1/en_US/FR/i/bnr/bnr_horizontal_solution_PP_327wx80h.gif',
'pl_PL' => 'https://www.paypalobjects.com/WEBSCR-600-20100105-1/en_US/FR/i/bnr/bnr_horizontal_solution_PP_327wx80h.gif',
'nl_NL' => 'https://www.paypalobjects.com/WEBSCR-600-20100105-1/en_US/FR/i/bnr/bnr_horizontal_solution_PP_327wx80h.gif',
'fr_FR' => 'https://www.paypalobjects.com/WEBSCR-600-20100105-1/en_US/FR/i/bnr/bnr_horizontal_solution_PP_327wx80h.gif',
'it_IT' => 'https://www.paypalobjects.com/WEBSCR-600-20100105-1/it_IT/IT/i/bnr/bnr_horizontal_solution_PP_178wx80h.gif',
'zn_CN' => 'https://www.paypalobjects.com/WEBSCR-600-20100105-1/en_US/FR/i/bnr/bnr_horizontal_solution_PP_327wx80h.gif' );
$paypal_infolink = array('en_US' => 'https://www.paypal.com/us/cgi-bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-outside',
'en_GB' => 'https://www.paypal.com/uk/cgi-bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-outside',
'de_DE' => 'https://www.paypal.com/de/cgi-bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-outside',
'es_ES' => 'https://www.paypal.com/es/cgi-bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-outside',
'pl_PL' => 'https://www.paypal.com/pl/cgi-bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-outside',
'nl_NL' => 'https://www.paypal.com/nl/cgi-bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-outside',
'fr_FR' => 'https://www.paypal.com/fr/cgi-bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-outside',
'it_IT' => 'https://www.paypal.com/it/cgi-bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-outside',
'zn_CN' => 'https://www.paypal.com/cn/cgi-bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-outside' );
if( !isset( $paypal_buttonurls[$lang_iso])) {
$lang_iso = 'en_US';
}
$html = '<img id="paypalLogo" src="'.$paypal_buttonurls[$lang_iso].'" alt="PayPal Checkout Available" border="0" style="cursor:pointer;" /></a>';
$html .= '<script type="text/javascript">window.addEvent("domready", function() {
$("paypalLogo").addEvent("click", function() {
window.open(\''.$paypal_infolink[$lang_iso].'\',\'olcwhatispaypal\',\'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=500\');
});
});
</script>';
$tpl->set('paypalLogo', $html);
}
}
echo $tpl->fetch( 'common/shopIndex.tpl.php');
?>
сайт ekbt.ru не выводит данный хак подкатегории tsesl я тебе написал в личку пасмотри а а то уже 2 недели бьюсь и толку не добьюсь))))