Fix LESS import error and refactor project structure
This commit is contained in:
@@ -2,12 +2,12 @@
|
||||
|
||||
<h2><?= $isEdit ? 'Редактирование категории' : 'Добавление категории' ?></h2>
|
||||
|
||||
<a href="/cite_practica/admin/categories" class="btn btn-primary" style="margin-bottom: 20px;">
|
||||
<a href="/admin/categories" class="btn btn-primary" style="margin-bottom: 20px;">
|
||||
<i class="fas fa-arrow-left"></i> Назад к списку
|
||||
</a>
|
||||
|
||||
<div class="form-container">
|
||||
<form action="/cite_practica/admin/categories/<?= $isEdit ? 'edit/' . $category['category_id'] : 'add' ?>" method="POST">
|
||||
<form action="/admin/categories/<?= $isEdit ? 'edit/' . $category['category_id'] : 'add' ?>" method="POST">
|
||||
<div class="form-group">
|
||||
<label>Название категории *</label>
|
||||
<input type="text" name="name" class="form-control"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;">
|
||||
<h2>Управление категориями</h2>
|
||||
<a href="/cite_practica/admin/categories/add" class="btn btn-success">
|
||||
<a href="/admin/categories/add" class="btn btn-success">
|
||||
<i class="fas fa-plus"></i> Добавить категорию
|
||||
</a>
|
||||
</div>
|
||||
@@ -42,10 +42,10 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="action-buttons">
|
||||
<a href="/cite_practica/admin/categories/edit/<?= $category['category_id'] ?>" class="btn btn-sm btn-warning" title="Редактировать">
|
||||
<a href="/admin/categories/edit/<?= $category['category_id'] ?>" class="btn btn-sm btn-warning" title="Редактировать">
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
<form action="/cite_practica/admin/categories/delete/<?= $category['category_id'] ?>" method="POST" style="display: inline;"
|
||||
<form action="/admin/categories/delete/<?= $category['category_id'] ?>" method="POST" style="display: inline;"
|
||||
onsubmit="return confirm('Удалить категорию?');">
|
||||
<button type="submit" class="btn btn-sm btn-danger" title="Удалить">
|
||||
<i class="fas fa-trash"></i>
|
||||
|
||||
@@ -28,16 +28,16 @@
|
||||
<div style="margin-top: 30px;">
|
||||
<h3>Быстрые действия</h3>
|
||||
<div style="display: flex; gap: 15px; margin-top: 15px; flex-wrap: wrap;">
|
||||
<a href="/cite_practica/admin/products/add" class="btn btn-success">
|
||||
<a href="/admin/products/add" class="btn btn-success">
|
||||
<i class="fas fa-plus"></i> Добавить товар
|
||||
</a>
|
||||
<a href="/cite_practica/admin/categories/add" class="btn btn-primary">
|
||||
<a href="/admin/categories/add" class="btn btn-primary">
|
||||
<i class="fas fa-plus"></i> Добавить категорию
|
||||
</a>
|
||||
<a href="/cite_practica/admin/orders" class="btn btn-primary">
|
||||
<a href="/admin/orders" class="btn btn-primary">
|
||||
<i class="fas fa-shopping-cart"></i> Просмотреть заказы
|
||||
</a>
|
||||
<a href="/cite_practica/catalog" class="btn btn-primary">
|
||||
<a href="/catalog" class="btn btn-primary">
|
||||
<i class="fas fa-store"></i> Перейти в каталог
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php use App\Core\View; ?>
|
||||
|
||||
<a href="/cite_practica/admin/orders" class="btn btn-primary" style="margin-bottom: 20px;">
|
||||
<a href="/admin/orders" class="btn btn-primary" style="margin-bottom: 20px;">
|
||||
<i class="fas fa-arrow-left"></i> Назад к заказам
|
||||
</a>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
<div class="form-container">
|
||||
<h3>Статус заказа</h3>
|
||||
<form action="/cite_practica/admin/orders/<?= $order['order_id'] ?>/status" method="POST">
|
||||
<form action="/admin/orders/<?= $order['order_id'] ?>/status" method="POST">
|
||||
<div class="form-group">
|
||||
<select name="status" class="form-control">
|
||||
<option value="pending" <?= $order['status'] === 'pending' ? 'selected' : '' ?>>Ожидает</option>
|
||||
@@ -60,7 +60,7 @@
|
||||
<?php foreach ($order['items'] as $item): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="/cite_practica/<?= htmlspecialchars($item['image_url'] ?? 'img/1.jpg') ?>"
|
||||
<img src="/<?= htmlspecialchars($item['image_url'] ?? 'img/1.jpg') ?>"
|
||||
style="width: 50px; height: 50px; object-fit: cover; border-radius: 4px;">
|
||||
</td>
|
||||
<td><?= htmlspecialchars($item['product_name']) ?></td>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/cite_practica/admin/orders/<?= $order['order_id'] ?>" class="btn btn-sm btn-primary">
|
||||
<a href="/admin/orders/<?= $order['order_id'] ?>" class="btn btn-sm btn-primary">
|
||||
<i class="fas fa-eye"></i> Подробнее
|
||||
</a>
|
||||
</td>
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
<h2><?= $isEdit ? 'Редактирование товара' : 'Добавление товара' ?></h2>
|
||||
|
||||
<a href="/cite_practica/admin/products" class="btn btn-primary" style="margin-bottom: 20px;">
|
||||
<a href="/admin/products" class="btn btn-primary" style="margin-bottom: 20px;">
|
||||
<i class="fas fa-arrow-left"></i> Назад к списку
|
||||
</a>
|
||||
|
||||
<div class="form-container">
|
||||
<form action="/cite_practica/admin/products/<?= $isEdit ? 'edit/' . $product['product_id'] : 'add' ?>" method="POST">
|
||||
<form action="/admin/products/<?= $isEdit ? 'edit/' . $product['product_id'] : 'add' ?>" method="POST">
|
||||
<div class="form-group">
|
||||
<label>Название товара *</label>
|
||||
<input type="text" name="name" class="form-control"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;">
|
||||
<h2>Управление товарами</h2>
|
||||
<a href="/cite_practica/admin/products/add" class="btn btn-success">
|
||||
<a href="/admin/products/add" class="btn btn-success">
|
||||
<i class="fas fa-plus"></i> Добавить товар
|
||||
</a>
|
||||
</div>
|
||||
@@ -16,8 +16,8 @@
|
||||
<?php endif; ?>
|
||||
|
||||
<div style="margin-bottom: 15px;">
|
||||
<a href="/cite_practica/admin/products" class="btn btn-sm <?= !$showAll ? 'btn-primary' : '' ?>">Активные</a>
|
||||
<a href="/cite_practica/admin/products?show_all=1" class="btn btn-sm <?= $showAll ? 'btn-primary' : '' ?>">Все товары</a>
|
||||
<a href="/admin/products" class="btn btn-sm <?= !$showAll ? 'btn-primary' : '' ?>">Активные</a>
|
||||
<a href="/admin/products?show_all=1" class="btn btn-sm <?= $showAll ? 'btn-primary' : '' ?>">Все товары</a>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
@@ -38,7 +38,7 @@
|
||||
<tr style="<?= !$product['is_available'] ? 'opacity: 0.5;' : '' ?>">
|
||||
<td><?= $product['product_id'] ?></td>
|
||||
<td>
|
||||
<img src="/cite_practica/<?= htmlspecialchars($product['image_url'] ?? 'img/1.jpg') ?>"
|
||||
<img src="/<?= htmlspecialchars($product['image_url'] ?? 'img/1.jpg') ?>"
|
||||
style="width: 50px; height: 50px; object-fit: cover; border-radius: 4px;">
|
||||
</td>
|
||||
<td><?= htmlspecialchars($product['name']) ?></td>
|
||||
@@ -54,13 +54,13 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="action-buttons">
|
||||
<a href="/cite_practica/product/<?= $product['product_id'] ?>" class="btn btn-sm btn-primary" title="Просмотр">
|
||||
<a href="/product/<?= $product['product_id'] ?>" class="btn btn-sm btn-primary" title="Просмотр">
|
||||
<i class="fas fa-eye"></i>
|
||||
</a>
|
||||
<a href="/cite_practica/admin/products/edit/<?= $product['product_id'] ?>" class="btn btn-sm btn-warning" title="Редактировать">
|
||||
<a href="/admin/products/edit/<?= $product['product_id'] ?>" class="btn btn-sm btn-warning" title="Редактировать">
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
<form action="/cite_practica/admin/products/delete/<?= $product['product_id'] ?>" method="POST" style="display: inline;"
|
||||
<form action="/admin/products/delete/<?= $product['product_id'] ?>" method="POST" style="display: inline;"
|
||||
onsubmit="return confirm('Скрыть товар?');">
|
||||
<button type="submit" class="btn btn-sm btn-danger" title="Скрыть">
|
||||
<i class="fas fa-eye-slash"></i>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
<div class="auth-actions">
|
||||
<span class="auth-text">Нет аккаунта?</span>
|
||||
<a href="/cite_practica/register" class="login-btn">Зарегистрироваться</a>
|
||||
<a href="/register" class="login-btn">Зарегистрироваться</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -70,13 +70,13 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: '/cite_practica/login',
|
||||
url: '/login',
|
||||
method: 'POST',
|
||||
data: { email: email, password: password, redirect: redirect },
|
||||
dataType: 'json',
|
||||
success: function(result) {
|
||||
if (result.success) {
|
||||
window.location.href = result.redirect || '/cite_practica/catalog';
|
||||
window.location.href = result.redirect || '/catalog';
|
||||
} else {
|
||||
alert(result.message || 'Ошибка авторизации');
|
||||
}
|
||||
@@ -88,4 +88,3 @@ $(document).ready(function() {
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -18,10 +18,6 @@
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div style="background: #e8f4fd; padding: 15px; border-radius: 5px; margin: 20px auto; max-width: 800px; text-align: center; font-size: 14px; color: #0c5460;">
|
||||
<i class="fas fa-info-circle"></i> Для доступа к каталогу и оформления заказов необходимо зарегистрироваться
|
||||
</div>
|
||||
|
||||
<div class="profile-container">
|
||||
<div class="profile-left-col">
|
||||
<div class="logo" style="color: white;">AETERNA</div>
|
||||
@@ -39,8 +35,11 @@
|
||||
|
||||
<div class="profile-right-col">
|
||||
<div class="profile-form-block">
|
||||
<div style="margin-bottom: 20px; padding: 12px 15px; background: #e8f4fd; border-radius: 5px; font-size: 13px; color: #0c5460; text-align: center;">
|
||||
<i class="fas fa-info-circle"></i> Для доступа к каталогу и оформления заказов необходимо зарегистрироваться
|
||||
</div>
|
||||
<h2>РЕГИСТРАЦИЯ</h2>
|
||||
<form class="profile-form" action="/cite_practica/register" method="POST" id="registrationForm">
|
||||
<form class="profile-form" action="/register" method="POST" id="registrationForm">
|
||||
<div class="input-group">
|
||||
<label for="fio">ФИО *</label>
|
||||
<input type="text" id="fio" name="fio" placeholder="Введите ваше ФИО"
|
||||
@@ -82,7 +81,7 @@
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<a href="/cite_practica/login" style="display: block; margin: 15px 0; text-align: center; color: #453227;">
|
||||
<a href="/login" style="display: block; margin: 15px 0; text-align: center; color: #453227;">
|
||||
Уже есть аккаунт? Войти
|
||||
</a>
|
||||
|
||||
@@ -92,4 +91,3 @@
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ use App\Core\View;
|
||||
|
||||
<main class="container">
|
||||
<div class="breadcrumbs">
|
||||
<a href="/cite_practica/">Главная</a> • <span class="current-page">Корзина</span>
|
||||
<a href="/">Главная</a> • <span class="current-page">Корзина</span>
|
||||
</div>
|
||||
|
||||
<h2 style="color: #453227; margin: 20px 0;">Товары в корзине</h2>
|
||||
@@ -49,7 +49,7 @@ use App\Core\View;
|
||||
<div class="empty-cart">
|
||||
<i class="fas fa-shopping-cart" style="font-size: 48px; color: #ccc; margin-bottom: 20px;"></i>
|
||||
<p>Ваша корзина пуста</p>
|
||||
<a href="/cite_practica/catalog" class="btn primary-btn" style="margin-top: 20px; display: inline-block; background: #453227; color: white; padding: 12px 30px; border-radius: 4px; text-decoration: none;">
|
||||
<a href="/catalog" class="btn primary-btn" style="margin-top: 20px; display: inline-block; background: #453227; color: white; padding: 12px 30px; border-radius: 4px; text-decoration: none;">
|
||||
Продолжить покупки
|
||||
</a>
|
||||
</div>
|
||||
@@ -60,7 +60,17 @@ use App\Core\View;
|
||||
<?php foreach ($cartItems as $item): ?>
|
||||
<div class="products__item" data-product-id="<?= $item['product_id'] ?>" data-price="<?= $item['price'] ?>">
|
||||
<div class="products__image">
|
||||
<img src="/cite_practica/<?= htmlspecialchars($item['image_url'] ?? 'img/1.jpg') ?>"
|
||||
<?php
|
||||
$cartImageUrl = $item['image_url'] ?? '';
|
||||
if (empty($cartImageUrl)) {
|
||||
$cartImageUrl = '/assets/images/1.jpg';
|
||||
} elseif (strpos($cartImageUrl, '/img2/') === 0) {
|
||||
$cartImageUrl = str_replace('/img2/', '/assets/images/', $cartImageUrl);
|
||||
} elseif (strpos($cartImageUrl, 'img2/') === 0) {
|
||||
$cartImageUrl = str_replace('img2/', '/assets/images/', $cartImageUrl);
|
||||
}
|
||||
?>
|
||||
<img src="<?= htmlspecialchars($cartImageUrl) ?>"
|
||||
alt="<?= htmlspecialchars($item['name']) ?>">
|
||||
</div>
|
||||
<div class="products__details">
|
||||
@@ -170,13 +180,12 @@ use App\Core\View;
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Обновление количества
|
||||
$('.products__qty-btn').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
const productId = $(this).data('id');
|
||||
const isPlus = $(this).hasClass('plus');
|
||||
const $qtyValue = $(this).siblings('.products__qty-value');
|
||||
let quantity = parseInt($qtyValue.text());
|
||||
var productId = $(this).data('id');
|
||||
var isPlus = $(this).hasClass('plus');
|
||||
var $qtyValue = $(this).siblings('.products__qty-value');
|
||||
var quantity = parseInt($qtyValue.text());
|
||||
|
||||
if (isPlus) { quantity++; }
|
||||
else if (quantity > 1) { quantity--; }
|
||||
@@ -185,7 +194,7 @@ $(document).ready(function() {
|
||||
$qtyValue.text(quantity);
|
||||
|
||||
$.ajax({
|
||||
url: '/cite_practica/cart/update',
|
||||
url: '/cart/update',
|
||||
method: 'POST',
|
||||
data: { product_id: productId, quantity: quantity },
|
||||
dataType: 'json',
|
||||
@@ -198,16 +207,15 @@ $(document).ready(function() {
|
||||
});
|
||||
});
|
||||
|
||||
// Удаление товара
|
||||
$('.remove-from-cart').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
const productId = $(this).data('id');
|
||||
const $item = $(this).closest('.products__item');
|
||||
var productId = $(this).data('id');
|
||||
var $item = $(this).closest('.products__item');
|
||||
|
||||
if (!confirm('Удалить товар из корзины?')) return;
|
||||
|
||||
$.ajax({
|
||||
url: '/cite_practica/cart/remove',
|
||||
url: '/cart/remove',
|
||||
method: 'POST',
|
||||
data: { product_id: productId },
|
||||
dataType: 'json',
|
||||
@@ -227,31 +235,30 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
function updateTotals() {
|
||||
let productsTotal = 0;
|
||||
let totalCount = 0;
|
||||
var productsTotal = 0;
|
||||
var totalCount = 0;
|
||||
|
||||
$('.products__item').each(function() {
|
||||
const price = parseInt($(this).data('price'));
|
||||
const quantity = parseInt($(this).find('.products__qty-value').text());
|
||||
var price = parseInt($(this).data('price'));
|
||||
var quantity = parseInt($(this).find('.products__qty-value').text());
|
||||
productsTotal += price * quantity;
|
||||
totalCount += quantity;
|
||||
});
|
||||
|
||||
const delivery = parseFloat($('input[name="delivery_price"]').val());
|
||||
const discount = parseFloat($('input[name="discount"]').val());
|
||||
const finalTotal = productsTotal + delivery - discount;
|
||||
var delivery = parseFloat($('input[name="delivery_price"]').val());
|
||||
var discount = parseFloat($('input[name="discount"]').val());
|
||||
var finalTotal = productsTotal + delivery - discount;
|
||||
|
||||
$('.products-total').text(productsTotal.toLocaleString('ru-RU') + ' ₽');
|
||||
$('.summary-count').text(totalCount);
|
||||
$('.final-total').text(finalTotal.toLocaleString('ru-RU') + ' ₽');
|
||||
}
|
||||
|
||||
// Промокод
|
||||
$('#applyPromo').click(function() {
|
||||
const promoCode = $('#promo_code').val().toUpperCase();
|
||||
var promoCode = $('#promo_code').val().toUpperCase();
|
||||
if (promoCode === 'SALE10') {
|
||||
const productsTotal = parseFloat($('.products-total').text().replace(/[^0-9]/g, ''));
|
||||
const discount = Math.round(productsTotal * 0.1);
|
||||
var productsTotal = parseFloat($('.products-total').text().replace(/[^0-9]/g, ''));
|
||||
var discount = Math.round(productsTotal * 0.1);
|
||||
$('input[name="discount"]').val(discount);
|
||||
$('.discount-total').text(discount.toLocaleString('ru-RU') + ' ₽');
|
||||
showNotification('Промокод применен! Скидка 10%');
|
||||
@@ -266,7 +273,6 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
// Оформление заказа
|
||||
$('#orderForm').submit(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
@@ -278,7 +284,7 @@ $(document).ready(function() {
|
||||
$('#submit-order').prop('disabled', true).text('ОБРАБОТКА...');
|
||||
|
||||
$.ajax({
|
||||
url: '/cite_practica/order',
|
||||
url: '/order',
|
||||
method: 'POST',
|
||||
data: $(this).serialize(),
|
||||
dataType: 'json',
|
||||
@@ -286,7 +292,7 @@ $(document).ready(function() {
|
||||
if (result.success) {
|
||||
showNotification('Заказ успешно оформлен!');
|
||||
setTimeout(function() {
|
||||
window.location.href = '/cite_practica/';
|
||||
window.location.href = '/';
|
||||
}, 1500);
|
||||
} else {
|
||||
showNotification('Ошибка: ' + result.message, 'error');
|
||||
@@ -301,4 +307,3 @@ $(document).ready(function() {
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
К сожалению, запрошенная страница не существует или была перемещена.
|
||||
</p>
|
||||
<div style="margin-top: 30px;">
|
||||
<a href="/cite_practica/" class="btn primary-btn" style="display: inline-block; background: #453227; color: white; padding: 12px 30px; border-radius: 4px; text-decoration: none;">
|
||||
<a href="/" class="btn primary-btn" style="display: inline-block; background: #453227; color: white; padding: 12px 30px; border-radius: 4px; text-decoration: none;">
|
||||
<i class="fas fa-home"></i> На главную
|
||||
</a>
|
||||
<a href="/cite_practica/catalog" class="btn" style="display: inline-block; background: #617365; color: white; padding: 12px 30px; border-radius: 4px; text-decoration: none; margin-left: 10px;">
|
||||
<a href="/catalog" class="btn" style="display: inline-block; background: #617365; color: white; padding: 12px 30px; border-radius: 4px; text-decoration: none; margin-left: 10px;">
|
||||
<i class="fas fa-store"></i> В каталог
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
Произошла ошибка при обработке вашего запроса. Мы уже работаем над её устранением.
|
||||
</p>
|
||||
<div style="margin-top: 30px;">
|
||||
<a href="/cite_practica/" class="btn primary-btn" style="display: inline-block; background: #453227; color: white; padding: 12px 30px; border-radius: 4px; text-decoration: none;">
|
||||
<a href="/" class="btn primary-btn" style="display: inline-block; background: #453227; color: white; padding: 12px 30px; border-radius: 4px; text-decoration: none;">
|
||||
<i class="fas fa-home"></i> На главную
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
<div class="container hero__content">
|
||||
<div class="hero__image-block">
|
||||
<div class="hero__circle"></div>
|
||||
<img src="/img/chair.PNG" alt="Кресло и торшер" class="hero__img">
|
||||
<img src="/assets/images/chair.PNG" alt="Кресло и торшер" class="hero__img">
|
||||
</div>
|
||||
<div class="hero__text-block">
|
||||
<h1>ДОБАВЬТЕ ИЗЫСКАННОСТИ В СВОЙ ИНТЕРЬЕР</h1>
|
||||
<p class="hero__usp-text">Мы создаем мебель, которая сочетает в себе безупречный дизайн, натуральные материалы, продуманный функционал, чтобы ваш день начинался и заканчивался с комфортом.</p>
|
||||
|
||||
<?php if ($isLoggedIn): ?>
|
||||
<a href="/cite_practica/catalog" class="btn primary-btn">ПЕРЕЙТИ В КАТАЛОГ</a>
|
||||
<a href="/catalog" class="btn primary-btn">ПЕРЕЙТИ В КАТАЛОГ</a>
|
||||
<?php else: ?>
|
||||
<a href="/cite_practica/login" class="btn primary-btn">ПЕРЕЙТИ В КАТАЛОГ</a>
|
||||
<a href="/login" class="btn primary-btn">ПЕРЕЙТИ В КАТАЛОГ</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -44,17 +44,17 @@
|
||||
|
||||
<div class="promo-images">
|
||||
<div class="promo-image-col">
|
||||
<img src="/img/спальня.jpg" alt="Кровать и тумба">
|
||||
<img src="/assets/images/спальня.jpg" alt="Кровать и тумба">
|
||||
<div class="image-overlay-text">
|
||||
<h4>НОВИНКИ В КАТЕГОРИЯХ <br>МЯГКАЯ МЕБЕЛЬ</h4>
|
||||
<a href="/cite_practica/catalog" class="overlay-link">ПЕРЕЙТИ</a>
|
||||
<a href="/catalog" class="overlay-link">ПЕРЕЙТИ</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="promo-image-col">
|
||||
<img src="/img/диван.jpg" alt="Диван в гостиной">
|
||||
<img src="/assets/images/диван.jpg" alt="Диван в гостиной">
|
||||
<div class="image-overlay-text">
|
||||
<h4>РАСПРОДАЖА <br>ПРЕДМЕТЫ ДЕКОРА</h4>
|
||||
<a href="/cite_practica/catalog" class="overlay-link">ПЕРЕЙТИ</a>
|
||||
<a href="/catalog" class="overlay-link">ПЕРЕЙТИ</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -68,11 +68,11 @@
|
||||
<h2>О НАС</h2>
|
||||
<p class="text-justified">Компания AETERNA - российский производитель качественной корпусной и мягкой мебели для дома и офиса. С 2015 года мы успешно реализуем проекты любой сложности, сочетая современные технологии, проверенные материалы и классическое мастерство.</p>
|
||||
</div>
|
||||
<img src="/img/кресло_1.jpg" alt="Фиолетовое кресло" class="about__img about__img--small">
|
||||
<img src="/assets/images/кресло_1.jpg" alt="Фиолетовое кресло" class="about__img about__img--small">
|
||||
</div>
|
||||
|
||||
<div class="about__column about__column--right">
|
||||
<img src="/img/диван_1.jpg" alt="Белый диван с подушками" class="about__img about__img--large">
|
||||
<img src="/assets/images/диван_1.jpg" alt="Белый диван с подушками" class="about__img about__img--large">
|
||||
<p class="about__caption">Наша сеть включает 30+ российских фабрик, отобранных по строгим стандартам качества. Мы сотрудничаем исключительно с лидерами рынка, чья продукция доказала свое превосходство временем.</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -83,12 +83,20 @@
|
||||
<div class="solutions-slider">
|
||||
<div class="solutions-slider__slides">
|
||||
<div class="solutions-slider__slide">
|
||||
<img src="/img/слайдер_1.jpg" class="solution-img" alt="Готовое решение для гостиной">
|
||||
<img src="/assets/images/слайдер_1.jpg" class="solution-img" alt="Готовое решение для гостиной">
|
||||
<div class="solution-text-overlay">
|
||||
<h2>ГОТОВОЕ РЕШЕНИЕ<br>ДЛЯ ВАШЕЙ ГОСТИНОЙ</h2><br>
|
||||
<p>УСПЕЙТЕ ЗАКАЗАТЬ СЕЙЧАС</p>
|
||||
</div>
|
||||
<a href="/cite_practica/catalog" class="solution-image-link">Подробнее</a>
|
||||
<a href="/catalog" class="solution-image-link">Подробнее</a>
|
||||
</div>
|
||||
<div class="solutions-slider__slide">
|
||||
<img src="/assets/images/слайдер_6.jpg" class="solution-img" alt="Готовое решение для спальни">
|
||||
<div class="solution-text-overlay">
|
||||
<h2>ГОТОВОЕ РЕШЕНИЕ<br>ДЛЯ ВАШЕЙ СПАЛЬНИ</h2><br>
|
||||
<p>УСПЕЙТЕ ЗАКАЗАТЬ СЕЙЧАС</p>
|
||||
</div>
|
||||
<a href="/catalog" class="solution-image-link">Подробнее</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -150,4 +158,3 @@
|
||||
<button class="btn primary-btn">Задать вопрос</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -44,25 +44,25 @@
|
||||
<h1><i class="fas fa-user-shield"></i> Админ-панель AETERNA</h1>
|
||||
<div>
|
||||
<span><?= htmlspecialchars($user['email'] ?? 'Администратор') ?></span>
|
||||
<a href="/cite_practica/catalog" class="btn btn-primary" style="margin-left: 10px;">В каталог</a>
|
||||
<a href="/cite_practica/logout" class="btn btn-danger" style="margin-left: 10px;">Выйти</a>
|
||||
<a href="/catalog" class="btn btn-primary" style="margin-left: 10px;">В каталог</a>
|
||||
<a href="/logout" class="btn btn-danger" style="margin-left: 10px;">Выйти</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin-tabs">
|
||||
<a href="/cite_practica/admin" class="admin-tab <?= ($action ?? '') === 'dashboard' ? 'active' : '' ?>">
|
||||
<a href="/admin" class="admin-tab <?= ($action ?? '') === 'dashboard' ? 'active' : '' ?>">
|
||||
<i class="fas fa-tachometer-alt"></i> Дашборд
|
||||
</a>
|
||||
<a href="/cite_practica/admin/products" class="admin-tab <?= str_contains($_SERVER['REQUEST_URI'] ?? '', '/products') ? 'active' : '' ?>">
|
||||
<a href="/admin/products" class="admin-tab <?= str_contains($_SERVER['REQUEST_URI'] ?? '', '/products') ? 'active' : '' ?>">
|
||||
<i class="fas fa-box"></i> Товары
|
||||
</a>
|
||||
<a href="/cite_practica/admin/categories" class="admin-tab <?= str_contains($_SERVER['REQUEST_URI'] ?? '', '/categories') ? 'active' : '' ?>">
|
||||
<a href="/admin/categories" class="admin-tab <?= str_contains($_SERVER['REQUEST_URI'] ?? '', '/categories') ? 'active' : '' ?>">
|
||||
<i class="fas fa-tags"></i> Категории
|
||||
</a>
|
||||
<a href="/cite_practica/admin/orders" class="admin-tab <?= str_contains($_SERVER['REQUEST_URI'] ?? '', '/orders') ? 'active' : '' ?>">
|
||||
<a href="/admin/orders" class="admin-tab <?= str_contains($_SERVER['REQUEST_URI'] ?? '', '/orders') ? 'active' : '' ?>">
|
||||
<i class="fas fa-shopping-cart"></i> Заказы
|
||||
</a>
|
||||
<a href="/cite_practica/admin/users" class="admin-tab <?= str_contains($_SERVER['REQUEST_URI'] ?? '', '/users') ? 'active' : '' ?>">
|
||||
<a href="/admin/users" class="admin-tab <?= str_contains($_SERVER['REQUEST_URI'] ?? '', '/users') ? 'active' : '' ?>">
|
||||
<i class="fas fa-users"></i> Пользователи
|
||||
</a>
|
||||
</div>
|
||||
@@ -72,4 +72,3 @@
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -47,16 +47,16 @@
|
||||
<?= \App\Core\View::partial('footer') ?>
|
||||
|
||||
<script>
|
||||
function showNotification(message, type = 'success') {
|
||||
const notification = $('#notification');
|
||||
function showNotification(message, type) {
|
||||
type = type || 'success';
|
||||
var notification = $('#notification');
|
||||
notification.text(message);
|
||||
notification.removeClass('success error').addClass(type + ' show');
|
||||
setTimeout(function() { notification.removeClass('show'); }, 3000);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
// Обновляем счетчик корзины
|
||||
$.get('/cite_practica/cart/count', function(response) {
|
||||
$.get('/cart/count', function(response) {
|
||||
if (response.success) {
|
||||
$('.cart-count').text(response.cart_count);
|
||||
}
|
||||
@@ -65,4 +65,3 @@
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<main class="delivery-page">
|
||||
<div class="container">
|
||||
<div class="breadcrumbs">
|
||||
<a href="/cite_practica/">Главная</a> • <span class="current-page">Доставка и оплата</span>
|
||||
<a href="/">Главная</a> • <span class="current-page">Доставка и оплата</span>
|
||||
</div>
|
||||
|
||||
<h1 style="color: #453227; margin: 30px 0;">Доставка и оплата</h1>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<main class="services-page">
|
||||
<div class="container">
|
||||
<div class="breadcrumbs">
|
||||
<a href="/cite_practica/">Главная</a> • <span class="current-page">Услуги</span>
|
||||
<a href="/">Главная</a> • <span class="current-page">Услуги</span>
|
||||
</div>
|
||||
|
||||
<h1 style="color: #453227; margin: 30px 0;">Наши услуги</h1>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<main class="warranty-page">
|
||||
<div class="container">
|
||||
<div class="breadcrumbs">
|
||||
<a href="/cite_practica/">Главная</a> • <span class="current-page">Гарантия и возврат</span>
|
||||
<a href="/">Главная</a> • <span class="current-page">Гарантия и возврат</span>
|
||||
</div>
|
||||
|
||||
<h1 style="color: #453227; margin: 30px 0;">Гарантия и возврат</h1>
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
<div class="footer__col">
|
||||
<h5>ПОКУПАТЕЛЮ</h5>
|
||||
<ul>
|
||||
<li><a href="/cite_practica/catalog">Каталог</a></li>
|
||||
<li><a href="/cite_practica/services">Услуги</a></li>
|
||||
<li><a href="/catalog">Каталог</a></li>
|
||||
<li><a href="/services">Услуги</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="footer__col">
|
||||
<h5>ПОМОЩЬ</h5>
|
||||
<ul>
|
||||
<li><a href="/cite_practica/delivery">Доставка и оплата</a></li>
|
||||
<li><a href="/cite_practica/warranty">Гарантия и возврат</a></li>
|
||||
<li><a href="/cite_practica/#faq">Ответы на вопросы</a></li>
|
||||
<li><a href="/delivery">Доставка и оплата</a></li>
|
||||
<li><a href="/warranty">Гарантия и возврат</a></li>
|
||||
<li><a href="/#faq">Ответы на вопросы</a></li>
|
||||
<li><a href="#footer">Контакты</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -42,7 +42,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="copyright">
|
||||
<p>© 2025 AETERNA. Все права защищены.</p>
|
||||
<p>© <?= date('Y') ?> AETERNA. Все права защищены.</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
@@ -6,24 +6,24 @@ $user = $user ?? \App\Core\View::currentUser();
|
||||
<header class="header">
|
||||
<div class="header__top">
|
||||
<div class="container header__top-content">
|
||||
<a href="/cite_practica/" class="logo">AETERNA</a>
|
||||
<a href="/" class="logo">AETERNA</a>
|
||||
|
||||
<div class="search-catalog">
|
||||
<div class="catalog-dropdown">
|
||||
Все категории <span>▼</span>
|
||||
<div class="catalog-dropdown__menu">
|
||||
<ul>
|
||||
<li><a href="/cite_practica/catalog">Все товары</a></li>
|
||||
<li><a href="/cite_practica/catalog?category=1">Диваны</a></li>
|
||||
<li><a href="/cite_practica/catalog?category=2">Кровати</a></li>
|
||||
<li><a href="/cite_practica/catalog?category=3">Шкафы</a></li>
|
||||
<li><a href="/cite_practica/catalog?category=4">Стулья</a></li>
|
||||
<li><a href="/cite_practica/catalog?category=5">Столы</a></li>
|
||||
<li><a href="/catalog">Все товары</a></li>
|
||||
<li><a href="/catalog?category=1">Диваны</a></li>
|
||||
<li><a href="/catalog?category=2">Кровати</a></li>
|
||||
<li><a href="/catalog?category=3">Шкафы</a></li>
|
||||
<li><a href="/catalog?category=4">Стулья</a></li>
|
||||
<li><a href="/catalog?category=5">Столы</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-box">
|
||||
<form method="GET" action="/cite_practica/catalog" style="display: flex; width: 100%;">
|
||||
<form method="GET" action="/catalog" style="display: flex; width: 100%;">
|
||||
<input type="text" name="search" placeholder="Поиск товаров" style="border: none; width: 100%; padding: 10px;">
|
||||
<button type="submit" style="background: none; border: none; cursor: pointer;">
|
||||
<span class="search-icon"><i class="fas fa-search"></i></span>
|
||||
@@ -34,7 +34,7 @@ $user = $user ?? \App\Core\View::currentUser();
|
||||
|
||||
<div class="header__icons--top">
|
||||
<?php if ($isLoggedIn): ?>
|
||||
<a href="/cite_practica/cart" class="icon cart-icon">
|
||||
<a href="/cart" class="icon cart-icon">
|
||||
<i class="fas fa-shopping-cart"></i>
|
||||
<span class="cart-count">0</span>
|
||||
</a>
|
||||
@@ -68,17 +68,17 @@ $user = $user ?? \App\Core\View::currentUser();
|
||||
</div>
|
||||
|
||||
<ul class="user-profile-links">
|
||||
<li><a href="/cite_practica/cart"><i class="fas fa-shopping-bag"></i> Корзина</a></li>
|
||||
<li><a href="/cart"><i class="fas fa-shopping-bag"></i> Корзина</a></li>
|
||||
<?php if ($isAdmin): ?>
|
||||
<li><a href="/cite_practica/admin"><i class="fas fa-user-shield"></i> Админ-панель</a></li>
|
||||
<li><a href="/admin"><i class="fas fa-user-shield"></i> Админ-панель</a></li>
|
||||
<?php endif; ?>
|
||||
<li><a href="/cite_practica/logout" class="logout-link"><i class="fas fa-sign-out-alt"></i> Выйти</a></li>
|
||||
<li><a href="/logout" class="logout-link"><i class="fas fa-sign-out-alt"></i> Выйти</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<a href="/cite_practica/login" class="icon"><i class="far fa-user"></i></a>
|
||||
<a href="/cite_practica/login" style="font-size: 12px; color: #666; margin-left: 5px;">Войти</a>
|
||||
<a href="/login" class="icon"><i class="far fa-user"></i></a>
|
||||
<a href="/login" style="font-size: 12px; color: #666; margin-left: 5px;">Войти</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -87,7 +87,7 @@ $user = $user ?? \App\Core\View::currentUser();
|
||||
<div class="header__bottom">
|
||||
<div class="container header__bottom-content">
|
||||
<div class="catalog-menu">
|
||||
<a href="/cite_practica/catalog" class="catalog-link">
|
||||
<a href="/catalog" class="catalog-link">
|
||||
<span class="catalog-lines">☰</span>
|
||||
Каталог
|
||||
</a>
|
||||
@@ -95,10 +95,10 @@ $user = $user ?? \App\Core\View::currentUser();
|
||||
|
||||
<nav class="nav">
|
||||
<ul class="nav-list">
|
||||
<li><a href="/cite_practica/">Главная</a></li>
|
||||
<li><a href="/cite_practica/services">Услуги</a></li>
|
||||
<li><a href="/cite_practica/delivery">Доставка и оплата</a></li>
|
||||
<li><a href="/cite_practica/warranty">Гарантия</a></li>
|
||||
<li><a href="/">Главная</a></li>
|
||||
<li><a href="/services">Услуги</a></li>
|
||||
<li><a href="/delivery">Доставка и оплата</a></li>
|
||||
<li><a href="/warranty">Гарантия</a></li>
|
||||
<li><a href="#footer">Контакты</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
@@ -106,4 +106,3 @@ $user = $user ?? \App\Core\View::currentUser();
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ use App\Core\View;
|
||||
<main class="catalog-main">
|
||||
<div class="container">
|
||||
<div class="breadcrumbs">
|
||||
<a href="/cite_practica/">Главная</a> • <span class="current-page">Каталог</span>
|
||||
<a href="/">Главная</a> • <span class="current-page">Каталог</span>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($success)): ?>
|
||||
@@ -48,10 +48,10 @@ use App\Core\View;
|
||||
<i class="fas fa-user-shield"></i> Панель управления каталогом
|
||||
</h3>
|
||||
<div>
|
||||
<a href="/cite_practica/admin/products" class="admin-btn"><i class="fas fa-boxes"></i> Управление каталогом</a>
|
||||
<a href="/cite_practica/admin/products/add" class="admin-btn"><i class="fas fa-plus"></i> Добавить товар</a>
|
||||
<a href="/cite_practica/admin/categories" class="admin-btn"><i class="fas fa-tags"></i> Категории</a>
|
||||
<a href="/cite_practica/admin/orders" class="admin-btn"><i class="fas fa-shopping-cart"></i> Заказы</a>
|
||||
<a href="/admin/products" class="admin-btn"><i class="fas fa-boxes"></i> Управление каталогом</a>
|
||||
<a href="/admin/products/add" class="admin-btn"><i class="fas fa-plus"></i> Добавить товар</a>
|
||||
<a href="/admin/categories" class="admin-btn"><i class="fas fa-tags"></i> Категории</a>
|
||||
<a href="/admin/orders" class="admin-btn"><i class="fas fa-shopping-cart"></i> Заказы</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -67,14 +67,14 @@ use App\Core\View;
|
||||
|
||||
<div class="catalog-wrapper">
|
||||
<aside class="catalog-sidebar">
|
||||
<form method="GET" action="/cite_practica/catalog" id="filterForm">
|
||||
<form method="GET" action="/catalog" id="filterForm">
|
||||
<div class="filter-group">
|
||||
<h4 class="filter-title">КАТЕГОРИИ</h4>
|
||||
<ul class="filter-list">
|
||||
<li><a href="/cite_practica/catalog" class="<?= empty($filters['category_id']) ? 'active-category' : '' ?>">Все товары</a></li>
|
||||
<li><a href="/catalog" class="<?= empty($filters['category_id']) ? 'active-category' : '' ?>">Все товары</a></li>
|
||||
<?php foreach ($categories as $category): ?>
|
||||
<li>
|
||||
<a href="/cite_practica/catalog?category=<?= $category['category_id'] ?>"
|
||||
<a href="/catalog?category=<?= $category['category_id'] ?>"
|
||||
class="<?= $filters['category_id'] == $category['category_id'] ? 'active-category' : '' ?>">
|
||||
<?= htmlspecialchars($category['name']) ?>
|
||||
</a>
|
||||
@@ -129,7 +129,7 @@ use App\Core\View;
|
||||
<?php if (!empty($filters['search'])): ?>
|
||||
<p style="color: #666;">
|
||||
Результаты поиска: "<strong><?= htmlspecialchars($filters['search']) ?></strong>"
|
||||
<a href="/cite_practica/catalog" style="margin-left: 10px; color: #617365;">
|
||||
<a href="/catalog" style="margin-left: 10px; color: #617365;">
|
||||
<i class="fas fa-times"></i> Очистить
|
||||
</a>
|
||||
</p>
|
||||
@@ -144,9 +144,19 @@ use App\Core\View;
|
||||
<?php else: ?>
|
||||
<?php foreach ($products as $product): ?>
|
||||
<div class="product-card <?= !$product['is_available'] ? 'unavailable' : '' ?>"
|
||||
onclick="window.location.href='/cite_practica/product/<?= $product['product_id'] ?>'"
|
||||
onclick="window.location.href='/product/<?= $product['product_id'] ?>'"
|
||||
data-product-id="<?= $product['product_id'] ?>">
|
||||
<img src="/cite_practica/<?= htmlspecialchars($product['image_url'] ?? 'img/1.jpg') ?>"
|
||||
<?php
|
||||
$imageUrl = $product['image_url'] ?? '';
|
||||
if (empty($imageUrl)) {
|
||||
$imageUrl = '/assets/images/1.jpg';
|
||||
} elseif (strpos($imageUrl, '/img2/') === 0) {
|
||||
$imageUrl = str_replace('/img2/', '/assets/images/', $imageUrl);
|
||||
} elseif (strpos($imageUrl, 'img2/') === 0) {
|
||||
$imageUrl = str_replace('img2/', '/assets/images/', $imageUrl);
|
||||
}
|
||||
?>
|
||||
<img src="<?= htmlspecialchars($imageUrl) ?>"
|
||||
alt="<?= htmlspecialchars($product['name']) ?>">
|
||||
<div class="product-info">
|
||||
<div class="name"><?= htmlspecialchars($product['name']) ?></div>
|
||||
@@ -174,7 +184,7 @@ $('#priceSlider').on('input', function() {
|
||||
|
||||
function addToCart(productId, productName) {
|
||||
$.ajax({
|
||||
url: '/cite_practica/cart/add',
|
||||
url: '/cart/add',
|
||||
method: 'POST',
|
||||
data: { product_id: productId, quantity: 1 },
|
||||
dataType: 'json',
|
||||
@@ -192,4 +202,3 @@ function addToCart(productId, productName) {
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -35,10 +35,10 @@ use App\Core\View;
|
||||
|
||||
<main class="container">
|
||||
<div class="breadcrumbs">
|
||||
<a href="/cite_practica/">Главная</a> •
|
||||
<a href="/cite_practica/catalog">Каталог</a> •
|
||||
<a href="/">Главная</a> •
|
||||
<a href="/catalog">Каталог</a> •
|
||||
<?php if ($product['category_name']): ?>
|
||||
<a href="/cite_practica/catalog?category=<?= $product['category_id'] ?>">
|
||||
<a href="/catalog?category=<?= $product['category_id'] ?>">
|
||||
<?= htmlspecialchars($product['category_name']) ?>
|
||||
</a> •
|
||||
<?php endif; ?>
|
||||
@@ -48,7 +48,17 @@ use App\Core\View;
|
||||
<div class="product__section">
|
||||
<div class="product__gallery">
|
||||
<div class="product__main-image">
|
||||
<img src="/cite_practica/<?= htmlspecialchars($product['image_url'] ?? 'img/1.jpg') ?>"
|
||||
<?php
|
||||
$imageUrl = $product['image_url'] ?? '';
|
||||
if (empty($imageUrl)) {
|
||||
$imageUrl = '/assets/images/1.jpg';
|
||||
} elseif (strpos($imageUrl, '/img2/') === 0) {
|
||||
$imageUrl = str_replace('/img2/', '/assets/images/', $imageUrl);
|
||||
} elseif (strpos($imageUrl, 'img2/') === 0) {
|
||||
$imageUrl = str_replace('img2/', '/assets/images/', $imageUrl);
|
||||
}
|
||||
?>
|
||||
<img src="<?= htmlspecialchars($imageUrl) ?>"
|
||||
alt="<?= htmlspecialchars($product['name']) ?>">
|
||||
</div>
|
||||
</div>
|
||||
@@ -134,7 +144,7 @@ use App\Core\View;
|
||||
|
||||
<?php if ($isAdmin): ?>
|
||||
<div style="margin-top: 20px;">
|
||||
<a href="/cite_practica/admin/products/edit/<?= $product['product_id'] ?>" class="btn" style="background: #ffc107; color: #333;">
|
||||
<a href="/admin/products/edit/<?= $product['product_id'] ?>" class="btn" style="background: #ffc107; color: #333;">
|
||||
<i class="fas fa-edit"></i> Редактировать
|
||||
</a>
|
||||
</div>
|
||||
@@ -147,8 +157,18 @@ use App\Core\View;
|
||||
<h2>Похожие товары</h2>
|
||||
<div class="products-grid">
|
||||
<?php foreach ($similarProducts as $similar): ?>
|
||||
<div class="product-card" onclick="window.location.href='/cite_practica/product/<?= $similar['product_id'] ?>'" style="cursor: pointer;">
|
||||
<img src="/cite_practica/<?= htmlspecialchars($similar['image_url'] ?? 'img/1.jpg') ?>"
|
||||
<?php
|
||||
$simImageUrl = $similar['image_url'] ?? '';
|
||||
if (empty($simImageUrl)) {
|
||||
$simImageUrl = '/assets/images/1.jpg';
|
||||
} elseif (strpos($simImageUrl, '/img2/') === 0) {
|
||||
$simImageUrl = str_replace('/img2/', '/assets/images/', $simImageUrl);
|
||||
} elseif (strpos($simImageUrl, 'img2/') === 0) {
|
||||
$simImageUrl = str_replace('img2/', '/assets/images/', $simImageUrl);
|
||||
}
|
||||
?>
|
||||
<div class="product-card" onclick="window.location.href='/product/<?= $similar['product_id'] ?>'" style="cursor: pointer;">
|
||||
<img src="<?= htmlspecialchars($simImageUrl) ?>"
|
||||
alt="<?= htmlspecialchars($similar['name']) ?>">
|
||||
<div class="product-info">
|
||||
<h3 style="font-size: 16px; color: #453227;"><?= htmlspecialchars($similar['name']) ?></h3>
|
||||
@@ -180,7 +200,7 @@ $(document).ready(function() {
|
||||
function addToCart(productId) {
|
||||
const quantity = $('.product__qty-value').val();
|
||||
$.ajax({
|
||||
url: '/cite_practica/cart/add',
|
||||
url: '/cart/add',
|
||||
method: 'POST',
|
||||
data: { product_id: productId, quantity: quantity },
|
||||
dataType: 'json',
|
||||
@@ -198,13 +218,12 @@ function addToCart(productId) {
|
||||
function buyNow(productId) {
|
||||
const quantity = $('.product__qty-value').val();
|
||||
$.ajax({
|
||||
url: '/cite_practica/cart/add',
|
||||
url: '/cart/add',
|
||||
method: 'POST',
|
||||
data: { product_id: productId, quantity: quantity },
|
||||
success: function() {
|
||||
window.location.href = '/cite_practica/cart';
|
||||
window.location.href = '/cart';
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user