feat: подписка на уведомление о поступлении товара
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
<p class="product-detail__stock">В наличии: <strong><%= product.stock %></strong> шт.</p>
|
||||
|
||||
<% if (error) { %><p class="alert alert--error"><%= error %></p><% } %>
|
||||
<% if (notifySuccess) { %><p class="alert alert--success"><%= notifySuccess %></p><% } %>
|
||||
<% if (notifyError) { %><p class="alert alert--error"><%= notifyError %></p><% } %>
|
||||
<% if (reserved) { %><p class="alert alert--success">Товар успешно забронирован. Подробности на почте и в личном кабинете.</p><% } %>
|
||||
<% if (userReservation) { %>
|
||||
<p class="alert alert--success">
|
||||
@@ -52,6 +54,31 @@
|
||||
<% } %>
|
||||
<% } else { %>
|
||||
<p class="alert alert--warn">Нет в наличии</p>
|
||||
|
||||
<% if (typeof cookieConsent !== 'undefined' && !cookieConsent) { %>
|
||||
<p class="muted">Примите cookies, чтобы подписаться на уведомление о поступлении.</p>
|
||||
<% } else if (stockAlertSubscribed) { %>
|
||||
<p class="stock-notify stock-notify--done">
|
||||
Вы подписаны на уведомление<% if (notifyEmail) { %> — письмо придёт на <strong><%= notifyEmail %></strong><% } %>.
|
||||
</p>
|
||||
<% } else { %>
|
||||
<section class="stock-notify card">
|
||||
<h2 class="stock-notify__title">Сообщить о поступлении</h2>
|
||||
<p class="muted stock-notify__hint">Будьте среди первых, кто узнает, когда товар снова появится в наличии.</p>
|
||||
<form action="/product/<%= product.slug %>/notify-stock" method="post" class="form stock-notify__form">
|
||||
<% if (user && notifyEmail) { %>
|
||||
<p class="muted">Уведомление отправим на <strong><%= notifyEmail %></strong></p>
|
||||
<input type="hidden" name="email" value="<%= notifyEmail %>">
|
||||
<% } else { %>
|
||||
<label class="label">
|
||||
Email
|
||||
<input type="email" name="email" class="input" required autocomplete="email" placeholder="you@example.com" value="<%= notifyEmail || '' %>">
|
||||
</label>
|
||||
<% } %>
|
||||
<button type="submit" class="btn btn--primary">Подписаться</button>
|
||||
</form>
|
||||
</section>
|
||||
<% } %>
|
||||
<% } %>
|
||||
<a href="/" class="link-back">← Назад в каталог</a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user