$(document).ready(function() {
setBallsSize();
});
$(window).resize(function() {
setBallsSize();
})
function setBallsSize() {
setTimeout(function () {
var ballWidth = $('.ball_row1 .ball_image').width();
$('.ball_row2 img').each(function() {
$(this).css('width', ballWidth);
});
}, 200);
}
catalog/controller/account/register.php
if (isset($this->request->post['password'])) {
$data['password'] = $this->request->post['password'];
} else {
$data['password'] = '';
}
$data['password'] = вами сгенерированный пароль
catalog\controller\account
public function index() {
$this->response->redirect($this->url->link('account/edit', '', true));
list($first_cat, $second_cat) = array_chunk($categories, ceil(count($categories)/2));
$(document).on("click", ".stepper button", function () {
var c = $(this),
b = c.closest(".stepper").find("input").val().trim(),
a = 1;
if (c.attr("spinner-button") == "up") {
a = parseInt(b) + 1
Повешайте вот тут c.prop("disabled", false); на минусовую кнопку
} else {
if (b > 1) {
a = parseInt(b) - 1
} else {
c.prop("disabled", true);
return false
}
}
c.closest(".stepper").find("input").val(a)
});
if ($svoya_verstka) {
$this->response->setOutput($this->load->view('information/information_empty', $data)); // наш файл шаблона
} else {
$this->response->setOutput($this->load->view('information/information', $data));
}
<?php echo $description; ?>
document.querySelectorAll('ul')
.forEach(el => el.classList.toggle('show'));
const btnn = document.querySelector('#btnn');
btnn.addEventListener('click', () => {
[...document.querySelectorAll('ul')]
.forEach(el => el.classList.toggle('show'));
ul.classList.toggle('show');
btnn.classList.toggle('show');
});
$data['categories'] = array();
$categories = $this->model_catalog_category->getCategories(0);
foreach ($categories as $category) {
$children_data = array();
$children = $this->model_catalog_category->getCategories($category['category_id']);
foreach ($children as $child) {
$children2_data = array();
$children2 = $this->model_catalog_category->getCategories($child['category_id']);
foreach ($children2 as $child2) {
$children3_data = array();
$children3 = $this->model_catalog_category->getCategories($child2['category_id']);
foreach ($children3 as $child3) {
$filter_data3 = array(
'filter_category_id' => $child3['category_id'],
);
$children3_data[] = array(
'category_id' => $child3['category_id'],
'name' => $child3['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data3) . ')' : ''),
'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']. '_' . $child2['category_id']. '_' . $child3['category_id'])
);
}
$filter_data2 = array(
'filter_category_id' => $child2['category_id'],
);
$children2_data[] = array(
'category_id' => $child2['category_id'],
'name' => $child2['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data2) . ')' : ''),
'children3' => $children3_data,
'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']. '_' . $child2['category_id'])
);
}
$filter_data1 = array(
'filter_category_id' => $child['category_id'],
);
$children_data[] = array(
'category_id' => $child['category_id'],
'name' => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data1) . ')' : ''),
'children2' => $children2_data,
'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'])
);
}
$filter_data = array(
'filter_category_id' => $category['category_id'],
);
$data['categories'][] = array(
'category_id' => $category['category_id'],
'name' => $category['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''),
'children' => $children_data,
'href' => $this->url->link('product/category', 'path=' . $category['category_id'])
);
}
<div class="list-group">
<?php foreach ($categories as $category) { ?>
<?php if ($category['category_id'] == $category_id) { ?>
<a href="<?php echo $category['href']; ?>" class="list-group-item active"><?php echo $category['name']; ?></a>
<?php } else { ?>
<a href="<?php echo $category['href']; ?>" class="list-group-item"><?php echo $category['name']; ?></a>
<?php } ?>
<?php if (($category['children']) && ($category['category_id'] == $category_id)) { ?>
<?php foreach ($category['children'] as $child) { ?>
<?php if ($child['category_id'] == $child_id) { ?>
<a href="<?php echo $child['href']; ?>" class="list-group-item active"> - <?php echo $child['name']; ?></a>
<?php } else { ?>
<a href="<?php echo $child['href']; ?>" class="list-group-item"> - <?php echo $child['name']; ?></a>
<?php } ?>
<?php if (($child['children2']) && ($category['category_id'] == $category_id)) { ?>
<?php foreach ($child['children2'] as $child2) { ?>
<?php if ($child2['category_id'] == $child_id2) { ?>
<a href="<?php echo $child2['href']; ?>" class="list-group-item active"> - <?php echo $child2['name']; ?></a>
<?php } else { ?>
<a href="<?php echo $child2['href']; ?>" class="list-group-item"> - <?php echo $child2['name']; ?></a>
<?php } ?>
<?php if (($child2['children3']) && ($category['category_id'] == $category_id)) { ?>
<?php foreach ($child2['children3'] as $child3) { ?>
<?php if ($child3['category_id'] == $child_id3) { ?>
<a href="<?php echo $child3['href']; ?>" class="list-group-item active"> - <?php echo $child3['name']; ?></a>
<?php } else { ?>
<a href="<?php echo $child3['href']; ?>" class="list-group-item"> - <?php echo $child3['name']; ?></a>
<?php } ?>
<?php } ?>
<?php } ?>
<?php } ?>
<?php } ?>
<?php } ?>
<?php } ?>
<?php } ?>
</div>
<div class="col-md-8">
<div class="col-md-8 products">
<div class="col-sm-4">
<div class="product">
<div class="container content">
<div class="row">
<div class="col-md-4">
<div class="list-group">
<a href="{% url 'products:productsList' %}"
class="list-group-item {% if not category %}selected{% endif %}">Все</a>
{% for c in categories %}
<a href="{{ c.get_absolute_url }}"
class="list-group-item {% if category.id == c.id %}selected{% endif %}">{{ c.name }}</a>
{% endfor %}
</div>
</div>>
<div class="col-md-8 products">
<div class="row">
{% for product in products %}
<div class="col-sm-4">
<div class="product">
<div class="product-img">
<img src="{% if product.image %}{{ product.image.url }}{% else %}{% endif %}" alt="">
</div>
<p class="product-title">
<a href="{{ product.get_absolute_url }}">{{ product.title }}</a>
</p>
<p class="product-price">{{ product.price }} руб.</p>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
<script>
$(function(){
$('a[href^="#"]').on('click', function(event) {
event.preventDefault();
var sc = $(this).attr("href"),
dn = $(sc).offset().top - 100;
$('html, body').animate({scrollTop: dn}, 1000);
});
});
</script>
$(this).addClass('currentActive');