51 lines
2.4 KiB
Smarty
51 lines
2.4 KiB
Smarty
{if !$product}
|
|
{$product = $body.product}
|
|
{/if}
|
|
|
|
<form method="get" action="{path('kupshop_watchdog_watchdog_add')}" class="product-watchdog"
|
|
data-watchdog="form"{if $body.product and $body.product.variations.variations} style="display: none;"{/if} {if !$ctrl.logged}data-recaptcha-lazy{/if}>
|
|
|
|
{if !$product.variations.variations and !$product.variationId}
|
|
{get_product_info type='is_watchdog' product=$product assign='is_watchdog'}
|
|
{elseif $product.variationId}
|
|
{get_product_info type='is_watchdog' product=$product id_variation=$product.variationId assign='is_watchdog'}
|
|
{/if}
|
|
|
|
<input type="hidden" name="id_product" value="{$product.id}">
|
|
<input type="hidden" name="id_variation" value="{$product.variationId}" data-watchdog="variation">
|
|
|
|
<div class="watchdog-info" {if $is_watchdog}style="display: none;"{/if} data-watchdog="info">
|
|
{block "watchdog-text"}
|
|
<p>{t}Tento produkt nemáme momentálně skladem. Pokud chcete dát vědět, až bude produkt zase dostupný, vyplňte níže svůj e-mail.{/t}</p>
|
|
{/block}
|
|
<button class="btn {$tpl_vars.watchdog_btn|default:'btn-secondary'}" {if $ctrl.logged}type="submit" {else}type="button"
|
|
data-watchdog="opener"{/if}>
|
|
{t}Hlídat dostupnost{/t}
|
|
</button>
|
|
</div>
|
|
|
|
<div class="watchdog-success" {if !$is_watchdog}style="display: none;"{/if} data-watchdog="success">
|
|
<p>
|
|
{t}Jakmile bude produkt skladem, pošleme Vám e-mail.{/t}
|
|
</p>
|
|
|
|
{if $ctrl.logged}
|
|
<a href="{url s=watchdog IDp=$product.id acn='delete'}" rel="nofollow" data-watchdog="delete">{t}Zrušit hlídání{/t}</a>
|
|
<a href="{url s=category campaign="W"}">{t}Zobrazit hlídané produkty{/t}</a>
|
|
{/if}
|
|
</div>
|
|
|
|
{if !$ctrl.logged}
|
|
<div class="watchdog-loggedout" style="display: none;" data-watchdog="loggedout">
|
|
<input type="email" name="email" class="form-control" placeholder="{t}Zadejte Váš e-mail{/t}"
|
|
oninvalid="this.setCustomValidity('{t}Zadejte prosím Váš email{/t}')"
|
|
onvalid="this.setCustomValidity('')"
|
|
required>
|
|
<button class="btn {$tpl_vars.watchdog_btn|default:'btn-secondary'}" type="submit"
|
|
data-sitekey="{findModule('recaptcha','site_shared')}" data-recaptcha="btn">
|
|
{t}Pohlídat{/t}
|
|
</button>
|
|
</div>
|
|
{/if}
|
|
</form>
|