Всем привет. Вот решил поделиться своими трудами. А именно, возможностью распечатывать корзину клиента. Удобно тем магазинам у кого есть офис для совершения прямых продаж.
Выглядит это так.
Наши действия)
1. Копируем файл
templates/main/headernew.html
2. Вносим следующие правки в файл, между <head> </head>, вставляем следующее:
PHP код:
<style media='print' type='text/css'>
.noprint {display: none;}
a {text-decoration: underline; color:#00F;}
}
</style>
Пример
PHP код:
<head>
<style media='print' type='text/css'>
.noprint {display: none;}
a {text-decoration: underline; color:#00F;}
}
</style>
....
</head>
Далее нам нужно ограничить вывод ненужной нам информации при печати, для этого обрамляем все не нужное следующим тегом
PHP код:
<span class="noprint">
...
</span>
Все это делается в
headernew
Пример
PHP код:
<!DOCTYPE HTML>
<!--[if IE 7 ]><html lang="ru-RU" class="ie7 ie no-js"><![endif]-->
<!--[if IE 8 ]><html lang="ru-RU" class="ie8 ie no-js"><![endif]-->
<!--[if IE 9 ]><html lang="ru-RU" class="ie9 ie no-js"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html lang="ru-RU" class="no-js"><!--<![endif]-->
<head>
<!-- вставляем стиль для печати -->
<style media='print' type='text/css'>
.noprint {display: none;}
a {text-decoration: underline; color:#00F;}
}
</style>
<!-- Вставили -->
<!-- Убираем не нужно при печати -->
<span class="noprint">
<? if(in_array('Seo2', General::$enabledFeatures)){?>
<base href="<?=defined('CFG_BASE_HREF')?CFG_BASE_HREF:'http://'.$_SERVER['HTTP_HOST']?>" />
<?} ?>
<? print (General::getSiteConfig('meta_tags')) ? General::getSiteConfig('meta_tags') : ''; ?>
<? if(SCRIPT_NAME == 'index'){ ?>
<title><? print (General::getSiteConfig('title_for_home')) ? General::getSiteConfig('title_for_home') : (CFG_SITE_NAME . ' - ' . Lang::get('home')); ?></title>
<meta name="description" content="<? print (General::getSiteConfig('description_for_home')) ? General::getSiteConfig('description_for_home') : $GLOBALS['page']['seo_description']; ?>" />
<meta name="keywords" content="<? print (General::getSiteConfig('keywords_for_home')) ? General::getSiteConfig('keywords_for_home') : $GLOBALS['page']['seo_keywords']; ?>" />
<? } elseif(@$GLOBALS['page']){ ?>
<title><? print (General::getSiteConfig('site_name')) ? General::getSiteConfig('site_name') : CFG_SITE_NAME; ?> - <?=$GLOBALS['page']['pagetitle']?></title>
<meta name="description" content="<?=$GLOBALS['page']['seo_description']?>" />
<meta name="keywords" content="<?=$GLOBALS['page']['seo_keywords']?>" />
<? } elseif(@$GLOBALS['category']) { ?>
<title><?
$prefix = @General::$siteConf['category_prefix'];
$suffix = @General::$siteConf['category_suffix'];
if(@$GLOBALS['category']['seo_title'])
list($prefix, $suffix) = explode('||', $GLOBALS['category']['seo_title']);
elseif(General::getSiteConfig('site_name'))
$prefix = @General::getSiteConfig('site_name');
print $prefix; ?> <?=@$GLOBALS['category']['pagetitle']?@$GLOBALS['category']['pagetitle']:@$GLOBALS['pagetitle']?> <?=$suffix?></title>
<meta name="description" content="<?=@$GLOBALS['category']['seo_description']?$GLOBALS['category']['seo_description']:@$GLOBALS['pagetitle']?>" />
<meta name="keywords" content="<?=@$GLOBALS['category']['seo_keywords']?$GLOBALS['category']['seo_keywords']:@$GLOBALS['pagetitle']?>" />
<? } elseif(@$_GET['cid']) {
$prefix = @General::$siteConf['category_prefix'];
$suffix = @General::$siteConf['category_suffix'];
?>
<title><?=$prefix?> <?=$GLOBALS['pagetitle']?> <?=$suffix?></title>
<meta name="description" content="<?=@$GLOBALS['pagetitle']?>" />
<meta name="keywords" content="<?=@$GLOBALS['pagetitle']?>" />
<? } elseif(@$_GET['p']=='news' || @$_GET['p']=='allnews') { ?>
<title><? print (General::getSiteConfig('site_name')) ? General::getSiteConfig('site_name') : CFG_SITE_NAME; ?> - <?=Lang::get('news')?></title>
<? } else { ?>
<title><? print (General::getSiteConfig('site_name')) ? General::getSiteConfig('site_name') : CFG_SITE_NAME; ?> <? if(@$GLOBALS['pagetitle']){ ?> - <?=$GLOBALS['pagetitle']?> <? } ?></title>
<meta name="description" content="<?=@$GLOBALS['pagetitle']?>" />
<meta name="keywords" content="<?=@$GLOBALS['pagetitle']?>" />
<? } ?>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<link rel="stylesheet" href="css/style.css" />
<?if(file_exists(CFG_APP_ROOT.'/css/custom.css')){?>
<link rel="stylesheet" href="css/custom.css"/>
<?}?>
<script src="js/jquery-1.8.2.min.js"></script>
<script src="js/jquery-ui.min.js"></script>
<link type="text/css" href="css/redmond/jquery-ui-1.8.18.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/general.js"></script>
<? if(SCRIPT_NAME == 'basket' || SCRIPT_NAME == 'userorder'){ ?>
<script type="text/javascript" src="js/cart.js"></script>
<? } ?>
<? if(SCRIPT_NAME == 'supportlist'){ ?>
<script type="text/javascript" src="js/favourites.js"></script>
<? } ?>
<? if(SCRIPT_NAME != 'index'){ ?>
<script type="text/javascript" src="js/inner.js"></script>
<link rel="stylesheet" href="css/inner.css" type="text/css" />
<? } ?>
<? if(SCRIPT_NAME == 'index'){ ?>
<!--Social-->
<script src="js/main.js"></script>
<script type="text/javascript" src="js/coin-slider.js"></script>
<link rel="stylesheet" href="js/coin-slider-styles.css" type="text/css" />
<? } ?>
<? if (isset($userdata_ajax)) { ?>
<script>
$(function(){
url_gen_privateoffice = "<?=@UrlGenerator::generateContentUrl('privateoffice')?>";
lang_privateoffice = "<?=Lang::get('private_office')?>";
url_gen_profile = "<?=@UrlGenerator::generateContentUrl('profile')?>";
url_gen_logout = "<?=@UrlGenerator::generateContentUrl('logout')?>";
lang_logout = "<?=Lang::get('logout')?>";
url_gen_login = "<?=@UrlGenerator::generateContentUrl('login')?>";
lang_login = "<?=Lang::get('login')?>";
url_gen_register = "<?=@UrlGenerator::generateContentUrl('register')?>";
lang_register = "<?=Lang::get('registration')?>";
$("#usermenu_ajax").prepend('<li id="loading_userdat"><img src="/css/i/ajax-loader.gif" width="16" height="16" /></li>');
$.ajax({
url: "index.php?p=users_ajax&userdata_ajax=1",
cache: false,
dataType : "json",
success: function(json){
$("#fav_ajax").html(json.favourites[0]);
$("#basket_ajax").html(json.basket[0]);
$("#loading_userdat").hide();
if (json.IsAuthenticated) {
$("#usermenu_ajax").prepend('<li><a href=' + url_gen_privateoffice +'>' + lang_privateoffice + '</a></li><li><a href='+ url_gen_profile +'>' + json.username + '</a></li><li><a href='+ url_gen_logout +'>'+ lang_logout +'</a></li>');
//$("#usermenu_ajax").prepend('Вошел');
} else {
$("#usermenu_ajax").prepend('<li><a href='+ url_gen_login +'>'+ lang_login +'</a></li><li><a href='+ url_gen_register +'>'+ lang_register +'</a></li>');
//$("#usermenu_ajax").prepend('Надо зайти');
}
}
});
});
</script>
<? } ?>
<script src="js/jquery.jqzoom-core.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/jquery.jqzoom.css" type="text/css">
<style type"text/css">
body{margin:0px;padding:0px;font-family:Arial;}
a img,:link img,:visited img { border: none; }
table { border-collapse: collapse; border-spacing: 0; }
:focus { outline: none; }
*{margin:0;padding:0;}
p, blockquote, dd, dt{margin:0 0 8px 0;line-height:1.5em;}
fieldset {padding:0px;padding-left:7px;padding-right:7px;padding-bottom:7px;}
fieldset legend{margin-left:15px;padding-left:3px;padding-right:3px;color:#333;}
dl dd{margin:0px;}
dl dt{}
.clearfix:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden;}
.clearfix{display:block;zoom:1}
ul#thumblist{display:block;}
ul#thumblist li{float:left;margin-right:2px;list-style:none;}
ul#thumblist li a{display:block;border:1px solid #CCC;}
ul#thumblist li a.zoomThumbActive{
border:1px solid red;
}
.jqzoom{
text-decoration:none;
float:left;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
$('.jqzoom').jqzoom({
zoomType: 'innerzoom',
preloadImages: false,
alwaysOn:false
});
});
</script>
</head>
<body>
<form action="index.php?p=setlang" method="post">
<input type="hidden" name="lang" id="lang" />
<input type="hidden" name="from" value="<?=$_SERVER['REQUEST_URI']?>" />
</form>
<div id="error-dialog" style="display: none"></div>
<div class="header">
<? if (strpos($_SERVER['HTTP_HOST'], 'taobao') !== false) { ?>
<div class="wrap clrfix mb20">
<strong style="color:red; font-size:18px; padding-left:30px;"><?=Lang::get('warning_taobao')?></strong>
</div>
<? } ?>
<div class="wrap clrfix">
<?=Plugins::invokeEvent('GetGeoLocate',array('localip'=>$_SERVER['REMOTE_ADDR'])) ?>
<div class="col col240 mr30">
<a href="index.php" class="logo">
<img src="<? print (General::getSiteConfig('logo')) ? General::getSiteConfig('logo') : 'i/logo.png'; ?>" alt="<? print (General::getSiteConfig('title_for_home')) ? General::getSiteConfig('title_for_home') : (CFG_SITE_NAME . ' - ' . Lang::get('home')); ?>" title="<? print (General::getSiteConfig('title_for_home')) ? General::getSiteConfig('title_for_home') : (CFG_SITE_NAME . ' - ' . Lang::get('home')); ?>" />
</a>
</div>
<div class="col col690">
<ul class="hblocks">
<li class="name">
<?=Lang::get('header_text')?>
<? if(defined('CFG_USE_CLOCK') && CFG_USE_CLOCK){ ?>
<br />
<a href="http://time.is/China" id="time_is_link" style="font-size:15px">Время в Китае:</a>
<span id="China_z40f" style="font-size:15px"></span>
<script src="http://widget.time.is/t.js"></script>
<script>
time_is_widget.init({China_z40f:{}});
</script>
<? } ?>
</li>
<li class="phone mr20">
<div class="bgr">
<strong><?=@General::$siteConf['phone']?></strong>
<? if (!@General::$siteConf['hide_work_shedule']) { ?><?=Lang::get('work_shedule')?><? } ?>
</div>
</li>
<? if(!@General::$siteConf['hide_operator']){ ?>
<li class="operator">
<img src="/p/ws.png" />
</li>
<? } ?>
<? if(General::$siteConf['online_chat_code']){ ?>
<li>
<div class="wrap clrfix">
<?=General::$siteConf['online_chat_code']?>
</div>
</li>
<? } ?>
</ul>
</div>
</div>
</div>
<div class="spacer"><div class="wrap clrfix"></div></div>
<div class="navigation"><div class="wrap clrfix">
<ul class="fll menu">
<? if($menu) { ?>
<li><a href="/" <? if(!@$_GET['p']){ ?> class="active" <? } ?>><?=Lang::get('home')?></a></li>
<? foreach($menu as $m){ ?>
<li><a href="<?=@UrlGenerator::generateContentUrl($m['alias'])?>" <? if(@$_GET['p'] == $m['alias']){ ?> class="active" <? } ?>><?=$m['title']?></a></li>
<? } ?>
<? } else { ?>
<li><a href="/" <? if(!@$_GET['p']){ ?> class="active" <? } ?>><?=Lang::get('home')?></a></li>
<li><a href="delivery"><?=Lang::get('delivery')?></a></li>
<li><a href="optovikam">Оптовикам</a></li>
<li><a href="otzivi">Отзывы о сайте</a></li>
<? } ?>
<?if (CMS::IsFeatureEnabled('ProductComments')):?>
<li><a href="<?=@UrlGenerator::generateContentUrl('reviews')?>" <? if(@$_GET['p'] == 'reviews'){ ?> class="active" <? } ?>><?=Lang::get('reviews')?></a></li>
<?endif;?>
<li><a href="help">Помощь</a></li>
</ul>
<form id="login_register">
<input type="hidden" name="from" value="<?=$_SERVER['REQUEST_URI']?>" />
</form>
<ul class="flr sblocks" id="usermenu_ajax">
<? if (!isset($userdata_ajax)) { ?>
<? if(!$IsAuthenticated){ ?>
<li><a href="<?=@UrlGenerator::generateContentUrl('login')?>"><?=Lang::get('login')?></a></li>
<li><a href="<?=@UrlGenerator::generateContentUrl('register')?>"><?=Lang::get('registration')?></a></li>
<? } else { ?>
<li><a href="<?=@UrlGenerator::generateContentUrl('privateoffice')?>"><?=Lang::get('private_office')?></a></li>
<li><a href="<?=@UrlGenerator::generateContentUrl('profile')?>"><?=$_SESSION[CFG_SITE_NAME.'loginUserData']['username']?></a></li>
<!-- <li><?=$deposit?></li> -->
<li><a href="<?=@UrlGenerator::generateContentUrl('logout')?>"><?=Lang::get('logout')?></a></li>
<? } ?>
<? } else { ?>
<? } ?>
<? if($langs && count($langs)>1){ ?>
<li>
<a href="#" class="lang arrow"><span><i class="<?=@$_SESSION['active_lang']?>"><?=Lang::get('lang_name')?></i></span></a>
<ul class="menu-lang">
<? foreach($langs as $l){ ?>
<li><a href="#" class="lang"><i class="<?=$l['name']?>"></i></a></li>
<? } ?>
</ul>
</li>
<? } ?>
</ul>
</div></div>
<div class="userbar"><div class="wrap clrfix">
<ul class="uluserbar">
<li class="col col255 cats itemmenu">
<a href="#" onClick="return false" class="category <? if(SCRIPT_NAME=='index'){ ?>active<? } ?>"><span><?=Lang::get('by_categories')?></span><i></i></a>
<a href="<?=General::generateUrl('brands', 0 )?>" class="brand"><span><?=Lang::get('by_brands')?></span></a>
</li>
<li class="col col435 itemmenu">
<form action="<?=@UrlGenerator::generateSearchUrl()?>" method="get" class="search">
<div class="field">
<div class="in search-floating">
<a href="#" class="selection allplace"><span><?=Lang::get('everywhere')?></span></a>
<input type="text" name="search" value="<?=htmlspecialchars(stripslashes(@$_GET['search']))?>" placeholder="<?=Lang::get('default_search_text')?>">
<input type="hidden" name="brand" value="<?=@$_GET['brand']?>">
<input type="hidden" name="cid" value="">
<?if(!in_array('Seo2', General::$enabledFeatures)){?>
<input type="hidden" name="p" value="search">
<? } ?>
</div>
<div class="dropdown dropdown-search" id="searchcatsajax"><?=$SearchCategories?></div>
</div>
<a href="#" id="search-submit" class="btn fll"><?=Lang::get('find')?></a>
</form>
</li>
<? if (!isset($userdata_ajax)) { ?>
<li class="col col150 itemmenu">
<a href="<?=@UrlGenerator::generateContentUrl('supportlist')?>" class="mydata favorites"><i class="i rounder"><?=$favourites?></i><?=Lang::get('favourites')?></a>
</li>
<li class="col col120 itemmenu">
<a href="<?=@UrlGenerator::generateContentUrl('basket')?>" class="mydata basket"><i class="i rounder"><?=$basket?></i> <?= Lang::get('cart') ?></a>
</li>
<? } else { ?>
<li class="col col150 itemmenu">
<a href="<?=@UrlGenerator::generateContentUrl('supportlist')?>" class="mydata favorites"><i class="i rounder" id="fav_ajax"> </i><?=Lang::get('favourites')?></a>
</li>
<li class="col col120 itemmenu">
<a href="<?=@UrlGenerator::generateContentUrl('basket')?>" class="mydata basket"><i class="i rounder" id="basket_ajax"> </i> <?= Lang::get('cart') ?></a>
</li>
<? } ?>
</ul>
<? if(SCRIPT_NAME!='index'){ ?>
<div class="dropdown dropdown-inner">
<div class="pda10" style="border-bottom: 1px solid #E6E6E6;">
<a href="<?=General::generateUrl('allcats', array() )?>" class="all"><i class="i arrowright"></i><span><?=Lang::get('all_categories')?></span></a>
</div>
<?=$MenuShortNew?>
<div class="pda10">
<a href="<?=General::generateUrl('allcats', array() )?>" class="all"><i class="i arrowright"></i><span><?=Lang::get('all_categories')?></span></a>
</div>
</div>
<? } ?>
</div></div>
</span>
[COLOR="Lime"]<!-- Убрали -->[/COLOR]
Вот вроде и все. Ах да не забываем все это сохранить по адресу
templatescustom/main
Вот вроде бы и все. Жду мнений по поводу этого.
Скажу сразу я не программер и вообще ничего не знаю о программировании, я все делаю сам, поэтому если где ошибки в коде, уж простите о великие)))
Всем адекватным, спасибо за поддержку. Спасибо нашей группе в чате "Доработка ОТ"
Кстати это все выглядит так
Как вы видите ничего лишнего)))
Всем мир

С/у Данияр