Advertisement
cesarnascimento

Untitled

Oct 13th, 2021
1,407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //css
  2. .cro-product-info {
  3.     background: #B9E886;
  4.     padding: 15px 15px 30px;
  5.     min-height: 200px;
  6. }
  7. .cro-product-title {
  8.     font-weight: bold;
  9.     color: #454545;
  10.     font-size: 18px;
  11.     margin: 0;
  12.     margin-bottom: 10px;
  13.     text-align: left;
  14. }
  15. .cro-product-title img {
  16.     margin-right: 10px;
  17. }
  18. .cro-product-data {
  19.     background: #fff;
  20.     border-radius: 15px;
  21.     padding: 20px 15px 15px;
  22.     display: flex;
  23. }
  24. .cro-product-data h3 {
  25.     margin: 0;
  26. }
  27. .cro-content-holder {
  28.     text-align: left;
  29. }
  30. .cro-image-holder img {
  31.     max-width: 100px;
  32.     max-height: 100px;
  33.     margin-right: 10px;
  34. }
  35. .cro-price {
  36.     color: #087DC5;
  37.     font-weight: bold;
  38.     font-size: 21px;
  39. }
  40. .cro-sub {
  41.     color: #087DC5;
  42.     font-weight: bold;
  43. }
  44. .cro-sub span {
  45.     color: #454545;
  46. }
  47. .cro-star-wrappers img {
  48.     margin-top: 5px;
  49. }
  50. .cro-related-products {
  51.     padding: 15px;
  52. }
  53. .cro-related-title {
  54.     margin: 0;
  55.     margin-bottom: 20px;
  56.     text-align: left;
  57. }
  58. .owl-carousel .owl-item .item {
  59.     border: 1px solid #eee;
  60.     border-radius: 10px;
  61.     height: 250px;
  62.     padding: 10px;
  63.     position: relative;
  64. }
  65. .cro-product-info-slider {
  66.   display: flex;
  67.     flex-direction: column;
  68.     align-items: center;  
  69. }
  70. .cro-product-info-slider img {
  71.     width: 60%;
  72. }
  73. .cro-product-title-secondary {
  74.   color: #262626;
  75.     font-weight: normal;
  76.     text-align: left;
  77.     font-size: 12px;  
  78. }
  79. .cro-product-price-wrapper {
  80.     display: flex;
  81.     width: 100%;
  82. }
  83. .cro-product-price {
  84.     font-size: 18px;
  85.     color: #007DC5;
  86.     font-weight: bold;
  87. }
  88. .cro-product-bottom {
  89.     position: absolute;
  90.     bottom: 0;
  91.     width: 100%;
  92.     left: 0;
  93.     background: #EFFBFF;
  94.     border-bottom-right-radius: 10px;
  95.     border-bottom-left-radius: 10px;
  96.     padding-top: 5px;
  97. }
  98. .cro-product-bottom-price {
  99.         color: #007CC5;
  100.     font-weight: bold;
  101.     font-size: 12px;
  102.     text-align: left;
  103.         display: flex;
  104.     align-items: center;
  105.     margin-left: 17px;
  106. }
  107. .cro-product-bottom-price img {
  108.     margin: 0 5px;
  109.     height: 100%;
  110. }
  111. .cro-product-bottom p {
  112.     text-align: left;
  113.     margin-left: 17px;
  114.     margin-top: 0;
  115.     font-size: 10px;
  116. }
  117. .cro-categories {
  118.     border-top: 1px solid #eee;
  119.     padding-top: 20px;
  120. }
  121. .cro-categories-title {
  122.         color: #087DC5;
  123.     font-size: 21px;
  124.     font-weight: bold;
  125.     margin: 0;
  126. }
  127. //css
  128. //js
  129. function comprarAgora2(button) {
  130.           //cart icon value handler
  131.           setTimeout(function() {
  132.             if ($(".badge-cart").length > 0) {
  133.               const badgeCartValue = $('.badge-cart').html();
  134.               const formattedCartValue = parseInt(badgeCartValue) || 0;
  135.               console.log(formattedCartValue, "formattedCartValue")
  136.               const addedQuantity = $('#qtd').val();
  137.               const formattedAddedQuantity = parseInt(addedQuantity);
  138.               console.log(formattedAddedQuantity, "formattedAddedQuantity")
  139.               const finalQuantity = formattedAddedQuantity + formattedCartValue;
  140.               console.log(finalQuantity, "finalQuantity")
  141.               $('.badge-cart').html(finalQuantity);
  142.             }
  143.           }, 3000);
  144.           if ($(".badge-cart").length <= 0) {
  145.             $(".icon-carrinho").append("<span class='badge-cart'></span>");
  146.           }
  147.           //cart icon value handler
  148.           clickDataLayer();
  149.           $(button).html("Aguarde...");
  150.           $(".add-product").html("<img class='loading-img' src='https://i.imgur.com/CsD32w4.png' alt='Loading' />Adicionando o produto ao carrinho");
  151.           var idthrobber = "";
  152.           try {
  153.             idthrobber = callThrobber();
  154.           } catch (e) {}
  155.           var idProduto = window.location.href.split('-').pop();;
  156.           jQuery.ajax({
  157.             url: "/comprarAgora_Loja.html?prod=" + idProduto + "&qtde=" + $("#qtd").val(),
  158.             success: function(data) {
  159.               if (idthrobber != "")
  160.                 closeThrobber(idthrobber);
  161.               setTimeout(function() {
  162.                 $(".add-product").html("<img src='https://i.imgur.com/0d6mbzp.png' alt='Loading' />Produto adicionado");
  163.               }, 1000);
  164.               setTimeout(function() {
  165.                 $(button).html("Adicionar ao carrinho");
  166.               }, 3000);
  167.               isAdded = true;
  168.               window.location.href;
  169.             }
  170.           });
  171.         }
  172.         $(document).ready(function() {
  173.                     //add owl carousel
  174.         const scriptEl = document.createElement('script');
  175.         scriptEl.src = 'https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.js';
  176.         document.head.appendChild(scriptEl);
  177.     //add owl carousel
  178.           $('.cart-nav-button button').removeAttr(Object.values($('.cart-nav-button button').get(0).attributes).map(attr => attr.name).join(' '));
  179.           $(".cart-nav-button button").click(function(e) {
  180.             const btn = this;
  181.             $('#fundo_modal').fadeIn()
  182.             e.preventDefault();
  183.           //  setTimeout(function() {
  184.           //    comprarAgora2(btn);
  185.           //  }, 500);
  186.           });
  187.  
  188.           var modal_estilos = 'display: block;' +
  189.             'width: 100%; max-width: 600px;' +
  190.             'background: #fff;' +
  191.             'position: fixed;height: 95%;' +
  192.             'top: 53%; left: 50%;' +
  193.             'transform: translate(-50%,-50%);' +
  194.             'z-index: 99999999; text-align: center';
  195.  
  196.           var fundo_modal_estilos = 'top: 0; right: 0;' +
  197.             'bottom: 0; left: 0; position: fixed;' +
  198.             'background-color: rgba(0, 0, 0, 0.6); z-index: 99999999;' +
  199.             'display: none;';
  200.  
  201.           var meu_modal = `<div id="fundo_modal" style="${fundo_modal_estilos}">
  202.             <div id="meu_modal" style="${modal_estilos}">
  203.             <div class="cro-product-info">
  204.                 <h1 class="cro-product-title"><img src="https://i.imgur.com/dSX4lDM.png" alt="Produto adicionado" />Produto adicionado com sucesso &nbsp; &nbsp;(1un.)</h1>
  205.                 <div class="cro-product-data">
  206.                 <div class="cro-image-holder">
  207.                 <img src="https://via.placeholder.com/100x100" alt="Imagem do produto" />
  208.                 </div>
  209.                 <div class="cro-content-holder">
  210.                 <h3 class="cro-product-data-title">Fleegard Spray</h3>
  211.                 <div class="cro-star-wrappers"><img src="https://i.imgur.com/0lItBxy.png" alt="Nota do produto" /></div>
  212.                 <p class="cro-price">R$ 67,50</p>
  213.                 <p class="cro-sub">R$ 60,75 10% OFF <span class="cro-for-subs">para assinantes</span></p>
  214.                 </div>
  215.                 </div>
  216.             </div>
  217.             <div class="cro-related-products">
  218.             <h3 class="cro-related-title">Quem comprou se interessou por:</h3>
  219.             <div class="owl-carousel owl-theme" items="2">
  220.                 <div class="item">
  221. <div class="cro-product-info-slider">
  222.     <img src="https://via.placeholder.com/100x100" alt="Imagem do produto">
  223.     <h4 class="cro-product-title-secondary">Ração Premier Fórmula para Cães Filhotes de Raças Grandes Sabor...</h4>
  224.     <div class="cro-product-price-wrapper">
  225.         <p class="cro-product-price">R$ 123</p>
  226.     </div>
  227. </div>
  228.     <div class="cro-product-bottom">
  229.         <div class="cro-product-bottom-price">
  230.             R$ 123 <img src="https://i.imgur.com/JThKBEL.png" alt="Icone de assinatura" /> 10% OFF
  231.         </div>
  232.         <p>para assinantes</p>
  233.     </div>
  234. </div>
  235.                 <div class="item"><h4>2</h4></div>
  236.                 <div class="item"><h4>3</h4></div>
  237.                 <div class="item"><h4>4</h4></div>
  238.                 <div class="item"><h4>5</h4></div>
  239.                 <div class="item"><h4>6</h4></div>
  240.                 <div class="item"><h4>7</h4></div>
  241.                 <div class="item"><h4>8</h4></div>
  242.                 <div class="item"><h4>9</h4></div>
  243.                 <div class="item"><h4>10</h4></div>
  244.                 <div class="item"><h4>11</h4></div>
  245.                 <div class="item"><h4>12</h4></div>
  246.             </div>
  247.             </div>
  248.             <div class="cro-categories">
  249.                 <h3 class="cro-categories-title">Categorias</h3>
  250.                 <div class="owl-carousel owl-theme" items="3">
  251.                     <div class="item">fffffffff<h4>aaaaaaaaaaa</h4></div>
  252.                     <div class="item"><h4>2</h4></div>
  253.                     <div class="item"><h4>3</h4></div>
  254.                     <div class="item"><h4>4</h4></div>
  255.                     <div class="item"><h4>5</h4></div>
  256.                     <div class="item"><h4>6</h4></div>
  257.                     <div class="item"><h4>7</h4></div>
  258.                     <div class="item"><h4>8</h4></div>
  259.                     <div class="item"><h4>9</h4></div>
  260.                     <div class="item"><h4>10</h4></div>
  261.                     <div class="item"><h4>11</h4></div>
  262.                     <div class="item"><h4>12</h4></div>
  263.                 </div>
  264.             </div>
  265.             <div class="cro-footer">
  266.                 Continuar Comprando
  267.             </div>
  268.             </div></div>`;
  269.           $("body").append(meu_modal);
  270.           setTimeout(function() {
  271.               $('.owl-carousel').owlCarousel({
  272.                 loop:true,
  273.                 margin: 20,
  274.                 dots: false,
  275.                 nav:false,
  276.                 autoplay: false,
  277.                 items: 2,
  278.                 stagePadding: 20
  279.             });
  280.             //$('.owl-carousel').owlCarousel({
  281.             //    loop:true,
  282.             //    margin: 20,
  283.             //    dots: false,
  284.             //    nav:false,
  285.             //    autoplay: false,
  286.             //    items: $(".owl-carousel").data("items"),
  287.             //    stagePadding: 20
  288.             //});
  289.           },500)
  290.           $("#fundo_modal, .close").click(function() {
  291.             $("#fundo_modal").hide();
  292.           });
  293.           $("#meu_modal").click(function(e) {
  294.             e.stopPropagation();
  295.           });
  296.         });
  297.  
  298.         $(document).on("ready", "#callAlertLimbo", function() {
  299.           $(this).remove();
  300.         });
  301.  
  302. //js
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement