<script>
var total;
total = '[[ cart.total || 0 ]]';
if (total > 1000) {
alert('щшывапвзыфапхзывапвыап');
}
</script>
тоже не катит
<script>
var total;
total = '[[ cart.total || 0 ]]';
if (total > 1000) {
alert('щшывапвзыфапхзывапвыап');
}
</script>
тоже не катит
# Jane (16.12.2016 / 23:09)да
Scorpion, тотал уже обновляется на странице без перезагрузки
Если это [[ cart.total || 0 ]] поставить в любом месте html коде, выводится сумма (именно это и нужно для сравнения с 1000)
В js скрипте код [[ cart.total || 0 ]] ничего не показывает (или показывает как текст)
# Scorpion (16.12.2016 / 23:21)я писала, что в js скрипте нужно это значение вытаскивать как innerText того элемента, где он лежит, но в твоем движке наверняка есть цивилизованные методы
<script>
var total;
total = '[[ cart.total || 0 ]]';
if (total > 1000) {
alert('щшывапвзыфапхзывапвыап');
}
</
Jane, где-то нашел это
$scope.calculateCart = function()
{
var count = 0;
var total = 0;
var totalNoDiscount = 0;
var positions = [];
angular.forEach($scope.limits, function(lim, key) {
lim.qnt = 0;
});
angular.forEach($scope.sections, function(section, key) {
angular.forEach(section.positions, function( item, key) {
if(item.quantity > 0)
{
count += item.quantity*1;
var price = item.quantity * item.price;
totalNoDiscount += price;
if(item.is_discount == 1 && $scope.cart.discount)
price = (price - price * $scope.cart.discount.value / 100);
if(item.type == 1)
$scope.cart.bonus_id = item.id;
item.price_discount = price;
total += price.toFixed(2) * 1;
angular.forEach($scope.limits, function(lim, key) {
if(lim.ids.indexOf(item.id*1) != -1)
lim.qnt += item.quantity*1;
});
}
});
});
$scope.checkLimits();
$scope.cart.count = count;
$scope.cart.total = total;
$scope.cart.totalNoDiscount = totalNoDiscount;
}
# Scorpion (16.12.2016 / 23:35)ну тогда в шаблоне на элементе, где этот cart.total попробуй навесить:
Jane, где-то нашел это
$scope.calculateCart = function()
{
var count = 0;
var total = 0;
var totalNoDiscount = 0;
var positions = [];
angular.forEach($scope.limits, function(l
Jane, Спасииибооо, получилось :-* :-* :-* :-*
# Scorpion (17.12.2016 / 18:13)сразу б сказал, что angular
Jane, Спасииибооо, получилось :-* :-* :-* :-*
Помогите сделать что бы блоки ссылок равномерно занимали всю ширину страницы не зависимо от ширины экрана (растягивались или сжимались) с отступами от края страницы и между блоками в 2 рх.
Вот код цсс
#wrapper {
width:100%;
height:50px;
background:#EFEFEF;
margin-right:2px;
}
.section {
border:solid 1px #999;
float:left;
height:50px;
margin-left:2px;
width:32%;
}
#wrapper div:first-child {
margin-left:2px;
}echo '<div id="wrapper">
<div class="section"><a href="news/index.php">' . $lng['news_archive'] . '</a> (' . $mp->newscount . ')</div>
<div class="section"><a href="pages/faq.php">' . $lng['information'] . ', FAQ</a></div>
<div class="section"><a href="library/">' . $lng['library'] . '</a> (' . counters::library() . ')</div>
</div>';#wrapper {
width:100%;
height:50px;
background:#EFEFEF;
box-sizing: border-box;
text-align: center;
}
.section {
text-align: left;
border:solid 1px #999;
height:50px;
width:33%;
padding: 5px 3px;
box-sizing: border-box;
display: inline-block;
}