| Server IP : 54.233.248.239 / Your IP : 172.28.1.13 Web Server : Apache System : Linux ip-172-28-29-189 6.5.0-1014-aws #14~22.04.1-Ubuntu SMP Thu Feb 15 15:27:06 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.2.34-43+ubuntu22.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/vinumday2_0/resources/views/site/ |
Upload File : |
@extends('layouts.website')
@section('content')
<section class="oferta-do-dia" style="padding-bottom: 0;">
<div class="container">
<div class="flex-between">
<div class="oferta-do-dia__img <?php echo $oferta->resolucao_imagem; ?>">
<!-- classe quant-X, onde X = quantidade de selos, limite de 5 -->
<div class="premios quant-5 animated fadeInDown">
<img src="img/site/premio.png" alt="Premio">
<img src="img/site/premio.png" alt="Premio">
<img src="img/site/premio.png" alt="Premio">
<img src="img/site/premio.png" alt="Premio">
<img src="img/site/premio.png" alt="Premio">
</div>
<img src="{{ $oferta->thumbnail_principal }}" alt="{{ $oferta->titulo.' '.$oferta->sub_titulo }}" <?php echo count($oferta->produtos) > 1 ? 'style="max-width:90%"' : '';?>>
</div>
<div class="oferta-do-dia__info">
<h2 class="oferta-do-dia__title"><?php echo $oferta->titulo; ?> <?php echo $oferta->sub_titulo; ?></h2>
<input type="hidden" class="quantidade_by_client" value="<?php echo $oferta->quantidade_maxima_por_cliente; ?>">
<?php if ($oferta->tipo == 'D' || $oferta->tipo == 'CS' || $oferta->tipo == 'MC'): ?>
<?php if (($oferta->data == date('Y-m-d'))){ ?>
<?php if($oferta->preco_mercado != $oferta->preco_oferta):?>
@if(isset($oferta->ocultar_desconto) && $oferta->ocultar_desconto == false)
<p class="oferta-do-dia__preco-velho">R$ <?php echo number_format($oferta->preco_mercado,2,',','.'); ?></p>
@endif
<?php endif;?>
<p class="oferta-do-dia__preco">R$ <?php echo number_format($oferta->preco_oferta,2,',','.'); ?></p>
<?php if($oferta->percentual_desconto > 0):?>
@if(isset($oferta->ocultar_desconto) && $oferta->ocultar_desconto == false)
<div class="relative">
<p class="oferta-do-dia__desconto"><?php echo number_format($oferta->percentual_desconto,0); ?>%</p>
</div>
@endif
<?php endif;?>
<?php if($oferta->estoque && $oferta->estoque > 0){ ?>
<input type="hidden" class="quantidade" value="1">
<button style="margin-left: 0" type="button" data-oferta="<?php echo $oferta->id; ?>" class="btn-comprar add-cart">Comprar</button>
<?php }elseif($oferta->estoque <= 0 && empty($oferta->oferta_reserva)){ ?>
<button type="button" class="btn-esgotado">Oferta Esgotada</button>
<?php }elseif($oferta->oferta_reserva == 1 && $oferta->estoque <= 0){ ?>
<button type="button" class="btn-indisponivel-canal">Indisponível no momento</button>
<?php } ?>
<?php } else { ?>
<p>Oferta encerrada em <b><?php echo (isset($oferta->data)) ? date('d/m/Y', strtotime($oferta->data)) : '00/00/0000'; ?></b>.
@if(isset($disponibilidade) && $disponibilidade >= 5)
Caso queira consultar a disponibilidade dessa aula entre em <a href="/contato">contato</a>
@elseif(isset($disponibilidade) && $disponibilidade < 5)
Não há disponibilidade em estoque deste produto.
@endif
</p>
<?php } ?>
<?php else: ?>
<?php if (($oferta->tipo == 'E' && $oferta->data >= $date_limite_exclusiva) || ($oferta->tipo == 'M' && $oferta->data == date('Y-m-d') || ($oferta->tipo == 'S' && $oferta->data == $data_oferta_semana)) || (isset($canal) && $canal->data_inicio <= date('Y-m-d H:i:s') && $canal->data_fim >= date('Y-m-d H:i:s'))): ?>
<?php if (($oferta->tipo == 'E' && $oferta->data >= $date_limite_exclusiva) || ($oferta->tipo == 'M' && $oferta->data == date('Y-m-d') || ($oferta->tipo == 'S' && $oferta->data == $data_oferta_semana)) || (isset($canal) && $oferta->canalHasOferta && $oferta->canalHasOferta->data_inicial <= date('Y-m-d') && $oferta->canalHasOferta->data_final >= date('Y-m-d')) ): ?>
<p class="oferta-do-dia__preco-velho">
<?php if($oferta->preco_mercado != $oferta->preco_oferta):?>
R$ <?php echo number_format($oferta->preco_mercado,2,',','.'); ?>
<?php endif;?>
</p>
<p class="oferta-do-dia__preco">R$ <?php echo number_format($oferta->preco_oferta,2,',','.'); ?></p>
<div class="relative">
<?php if($oferta->percentual_desconto > 0):?>
<p class="oferta-do-dia__desconto"><?php echo number_format($oferta->percentual_desconto, 0); ?>%</p>
<?php endif;?>
</div>
<?php if($oferta->estoque && $oferta->estoque > 0){ ?>
<input type="number" class="quantidade" value="1">
<button type="button" data-oferta="<?php echo $oferta->id; ?>" class="btn-comprar add-cart">Comprar</button>
<?php }elseif($oferta->estoque <= 0 && empty($oferta->oferta_reserva)){ ?>
<button type="button" class="btn-esgotado">Oferta Esgotada</button>
<?php }elseif($oferta->oferta_reserva == 1 && $oferta->estoque <= 0){ ?>
<button type="button" class="btn-indisponivel-canal">Indisponível no momento</button>
<?php } ?>
<?php else: ?>
<p>Oferta encerrada em <b><?php echo (isset($oferta->data)) ? date('d/m/Y', strtotime($oferta->data)) : '00/00/0000'; ?></b>.
@if(isset($disponibilidade) && $disponibilidade >= 5)
Caso queira consultar a disponibilidade desse produto <a href="javascript:void(0)" class="check-disponibilidade" data-oferta="{{ $oferta->id }}">clique aqui</a>
@elseif(isset($disponibilidade) && $disponibilidade < 5)
Não há disponibilidade em estoque deste produto.
@endif
</p>
<?php endif ?>
<?php else: ?>
<p>Oferta encerrada em <b><?php echo (isset($oferta->data)) ? date('d/m/Y', strtotime($oferta->data)) : '00/00/0000'; ?></b>.
@if(isset($disponibilidade) && $disponibilidade >= 5)
Caso queira consultar a disponibilidade desse produto <a href="javascript:void(0)" class="check-disponibilidade" data-oferta="{{ $oferta->id }}">clique aqui</a>
@elseif(isset($disponibilidade) && $disponibilidade < 5)
Não há disponibilidade em estoque deste produto.
@endif
</p>
<?php endif ?>
<?php endif ?>
<div class="clear"></div>
<script>
$(document).ready(function(){
$('.owl-carousel:not(.slider)').owlCarousel({
loop:false,
margin:5,
nav:true,
responsive:{
0:{
items:3
},
600:{
items:3
},
1000:{
items:3
}
}
})
});
</script>
</div>
</div>
<h5 class="title-detalhes-aula">Detalhes Das Aulas</h5>
@if(count($oferta->produtos) > 0)
<table class="tabela-oferta-master-class">
<tr>
<th>Nome da aula</th>
<th>Descrição</th>
<th>Acesso</th>
</tr>
@foreach($oferta->produtos as $produto)
<tr>
<td style="width: 30%; font-weight: bold; color: #333333">{{ $produto->produto->nome }}</td>
<td style="width: 50%">
@php
$clearText = strip_tags($produto->produto->apresentacao_vinumday);
$textoAula = substr($clearText, 0, strrpos(substr($clearText, 0, 200), ' ')) . '...';
@endphp
{{ $textoAula }}
</td>
<td style="width: 20%; padding: 0px;">
@if($bloquear_master_class)
<button class="btn-master-class-blocked">VER AULA</button>
@else
<a href="{{ $produto->produto->url_aula_master_class }}" target="_blank" class="btn-master-class">VER AULA</a>
@endif
</td>
</tr>
@endforeach
</table>
@endif
</div>
</section>
<script>
$(document).on('ready', function(){
/** Add oferta da semana no carrinho */
$('.comprar-semana').click(function(){
$.ajax({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
url:'/add-oferta-semana',
type:'POST',
data:{
quantidade: 1,
},
beforeSend:function(){
$('.carregando').fadeIn();
},
success:function(data){
if(data.status){
window.location.href = "/checkout";
}else{
alertUtil.alertError(data.message);
$('.carregando').fadeOut();
}
}
});
});
});
$(document).on('click', '.check-disponibilidade', function(){
var id = $(this).data('oferta');
$.ajax({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
url:'/check-disponibilidade-oferta',
type:'POST',
data:{
oferta_id: id
},
beforeSend:function(){
$('.carregando').fadeIn();
},
success:function(data){
$('.carregando').fadeOut();
console.log(data);
if(data.status){
window.location.href = "/oferta/" + data.slug;
}else{
alertUtil.alertError(data.message);
// window.location.href = "/contato?oferta=" + id;
}
},error:function(error){
$('.carregando').fadeOut();
alertUtil.alertError("Não há disponibilidade em estoque para este produto!");
}
});
});
/** click on fixed add to cart mobile */
$(document).on('click', '.fixed-buy .add-cart-mob', function(){
$([document.documentElement, document.body]).animate({
scrollTop: 350
}, 0);
$(".oferta-do-dia__info .add-cart").click();
});
$(document).on('click', '.oferta-do-dia__info .add-cart', function(){
var id = $(this).data('oferta');
var quantidade = $(this).closest('.oferta-do-dia__info').find('.quantidade').val();
var variacao = $(this).closest('.oferta-do-dia__info').find('.variacao').val();
var quantidade_by_client = $(this).closest('.oferta-do-dia__info').find('.quantidade_by_client').val();
var ocultar_desconto = "{{ request()->query('oc') }}";
if(parseInt(quantidade) > parseInt(quantidade_by_client)){
alertUtil.alertWarning('Oferta limitada a ' + quantidade_by_client + ' gr. por cliente');
}else{
$(this).attr('disabled', true);
$(this).addClass('btn-comprar--disable');
$.ajax({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
url:'/add-oferta-cart',
type:'POST',
data:{
oferta_id: id,
quantidade: quantidade,
ocultar_desconto: ocultar_desconto,
variacao: variacao
},
beforeSend:function(){
//$('.carregando').fadeIn();
},
success:function(data){
if(data.status){
window.location.href = "/checkout";
/*
//reloadListagem();
$('#listagem-cart').html(data.html);
$('#cart-empty').addClass('hidden');
$('#cart-section').removeClass('hidden');
$('#pagamento-section').removeClass('hidden');
$('[name="parcelas"]').html(data.parcelas);
alertUtil.alertSuccess(data.message);
reloadCart();
*/
}else{
alertUtil.alertError(data.message);
}
//$('.carregando').fadeOut();
}
});
}
});
$(document).on('change', '.select-produtos-combo', function(){
var id = $(this).find('option:selected').val();
$.ajax({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
url:'/oferta-do-dia/change-produto-combo',
type:'POST',
data:{
id_produto: id
},
beforeSend:function(){
//$('.carregando').fadeIn();
},
success:function(data){
if(data.status){
$('.info-produto').html(data.html);
}else{
alertUtil.alertError(data.message);
}
//$('.carregando').fadeOut();
}
});
});
</script>
<div class="spacer"></div>
@if($oferta_semana && $oferta_semana->estoque > 0)
<?php
$vinho_semana = $oferta_semana->produtos[0]->produto;
$imgFundo = (isset($oferta_semana->tema) && $oferta_semana->tema) ? config('filesystems.path') . "/tema/{$oferta_semana->tema->thumbnail_principal}" : url('img/site/banner.jpg');
?>
<style type="text/css">
.vinho-semana .foto{
background-image: url('<?php echo $imgFundo; ?>')
}
</style>
<h2 class="oferta-semana-title-home">VEJA TAMBÉM A <b>OFERTA DA SEMANA</b></h2>
<div class="vinho-semana">
<div class="container">
<div class="bloco">
<div class="foto">
<a href="{{ url('oferta-semana') }}">
<img src="<?php echo $oferta_semana->thumbnail_principal; ?>" alt="<?php echo $oferta_semana->titulo; ?>">
</a>
</div>
<div class="content">
<h3><a href="{{ url('oferta-semana') }}"><?php echo $oferta_semana->titulo; ?></a></h3>
<h4><?php echo $oferta_semana->sub_titulo; ?></h4>
<p> <?php echo formata_tags_texto($oferta_semana->texto); ?></p>
<a href="{{ url('oferta-semana') }}" class="leia-mais">Leia mais</a>
<div class="flex-content">
<div class="price">
<span class="apenas">Apenas</span>
<span>R$ <?php echo number_format($oferta_semana->preco_oferta,2,',','.'); ?></span>
</div>
<button class="comprar-semana">Adicionar ao carrinho</button>
<div class="atributos hidden">
<div class="flex-between itens-vinho" style="padding-top: 40px;">
<div class="origem__item">
<img src="{{ config('filesystems.path') . '/tipo-de-produto/' . $vinho_semana->tipo->thumbnail_principal }}" width="40" height="40" alt="<?php echo $vinho_semana->tipo->nome; ?>">
<div class="texto">
<p class="title">Tipo</p>
<p class="subtitle"><?php echo $vinho_semana->tipo->nome; ?></p>
</div>
</div>
<?php if($vinho_semana->paisOrigem){ ?>
<div class="origem__item">
<img src="uploads/pais/<?php echo $vinho_semana->paisOrigem->thumbnail_principal; ?>" alt="<?php echo $vinho_semana->paisOrigem->nome; ?>">
<div class="texto">
<p class="title">País</p>
<p class="subtitle"><?php echo $vinho_semana->paisOrigem->nome; ?></p>
</div>
</div>
<?php } ?>
<div class="separador"></div>
<div class="origem__item">
<img src="img/site/safra.svg" alt="Safra">
<div class="texto">
<p class="title">Safra</p>
<p class="subtitle"><?php echo $vinho_semana->caracteristicas->safra; ?></p>
</div>
</div>
<div class="origem__item">
<img src="img/site/teor.svg" alt="Teor Alcoólico">
<div class="texto">
<p class="title">Teor</p>
<p class="subtitle"><?php echo $vinho_semana->caracteristicas->teor_alcoolico; ?></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endif
@include('oferta._ofertas-relacionadas', ['ofertasRelacionadas' => $ofertasRelacionadas, 'canaisLiberados' => $canaisLiberados])
<script>
gtag('ec:addProduct', {
'id': '<?php echo $oferta->id; ?>',
'name': '<?php echo $oferta->titulo.' '.$oferta->sub_titulo; ?>',
'category': 'Oferta',
//'brand': '<?php //echo $produto->fornecedor->nome; ?>'
//'variant': 'black'
});
gtag('ec:setAction', 'detail');
gtag('send', 'pageview');
</script>
@if(isset($oferta) && $oferta != '' && $oferta->estoque > 0 && (
(($oferta->tipo == 'D' || $oferta->tipo == 'CS') && $oferta->data == date('Y-m-d')) ||
($oferta->tipo == 'E' && $oferta->data >= $date_limite_exclusiva) || ($oferta->tipo == 'M' && $oferta->data == date('Y-m-d') || ($oferta->tipo == 'S' && $oferta->data == $data_oferta_semana)) || (isset($canal) && $oferta->canalHasOferta && $oferta->canalHasOferta->data_inicial <= date('Y-m-d') && $oferta->canalHasOferta->data_final >= date('Y-m-d'))
))
<div class="fixed-buy">
<div class="price-content">
<?php if($oferta->preco_mercado != $oferta->preco_oferta):?>
<span class="prom">R$ <?php echo number_format($oferta->preco_mercado,2,',','.'); ?></span>
<b class="tag"><?php echo number_format($oferta->percentual_desconto,0); ?>% OFF</b>
<?php endif; ?>
<span class="preco">R$ <?php echo number_format($oferta->preco_oferta,2,',','.'); ?></span>
</div>
<button class="add-cart-mob">Adicionar</button>
</div>
<section class="buy_fixed_desk hide-mobile">
<script type="text/javascript">
$(document).on('ready', function(){
$('body').addClass('buy_fixed_desk_active')
$('.buy_fixed_desk .btn-comprar').click(function(){
var ocultar_desconto = "{{ request()->query('oc') }}";
var quantidade = $('.buy_fixed_desk .quantidade_oferta').val();
var quantidade_by_client = $('#quantidade_oferta_by_client').val();
if(parseInt(quantidade) > parseInt(quantidade_by_client)){
alertUtil.alertError('Esta oferta possui um limite máximo de ' + quantidade_by_client + ' gr. por cliente.');
}else{
$.ajax({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
url:'/add-oferta-dia',
type:'POST',
data:{
quantidade: quantidade,
ocultar_desconto: ocultar_desconto
},
beforeSend:function(){
$('.carregando').fadeIn();
},
success:function(data){
if(data.status){
window.location.href = "/checkout";
}else{
alertUtil.alertError(data.message);
$('.carregando').fadeOut();
}
}
});
}
});
});
</script>
<div class="container flex">
<div class="info_title">
<?php if($oferta->data): ?>
<h5 class="data"><?php echo date('j',strtotime($oferta->data)); ?>/<?php echo strftime('%b',strtotime($oferta->data)); ?></h5>
<?php endif; ?>
<h3 class="wine_title"><?php echo $oferta->titulo; ?></h3>
<h4 class="wine_subtitle"><?php echo $oferta->sub_titulo; ?></h4>
</div>
<div class="info_price_buttons">
<div class="info_price">
<div class="discount">
<?php if($oferta->preco_mercado != $oferta->preco_oferta):?>
<h4 class="old_price">R$ <?php echo number_format($oferta->preco_mercado,2,',','.'); ?></h4>
<div class="percent_off">
<h4 class="off_title .big"><?php echo number_format($oferta->percentual_desconto,0); ?>%</h4>
<h5 class="off_title .small">OFF</h5>
</div>
<?php endif; ?>
</div>
<h3 class="new_price">R$ <?php echo number_format($oferta->preco_oferta,2,',','.'); ?></h3>
</div>
<div class="info_buttons">
<div class="button_amount">
<select class="quantidade_oferta">
<option value="1" selected>1</option>
<?php if(isset($oferta->quantidade_maxima_por_cliente)): ?>
<?php for($i = 2; $i <= $oferta->quantidade_maxima_por_cliente; $i++): ?>
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
<?php endfor; ?>
<?php else: ?>
<?php for($a = 2; $a <= 10; $a++): ?>
<option value="<?php echo $a; ?>"><?php echo $a; ?></option>
<?php endfor; ?>
<?php endif; ?>
</select>
</div>
<div class="button_add">
<button class="btn-comprar add-oferta-dia" data-versao="op2">ADICIONAR</button>
</div>
</div>
</div>
</div>
</section>
@endif
@endsection