Superman Returns Online Gratuito
DOWNLOAD ::: https://fancli.com/2t1cgI
Peso bruto (cerca de) : 160gCapacidade: 450 MLMaterial: Pl\u00e1sticoTamanho (cerca de): 6.8*22cmEcologicamente Sustent\u00e1vel","seo_title":"GARRAFA DE \u00c1GUA SUPERMAN RETURNS","seo_description":"FRETE GR\u00c1TIS PARA TODO O BRASIL","price":11490,"compare_at_price":16999,"cost_per_item":null,"sku":null,"taxable":0,"barcode":null,"weight":null,"weight_unit":null,"requires_shipping":0,"inventory_policy":0,"quantity":0,"product_type_id":null,"vendor_id":null,"added_via":"nimble","published_at":"-0001-11-30 00:00:00","deleted_at":null,"created_at":"2020-08-11 20:58:10","updated_at":"2020-08-12 16:40:50","active":1,"active_for_bots":0,"simplybook_id":0,"minimum_quantity":0,"max_quantity":0,"minimum_quantity_count":0,"max_quantity_count":0,"total_units_sold":0,"images":[{"id":2645553,"src":"static\/products_images\/KjgyBvL32ozyXaitbQrHxGEHdrJIFV.jpg","alt":"","url":"https:\/\/assets.mycartpanda.com\/static\/products_images\/KjgyBvL32ozyXaitbQrHxGEHdrJIFV.jpg"}],"selected_or_first_available_variant":{"id":2598364,"product_id":371626,"default":0,"title":"450ml\/Importado","price":11490,"compare_at_price":16999,"cost_per_item":0,"sku":"200007238,10","aliexpress_sku":null,"position":3,"inventory_policy":1,"quantity":267,"prevent_out_of_stock_selling":0,"taxable":1,"barcode":null,"swatches":null,"length":null,"width":null,"height":null,"dimension_unit":null,"weight":0,"weight_unit":"kg","requires_shipping":0,"has_digital_attachment":0,"enabled_shopify_redirect":1,"created_at":"2020-08-11 20:58:11","updated_at":"2020-08-12 16:41:46","deleted_at":null,"orderby_position":"0","orderby_id":"3609413","option1":"450ml","option2":"Importado","available":true,"is_available":true,"options":["450ml","Importado"],"inventory_quantity":267,"image":{"id":2645553,"src":"static\/products_images\/KjgyBvL32ozyXaitbQrHxGEHdrJIFV.jpg","alt":"","url":"https:\/\/assets.mycartpanda.com\/static\/products_images\/KjgyBvL32ozyXaitbQrHxGEHdrJIFV.jpg"},"featured_image":{"id":2645553,"src":"static\/products_images\/KjgyBvL32ozyXaitbQrHxGEHdrJIFV.jpg","alt":"","url":"https:\/\/assets.mycartpanda.com\/static\/products_images\/KjgyBvL32ozyXaitbQrHxGEHdrJIFV.jpg"},"inventory_management":"cartx","variant_image":[{"product_image_id":2645553,"product_variant_id":2598364}],"product_variant_option_value":[{"id":4614327,"product_variant_id":2598364,"product_option_id":385135,"product_option_value_id":1799138,"created_at":"2020-08-11 20:58:11","updated_at":"2020-08-12 16:41:46","product_option_value":{"id":1799138,"option_id":385135,"value":"450ml","position":0,"created_at":"2020-08-11 20:58:10","updated_at":"2020-08-11 20:58:10"}},{"id":4614328,"product_variant_id":2598364,"product_option_id":385136,"product_option_value_id":1810275,"created_at":"2020-08-11 20:58:11","updated_at":"2020-08-12 16:41:46","product_option_value":{"id":1810275,"option_id":385136,"value":"Importado","position":0,"created_at":"2020-08-12 16:41:46","updated_at":"2020-08-12 16:41:46"}}]},"variants":[{"id":2598364,"product_id":371626,"default":0,"title":"450ml\/Importado","price":11490,"compare_at_price":16999,"cost_per_item":0,"sku":"200007238,10","aliexpress_sku":null,"position":3,"inventory_policy":1,"quantity":267,"prevent_out_of_stock_selling":0,"taxable":1,"barcode":null,"swatches":null,"length":null,"width":null,"height":null,"dimension_unit":null,"weight":0,"weight_unit":"kg","requires_shipping":0,"has_digital_attachment":0,"enabled_shopify_redirect":1,"created_at":"2020-08-11 20:58:11","updated_at":"2020-08-12 16:41:46","deleted_at":null,"orderby_position":"0","orderby_id":"3609413","option1":"450ml","option2":"Importado","available":true,"is_available":true,"options":["450ml","Importado"],"inventory_quantity":267,"image":{"id":2645553,"src":"static\/products_images\/KjgyBvL32ozyXaitbQrHxGEHdrJIFV.jpg","alt":"","url":"https:\/\/assets.mycartpanda.com\/static\/products_images\/KjgyBvL32ozyXaitbQrHxGEHdrJIFV.jpg"},"featured_image":{"id":2645553,"src":"static\/products_images\/KjgyBvL32ozyXaitbQrHxGEHdrJIFV.jpg","alt":"","url":"https:\/\/assets.mycartpanda.com\/static\/products_images\/KjgyBvL32ozyXaitbQrHxGEHdrJIFV.jpg"},"inventory_management":"cartx","variant_image":[{"product_image_id":2645553,"product_variant_id":2598364}],"product_variant_option_value":[{"id":4614327,"product_variant_id":2598364,"product_option_id":385135,"product_option_value_id":1799138,"created_at":"2020-08-11 20:58:11","updated_at":"2020-08-12 16:41:46","product_option_value":{"id":1799138,"option_id":385135,"value":"450ml","position":0,"created_at":"2020-08-11 20:58:10","updated_at":"2020-08-11 20:58:10"}},{"id":4614328,"product_variant_id":2598364,"product_option_id":385136,"product_option_value_id":1810275,"created_at":"2020-08-11 20:58:11","updated_at":"2020-08-12 16:41:46","product_option_value":{"id":1810275,"option_id":385136,"value":"Importado","position":0,"created_at":"2020-08-12 16:41:46","updated_at":"2020-08-12 16:41:46"}}]}],"currency":"R$","options":["Capacidade","Fornecedor"],"collections":[{"id":24492,"shop_id":9129,"title":"DC COMICS","description":null,"handle":"dc-comics","template_suffix":null,"seo_title":null,"seo_description":null,"active":1,"type":"manual","additional_data":"{}","deleted_at":null,"created_at":"2020-06-30 16:23:46","updated_at":"2020-06-30 16:23:46"},{"id":34260,"shop_id":9129,"title":"Garrafas","description":null,"handle":"garrafas","template_suffix":null,"seo_title":null,"seo_description":null,"active":1,"type":"manual","additional_data":"{}","deleted_at":null,"created_at":"2020-07-28 18:34:11","updated_at":"2020-07-28 18:34:11"}],"tags":["garrafa SUPERMAN","RETURNS","superman RETURNS","garrafa superman","garrafa superman RETURNS","garrafa RETURNS","garrafa \u00e1gua superman","garrafa \u00e1gua superman RETURNS"],"type":"","vendor":"","options_with_values":[{"id":385135,"product_id":371626,"name":"Capacidade","position":0,"created_at":"2020-08-11 20:58:10","updated_at":"2020-08-11 20:58:10","values":["450ml"]},{"id":385136,"product_id":371626,"name":"Fornecedor","position":0,"created_at":"2020-08-11 20:58:11","updated_at":"2020-08-11 20:58:11","values":["Importado"]}],"url":"\/products\/garrafa-de-agua-superman-returns","featured_image":{"id":2645553,"src":"static\/products_images\/KjgyBvL32ozyXaitbQrHxGEHdrJIFV.jpg","alt":"","url":"https:\/\/assets.mycartpanda.com\/static\/products_images\/KjgyBvL32ozyXaitbQrHxGEHdrJIFV.jpg"},"available":true,"reviews":{"0":{"id":41966,"product_id":371626,"user_id":null,"email":"saviolimapereira@hotmail.com","public_name":"S\u00e1vio Lima","rating":"5","status":"published","shop_id":9129,"title":"EXCELENTE","description":"\u00f3tima garrafinha, comprei pro meu filho ele gostou","created_at":"2020-09-09 14:25:45","updated_at":"2020-09-09 14:26:58","deleted_at":null},"disable":false,"product_path":"https:\/\/territoriogeekstore.com.br\/products\/garrafa-de-agua-superman-returns","counts":{"5":1},"percentages":{"5":"100%"},"total_rating_count":1,"data":{"count":[5,4,3,2,1]},"overall_stars":5,"overall_stars_new":5,"overall_remaining_stars":0,"all":[{"id":41966,"product_id":371626,"user_id":null,"email":"saviolimapereira@hotmail.com","public_name":"S\u00e1vio Lima","rating":"5","status":"published","shop_id":9129,"title":"EXCELENTE","description":"\u00f3tima garrafinha, comprei pro meu filho ele gostou","created_at":"2020-09-09 14:25:45","updated_at":"2020-09-09 14:26:58","deleted_at":null,"formatted_created_at":"09\/09\/2020","image":"https:\/\/assets.mycartpanda.com\/shop_9129\/png\/agddv_09-09-2020_0225.png","description_text_length":8,"availability":"S","file":{"id":37449,"shop_id":9129,"fileable_id":41966,"fileable_type":"App\\Models\\ProductReview","disk":"s3","collection":"shop_9129\/png","name":"agddv_09-09-2020_0225","file_name":"agddv_09-09-2020_0225.png","mime_type":"image\/png","size":980899,"created_at":"2020-09-09 14:25:46","updated_at":"2020-09-09 14:25:46"}}],"links":{},"product_reviews_js":{},"create_path":"https:\/\/territoriogeekstore.com.br\/products\/reviews\/create","toggle_date_visibility":false,"has_reviews":true,"total":true},"product_options":[{"id":385135,"product_id":371626,"name":"Capacidade","position":0,"created_at":"2020-08-11 20:58:10","updated_at":"2020-08-11 20:58:10"},{"id":385136,"product_id":371626,"name":"Fornecedor","position":0,"created_at":"2020-08-11 20:58:11","updated_at":"2020-08-11 20:58:11"}],"custom_options":[],"product_variants":[{"id":2598364,"product_id":371626,"default":0,"title":"450ml\/Importado","price":114.9,"compare_at_price":169.99,"cost_per_item":0,"sku":"200007238,10","aliexpress_sku":null,"position":3,"inventory_policy":1,"quantity":267,"prevent_out_of_stock_selling":0,"taxable":1,"barcode":null,"swatches":null,"length":null,"width":null,"height":null,"dimension_unit":null,"weight":0,"weight_unit":"kg","requires_shipping":0,"has_digital_attachment":0,"enabled_shopify_redirect":1,"created_at":"2020-08-11 20:58:11","updated_at":"2020-08-12 16:41:46","deleted_at":null}]}; var variants = [{"id":2598364,"product_id":371626,"default":0,"title":"450ml\/Importado","price":11490,"compare_at_price":16999,"cost_per_item":0,"sku":"200007238,10","aliexpress_sku":null,"position":3,"inventory_policy":1,"quantity":267,"prevent_out_of_stock_selling":0,"taxable":1,"barcode":null,"swatches":null,"length":null,"width":null,"height":null,"dimension_unit":null,"weight":0,"weight_unit":"kg","requires_shipping":0,"has_digital_attachment":0,"enabled_shopify_redirect":1,"created_at":"2020-08-11 20:58:11","updated_at":"2020-08-12 16:41:46","deleted_at":null,"orderby_position":"0","orderby_id":"3609413","option1":"450ml","option2":"Importado","available":true,"is_available":true,"options":["450ml","Importado"],"inventory_quantity":267,"image":{"id":2645553,"src":"static\/products_images\/KjgyBvL32ozyXaitbQrHxGEHdrJIFV.jpg","alt":"","url":"https:\/\/assets.mycartpanda.com\/static\/products_images\/KjgyBvL32ozyXaitbQrHxGEHdrJIFV.jpg"},"featured_image":{"id":2645553,"src":"static\/products_images\/KjgyBvL32ozyXaitbQrHxGEHdrJIFV.jpg","alt":"","url":"https:\/\/assets.mycartpanda.com\/static\/products_images\/KjgyBvL32ozyXaitbQrHxGEHdrJIFV.jpg"},"inventory_management":"cartx","variant_image":[{"product_image_id":2645553,"product_variant_id":2598364}],"product_variant_option_value":[{"id":4614327,"product_variant_id":2598364,"product_option_id":385135,"product_option_value_id":1799138,"created_at":"2020-08-11 20:58:11","updated_at":"2020-08-12 16:41:46","product_option_value":{"id":1799138,"option_id":385135,"value":"450ml","position":0,"created_at":"2020-08-11 20:58:10","updated_at":"2020-08-11 20:58:10"}},{"id":4614328,"product_variant_id":2598364,"product_option_id":385136,"product_option_value_id":1810275,"created_at":"2020-08-11 20:58:11","updated_at":"2020-08-12 16:41:46","product_option_value":{"id":1810275,"option_id":385136,"value":"Importado","position":0,"created_at":"2020-08-12 16:41:46","updated_at":"2020-08-12 16:41:46"}}]}]; var variant = first(variants); //call this function if indexes of variant are incorrect. It wil return first variant var contentID = (productData.added_via === 'woocommerce') ? variant.sku : productData.id; var title = "GARRAFA DE ÁGUA SUPERMAN RETURNS"; var currency = "R$"; var price = variant.price / 100; var product = { content_type: 'product_group', content_ids: [contentID], value: price, currency: "BRL", content_name: title, } if (typeof viewcontent_eventID == 'undefined') { var viewcontent_eventID = 'ef592d30-205b-4143-bfc7-b8ea7d58a427'; var addtocart_eventID = '3af6daad-c8f3-4d8f-8155-eafb180f13e7'; } if (typeof fbq != "undefined") { if (typeof viewcontent_eventID !== 'undefined' && viewcontent_eventID !== '' && viewcontent_eventID !== null) { fbq('track', 'ViewContent', product, { eventID: viewcontent_eventID}); } } if (typeof fb_pixel_option != 'undefined' && fb_pixel_option === 'api') { if (typeof viewcontent_eventID !== 'undefined' && viewcontent_eventID !== '' && viewcontent_eventID !== null) { fbPixelAPI('ViewContent', product, viewcontent_eventID, customerFb ? customerFb : {}); } } if(typeof title != 'undefined' && title) { setTimeout(function(){ var $obj = $('.btn-addtocart'); $obj.on('click', function(){ console.log('fbq'); if (typeof addtocart_eventID !== 'undefined' && addtocart_eventID !== '' && addtocart_eventID !== null) { fbq('track', 'AddToCart', { content_name: title, //content_category: collection_name, content_ids: [contentID], content_type: 'product', value: price, currency: "BRL" }, { eventID: addtocart_eventID}); } if (typeof fbPixelAPI != 'undefined' && typeof fb_pixel_option != 'undefined' && fb_pixel_option === 'api') { if (typeof addtocart_eventID !== 'undefined' && addtocart_eventID !== '' && addtocart_eventID !== null) { console.log('fbPixelAPI'); fbPixelAPI('AddToCart', { content_name: title, //content_category: collection_name, content_ids: [contentID], content_type: 'product', value: price, currency: "BRL" }, addtocart_eventID, customerFb ? customerFb : {}); } } }); }, 1000); }});function getCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return "";}function readCookie(name) { var nameEQ = escape(name) + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return unescape(c.substring(nameEQ.length, c.length)); } return null;} $(document).ready(function() { gtag('event', 'view_item', { "items": [ { "id": "371626", "name": "GARRAFA DE ÁGUA SUPERMAN RETURNS", "price": "114.9", "variant_id": "2598364", } ], ecomm_pagetype: 'product', ecomm_prodid: "371626", ecomm_totalvalue: "114.9" }); }); visitorcountr = true; .select_options .stickyaddtocart { pointer-events: none;} .fake_counter_p{width: 100%;float: left;margin-top: 10px;} .fake_counter_p img{margin-right:7px;vertical-align:middle;} .page-container { -ms-transform: none; -webkit-transform: none; transform: none; } .showdeltime, .fake_counter_p { font-family: inherit; } @media only screen and (min-width: 480px){ .showdeltime, .fake_counter_p{ font-size: px; } } .showdeltime .fa-plane, .fake_counter_p .fa-eye{ font-size: 20px; vertical-align: middle; margin-right: 7px; } @media screen and (max-width: 749px){ } .btn.cartx-btn-buy-it-now { background: #2879FE; color: #FFFFFF; border-radius: 6px; font-size: 15px; padding: 18px 20px; max-width: 100%; text-align: center; width: 100%; clear: both; float: none; display: block; max-height: 100%; height: auto; margin-top: 19px;} function checkRequiredFields(){ var elementExists = document.getElementById("custom-options-element"); /* console.log(elementExists) */ if(elementExists == null || elementExists == '' || elementExists == undefined){ return true; } let allAreFilled = true; document.getElementById("custom-options-element").querySelectorAll("[required]").forEach(function(i) { if (!allAreFilled) return; if (!i.value) allAreFilled = false; if (i.type === "radio") { let radioValueCheck = false; document.getElementById("custom-options-element").querySelectorAll(`[name="${i.name}"]`).forEach(function(r) { if (r.checked) radioValueCheck = true; }) allAreFilled = radioValueCheck; } }) if (!allAreFilled) { alert('Preencha os campos obrigatórios'); return false; }else{ return true; } } $(document).on('click','.cartx-btn-buy-it-now',function(e){ e.preventDefault(); if(checkRequiredFields()){ var form = $(this).closest('form'); formd = $(form).serialize(); console.log(formd); $.ajax({ type: "POST", url: '/cart/add.js', data: formd, success: function(data){ window.location.href="/checkout"; } }); } }) .button__container-main.hidden { display: none; height: 0;} .image__container img { max-width: 100%;} .image__container { margin-bottom: 12px;}.price__container { margin-top: 8px;} .text-bold { font-weight: 700; } .text-italic{ font-style: italic; } .text-center{ text-align: center; } .slick-slider-preview .slick-slide { margin: 0 15px; } .slick-slider-preview .slick-list { margin: 0 -15px; } .product-widgets-section .handpicked-widgets{ margin: 20px 0px; } .button__container-main { height: 40px;}.button__container-main .button__container { height: 0; -webkit-transition: all .3s ease; transition: all .3s ease; overflow: hidden; text-align: center;}.product__container:hover .button__container { height: 40px;}.preview-header { margin-bottom: 25px; margin-top: 25px;}.product-widgets-section [data-items="6"] .addtocart_btn,.product-widgets-section [data-items="5"] .addtocart_btn { max-width: 100%; font-size: 12px;}@media screen and (max-width: 767px) { .product-widget-btn{ font-size: 8px; } .button__container-main .button__container { height: auto; }} {{widget_header_title}} {{#items}} {{title}} {{price}} {{#if compare_at_price }} {{compare_at_price}} {{/if}} ADICIONAR AO CARRINHO {{/items}} $(document).ready(function(){ //console.log(''); var template = $('#page_name').attr('data-page'), cart_ids = ''; var selectors = { handpicked_template: '#handPickedproducts', handpicked_container: '#handpicked_products', bs_container : '#best_sellers_products', sm_container : '#products_from_same_collections', rc_container : '#recently_viewed_featured_product', wb_container : '#who_bought_also_bought', crc_container : '#cart_recommendations', }; var product_id = '371626', shop_id = '9129'; function addCommas(nStr) { nStr += ''; x = nStr.split('.'); x1 = x[0]; if(typeof x[1] != undefined && x[1] != "" && x[1] != null) { if(x[1].length == 1) { x2 = x.length >= 1 ? ',' + x[1]+'0' : ''; } else { x2 = x.length >= 1 ? ',' + x[1] : ''; } } else { x2 = x.length >= 1 ? ',00' : ''; } var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + '.' + '$2'); } var price = x1 + x2; return price; } function setCookie(name,value,days) { var expires = ""; if (days) { var date = new Date(); date.setTime(date.getTime() + (days*24*60*60*1000)); expires = "; expires=" + date.toUTCString(); } document.cookie = name + "=" + (value || "") + expires + "; path=/"; } function getCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function uniqueResult(list) { var result = []; $.each(list, function(i, e) { if ($.inArray(e, result) == -1) result.push(e); }); return result; } var recentViews = getCookie('recentViewsCartX'); if(recentViews === undefined || recentViews == '' || recentViews == null ){ var recentViews = []; if(product_id != "" && product_id !== undefined) recentViews.push(product_id); }else{ var recentViews = $.parseJSON(recentViews); if(product_id != "" && product_id !== undefined) recentViews.push(product_id); } var unique = uniqueResult(recentViews); setCookie('recentViewsCartX',JSON.stringify(unique),7); function buildWidgethandlpicked(data,products,cdn_url){ if(template !== 'product'){ return false; } //console.log(JSON.stringify(products)); var source = $(selectors.handpicked_template).html(); var hand_template = Handlebars.compile(source); var items = []; var item = {}; var adata = {}; var main_title_class = '', handpicked_header_size = data.handpicked_header_size, handpicked_header_color = data.handpicked_header_color, widget_header_title = data.widget_header_title, widget_max_product_per_slide = data.widget_max_product_per_slide, product_title_class = '', price_class = '', add_cart_btn_class = '', widget_product_price_color = data.best_seller_price_color; if(data.handpicked_header_text_bold == '1'){ main_title_class += ' text-bold '; } if(data.handpicked_header_text_italic == '1'){ main_title_class += ' text-italic '; } if(data.handpicked_header_text_underline == '1'){ main_title_class += ' text-underline '; } if(data.handpicked_header_alignment != undefined){ main_title_class += ' text-'+data.handpicked_header_alignment; } if(data.handpicked_product_title_text_bold == '1'){ product_title_class += ' text-bold '; } if(data.handpicked_product_title_text_italic == '1'){ product_title_class += ' text-italic '; } if(data.handpicked_product_title_text_underline == '1'){ product_title_class += ' text-underline '; } if(data.handpicked_product_title_alignment != undefined){ product_title_class += ' text-'+data.handpicked_product_title_alignment; } if(data.handpicked_product_price_text_bold == '1'){ price_class += ' text-bold '; } if(data.handpicked_product_price_text_italic == '1'){ price_class += ' text-italic '; } if(data.handpicked_product_price_text_underline == '1'){ price_class += ' text-underline '; } if(data.handpicked_product_price_alignment != undefined){ price_class += ' text-'+data.handpicked_product_price_alignment; } if(data.handpicked_add_cart_btn == '0'){ add_cart_btn_class += "hidden"; } $.each(products,function(i,item){ var image = ''; if(item.images !== undefined){ if(item.images.length > 0){ image = cdn_url+item.images[0].src; } } var compare_at_price = '', price = "R$ " + addCommas( parseFloat(item.variants[0].price).toFixed(2) ); if(item.variants[0].compare_at_price != undefined && item.variants[0].compare_at_price >item.variants[0].price ){ compare_at_price = "R$ " + addCommas( parseFloat( item.variants[0].compare_at_price).toFixed(2) ); } item = { title:item.title, image : image, product_title_class : product_title_class, price_class : price_class, add_cart_btn_class:add_cart_btn_class, widget_product_price_color:widget_product_price_color, widget_product_price_size:data.handpicked_product_price_size, widget_product_title_size:data.handpicked_product_title_size, widget_product_title_color:data.handpicked_product_title_color, price: price , compare_at_price: compare_at_price, first_variant : item.variants[0].id, handle:item.handle }; items.push(item); }) adata = { items: items, main_title_class: main_title_class, widget_header_color:handpicked_header_color, widget_header_size:handpicked_header_size, widget_header_title: widget_header_title, widget_max_product_per_slide : widget_max_product_per_slide, }; $(selectors.handpicked_container).append(hand_template(adata)); enableSlider(selectors.handpicked_container); } function enableSlider(selector){ var noi = parseInt($(selector).find('.slick-slider-preview').attr('data-items') ); console.log(noi) if(isNaN(noi)){ noi = 4; } var slickSlider = $(selector).find('.slick-slider-preview').slick({ slidesToShow:noi, slidesToScroll :noi, responsive: [ { breakpoint: 767, settings: { slidesToShow: 2, slidesToScroll: 2 } } ] }) } function buildBestsellers(data,products,cdn_url,container){ // console.log(JSON.stringify(data)); var source = $(selectors.handpicked_template).html(); var hand_template = Handlebars.compile(source); var items = []; var item = {}; var adata = {}; var main_title_class = '', handpicked_header_size = data.best_seller_header_size, handpicked_header_color = data.best_seller_header_color, widget_header_title = data.widget_header_title, widget_max_product_per_slide = data.widget_max_product_per_slide, product_title_class = '', price_class = '', add_cart_btn_class = '', widget_product_price_color = data.best_seller_price_color; if(data.best_seller_header_text_bold == '1'){ main_title_class += ' text-bold '; } if(data.best_seller_header_text_italic == '1'){ main_title_class += ' text-italic '; } if(data.best_seller_header_text_underline == '1'){ main_title_class += ' text-underline '; } if(data.best_seller_header_alignment != undefined){ main_title_class += ' text-'+data.best_seller_header_alignment; } if(data.best_seller_product_title_text_bold == '1'){ product_title_class += ' text-bold '; } if(data.best_seller_product_title_text_italic == '1'){ product_title_class += ' text-italic '; } if(data.best_seller_product_title_text_underline == '1'){ product_title_class += ' text-underline '; } if(data.best_seller_product_title_alignment != undefined){ product_title_class += ' text-'+data.best_seller_product_title_alignment; } // console.log(product_title_class) if(data.best_seller_product_price_text_bold == '1'){ price_class += ' text-bold '; } if(data.best_seller_product_price_text_italic == '1'){ price_class += ' text-italic '; } if(data.best_seller_product_price_text_underline == '1'){ price_class += ' text-underline '; } if(data.best_seller_product_price_alignment != undefined){ price_class += ' text-'+data.best_seller_product_price_alignment; } if(data.best_seller_add_cart_btn == '0'){ add_cart_btn_class += "hidden"; } $.each(products,function(i,item){ var image = ''; if(item.images !== undefined){ if(item.images.length > 0){ var src = item.images[0].src; src = src.indexOf('/') == 0 ? src.substring(1) : src; image = cdn_url+src; } } var compare_at_price = '', price = "R$ " + addCommas( parseFloat(item.variants[0].price).toFixed(2) ); if(item.variants[0].compare_at_price != undefined && item.variants[0].compare_at_price >item.variants[0].price ){ compare_at_price = "R$ " + addCommas( parseFloat( item.variants[0].compare_at_price).toFixed(2) ); } item = { title:item.title, image : image, product_title_class : product_title_class, price_class : price_class, add_cart_btn_class:add_cart_btn_class, widget_product_price_color:widget_product_price_color, widget_product_price_size:data.best_seller_product_price_size, widget_product_title_size:data.best_seller_product_title_size, widget_product_title_color:data.best_seller_product_title_color, price: price , compare_at_price: compare_at_price, first_variant : item.variants[0].id, handle:item.handle }; items.push(item); }) adata = { items: items, main_title_class: main_title_class, widget_header_color:handpicked_header_color, widget_header_size:handpicked_header_size, widget_header_title: widget_header_title, widget_max_product_per_slide : widget_max_product_per_slide, }; $(container).append(hand_template(adata)); enableSlider(container); } $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } }); //console.log(product_id+' '+shop_id); jQuery.ajax({ url: "/product-widget", data: {product_id:product_id,template:template,shop_id:shop_id,collections:[24492,34260],recent:recentViews,cart_items:cart_ids }, dataType: 'JSON', type: 'POST', success: function (data) { //console.log(JSON.stringify(data)) var widgets = data.widgets, cdn = data.cdn_url; $.each(widgets,function(i,item){ if(item.widget === 'handpicked_widgets'){ if(item.products.length > 0){ buildWidgethandlpicked(item.settings,item.products,cdn); } } if(item.widget === 'best_sellers_widgets'){ var container = selectors.bs_container; if(item.products.length > 0){ buildBestsellers(item.settings,item.products,cdn,container); } } if(item.widget === 'product_from_same_collection'){ var container = selectors.sm_container; //console.log(container); if(item.products.length > 0){ buildBestsellers(item.settings,item.products,cdn,container); } } if(item.widget === 'recently_viewed_featured_product'){ var container = selectors.rc_container; //console.log(item.products.length); if(item.products.length > 0){ buildBestsellers(item.settings,item.products,cdn,container); } } if(item.widget === 'who_bought_also_bought'){ var container = selectors.wb_container; //console.log(item.products.length); if(item.products.length > 0){ buildBestsellers(item.settings,item.products,cdn,container); } } if(item.widget === 'cart_recommendations'){ var container = selectors.crc_container; if(item.products.length > 0){ buildBestsellers(item.settings,item.products,cdn,container); } } }) }, error: function () { } }); $(document).on('click','.product-widget-btn',function(e){ e.preventDefault() var form = $(this).closest('form'), formd = $(form).serialize(); jQuery.ajax({ url: "/cart/add.js", data: formd, dataType: 'JSON', type: 'POST', success: function (data) { window.location.href="/cart"; } }); }); }); var livestock = false; var enable_defaul_variant = false; global_quantity = {}; global_quantity[2598364] = 267; window.addEventListener('DOMContentLoaded', function() { $(document).ready(function(){ $('.btn-addtocart').length && $('.tt-fixed-product-wrapper').length && initStickyAddToCart(); }) }); function initStickyAddToCart(){ $('.tt-back-to-top').length && $('.tt-back-to-top').remove(); var b = $('.btn-addtocart').first(), p = $('.tt-fixed-product-wrapper'), q = $('.tt-product-single-info'), c = q.find('.tt-input-counter').first(); $(window).resize(isatcResize); $(window).scroll(isatcScrollHandler); isatcResize(); isatcScrollHandler(); $('body').on('click', '.tt-fixed-product-wrapper .plus-btn', function(e){ c.find('.plus-btn').trigger('click'); p.find('.tt-input-counter').replaceWith(c.clone()); }) $('body').on('click', '.tt-fixed-product-wrapper .minus-btn', function(e){ c.find('.minus-btn').trigger('click'); p.find('.tt-input-counter').replaceWith(c.clone()); }) $('body').on('click', '.tt-fixed-product-wrapper .btn', function(e){ e.preventDefault(); b.trigger('click'); }) $('body').on('change', '.tt-fixed-product-wrapper .tt-input-counter input', function(e){ c.find('input').val($(this).val()).trigger('change'); p.find('.tt-input-counter').replaceWith(c.clone()); }) $('body').on('click focusout', '.tt-fixed-product-wrapper select', function(e){ if(e.type == 'click' && !p.find('form').hasClass('formactive')){ p.find('form').addClass('formactive'); return false; } p.find('form').removeClass('formactive'); }) $('body').on('change', '.tt-fixed-product-wrapper select', function(e){ setTimeout(function(){ p.find('.btn').replaceWith($('.btn-addtocart').first().clone().removeClass('btn-lg btn-addtocart addtocart-js').addClass('stickyaddtocart')); p.find('.tt-price').replaceWith(q.find('.tt-price').first().clone()); }, 200) }) function isatcResize(){ if($('.select_options').length) return false; var h = p.innerHeight() - 4; $('footer').css('padding-bottom', h); } function isatcScrollHandler(){ if($(window).scrollTop() > b.offset().top){ if(p.hasClass('atdshowed')) return false; var c_ = c.clone(); p.addClass('atdshowed').find('.tt-input-counter').replaceWith(c_); p.find('.tt-price').replaceWith(q.find('.tt-price').first().clone()); p.find('.btn').replaceWith($('.btn-addtocart').first().clone().removeClass('btn-lg btn-addtocart addtocart-js').addClass('stickyaddtocart')); $('.tt-promo-fixed').length && $('.tt-promo-fixed').css('bottom', p.innerHeight()+20); p.fadeIn(200); } else{ if(!p.hasClass('atdshowed')) return false; $('.tt-promo-fixed').length && $('.tt-promo-fixed').css('bottom', ''); p.removeClass('atdshowed').fadeOut(200); } } } var players = {}, playersMob = {}, mobileslider = false, youapiinited = false, armodels = {}; window.addEventListener('DOMContentLoaded', function() { $('[data-item-type]').length && initPrGalItemType(); $('.notstarted').length && $('.notstarted').on('click', function(e){ $(this).unbind('click'); $(this).removeClass('notstarted'); }) }); window.addEventListener('resize', function(){ if($(window).width() < 576){ mediaresizetomobile($('.mediaholder')); mediaresizetomobile($('.product-images-static')); } else{ if(mobileslider){ $('.tt-mobile-product-slider').find('video').each(function(){ $(this)[0].pause(); }) stopYouVideos(playersMob); } $('[data-item-type]').length && getMediaGalleryItem($('[data-item-type]').first().closest('ul').find('.zoomGalleryActive')); } }); window.addEventListener("mobile-slider-initialized", function(e){ mobileslider = e.detail; if(mobileslider.find('.pt-product-media-external').length == 0 || !youapiinited) return false; collectPlayersMob(mobileslider); }); function mediaresizetomobile($obj){ if(!$obj.length) return false; $obj.find('video').each(function(){ $(this)[0].pause(); }) stopYouVideos(players); } var tag = document.createElement('script'); tag.src = " _api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); function onYouTubeIframeAPIReady() { collectPlayersDesk($('.mediaholder')); collectPlayersDesk($('.product-images-static')); youapiinited = true; mobileslider && collectPlayersMob(mobileslider); } function collectPlayersDesk($obj){ if(!$obj.length) return false; $obj.find('.pt-product-media-external').each(function(){ var $this = $(this), videoId = $this.attr('data-video-id'); players[videoId] = new YT.Player($this.find('iframe')[0], {videoId: videoId}); }); } function collectPlayersMob($obj){ $obj.find('.pt-product-media-external').each(function(){ var $this = $(this), videoId = $this.attr('data-video-id'), i = $this.parent().attr('data-slick-index'); playersMob[i+videoId] = new YT.Player($this.find('iframe')[0], {videoId: videoId}); }); $obj.on('beforeChange', function(event, slick, currentSlide, nextSlide){ if(currentSlide == nextSlide) return true; var p = $(this).find('[data-slick-index="'+currentSlide+'"]'), v = false; v = p.find('.pt-product-media-external'); if(v.length){ var videoId = v.attr('data-video-id'); playersMob[currentSlide+videoId].pauseVideo(); } v = p.find('.pt-product-media-internal'); if(v.length){ v.find('video')[0].pause(); } }); $obj.on('afterChange', function(event, slick, currentSlide){ var $this = $(this); var p = $this.find('[data-slick-index="'+currentSlide+'"]'), v = false; v = p.find('.pt-product-media-external'); if(v.length){ var videoId = v.attr('data-video-id'); playersMob[currentSlide+videoId].playVideo(); } v = p.find('.pt-product-media-internal'); if(v.length){ v.find('video')[0].play(); } v = p.find('.pt-product-media-model'); if(v.length && v.find('model-viewer').attr('reveal') != "auto"){ armodels[currentSlide+v.find('model-viewer').attr('data-model-id')].play(); } }); } function initPrGalItemType(){ $('[data-item-type]').click(function(e){ getMediaGalleryItem($(this)); }) } /**/ function getMediaGalleryItem($this){ if(!$this.attr('data-item-type')) return false; if($this.attr('data-item-type') == 'image'){ $(".zoom-product").attr('src', $this.attr('data-image')).attr('data-zoom-image', $this.attr('data-zoom-image')); showMediaHolderOnProductPage(false) return true; } showMediaHolderOnProductPage(true, $this.attr('data-target')); } function showMediaHolderOnProductPage(val, attr){ val = val || false; var $mh = $('.mediaholder'), $mhall = $mh.find('[data-target-id]'), $mhcur = $mh.find('[data-target-id='+attr+']'); $mhall.length && $mhall.hide(); $mh.find('video').each(function(){ $(this)[0].pause(); }) stopYouVideos(players); if(val){ $('.mediaimageholder').hide(); $mh.show(); $mhcur.show(); $mhcur.find('video').length && $mhcur.find('video')[0].play(); var y = $mhcur.find('iframe'); if(y.length){ var videoId = $mhcur.attr('data-video-id'); players[videoId].playVideo(); } } else{ $('.mediaimageholder').show(); $mh.hide(); } } function stopYouVideos(players){ if(Object.keys(players).length === 0) return false; Object.keys(players).forEach(function(key) { if (typeof players[key].pauseVideo === "function") { players[key].pauseVideo(); } }); } /* arrows for big image in gallery */ window.addEventListener("desktop-slider-initialized", function(e){ var $this = e.detail; if(!$('#custom-product-item').length) return false; var l = $this.find('.slick-slide').length-1; $('#custom-product-item').addClass('tt-show'); $('#custom-product-item').find('.slick-next').on('click',function(e){ var c = Number($this.find('.zoomGalleryActive').parent().attr('data-slick-index')) + 1; c = c > l ? 0 : c; $this.find('[data-slick-index="'+c+'"] a').trigger('click'); }); $('#custom-product-item').find('.slick-prev').on('click',function(e){ var c = Number($this.find('.zoomGalleryActive').parent().attr('data-slick-index')) - 1; c = c 2b1af7f3a8