View Snippet
{"component":{"id":430,"name":"ct_section","options":{"ct_id":430,"ct_parent":100026,"selector":"section-430-555","original":{"container-padding-bottom":"71"},"nicename":"Section (#430)","activeselector":""},"depth":4,"children":[{"id":431,"name":"ct_code_block","options":{"ct_id":431,"ct_parent":430,"selector":"code_block-431-555","original":{"code-php":"<!-------->","code-css":".woo4-container:hover .woo4-background{\n transform: scale(1.1);\n}\n.woo4-container_precios{\n display:flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n gap: 20px;\n font-size: 20px;\n font-weight: 500;\n font-family: 'Poppins';\n}\n.woo4-precio_normal{\n font-size: 16px;\n font-weight: 400;\n text-decoration:line-through;\n color: rgba(0,0,0, .5);\n}\n.woo4-descuento{\n display:flex;\n flex-direction: row;\n gap: 10px;\n background: #f97639;\n padding: 6px 12px;\n align-items:center;\n justify-content: center;\n font-family: 'Poppins';\n height:50px;\n position: absolute;\n top: 15px;\n left: -60px;\n min-width: 200px;\n color: #ffffff;\n font-weight: 500;\n font-size: 15px;\n transform: rotate(-45deg);\n /*transition: .7s cubic-bezier(0.21, 0.45, 1, 0.78);*/\n}","code-js":"document.addEventListener('DOMContentLoaded',()=>{\n const divAs = document.querySelectorAll('.woo4-container'),\n divBs= document.querySelectorAll('.woo4-background'),\n divDs = document.querySelectorAll('div[data-imgs]')\n let ant, nuv\n\n divAs.forEach((d, index)=>{\n d.addEventListener('mouseover', ()=>{\n ant = divBs[index].style.backgroundImage\n nuv = divDs[index].dataset.imgs\n divBs[index].style.backgroundImage = `url(${nuv})`\n\n })\n d.addEventListener('mouseout', ()=>{\n divBs[index].style.backgroundImage = ant\n })\n })\n})"},"nicename":"Code Block (#3)"},"depth":5},{"id":432,"name":"oxy_dynamic_list","options":{"ct_id":432,"ct_parent":430,"selector":"_dynamic_list-432-555","original":{"wp_query_advanced_preset":"Custom Settings","wp_query_advanced":[{"key":"post_type","values":[{"value":"product"}]},{"key":"posts_per_page","values":[{"value":"4"}]},{"key":"no_found_rows","values":[{"value":"true"}]},{"key":"orderby","values":[{"value":"date"}]}],"display":"grid","grid-column-count":"4","wp_query":"advanced"},"nicename":"Repeater (#3)"},"depth":5,"children":[{"id":433,"name":"ct_div_block","options":{"ct_id":433,"ct_parent":432,"selector":"div_block-433-555","original":{"padding-top":"0","padding-right":"0","padding-left":"0","margin-top":"0","margin-right":"0","margin-left":"0","overflow":"hidden","margin-bottom":"0"},"nicename":"Div (#4)"},"depth":6,"children":[{"id":434,"name":"ct_div_block","options":{"ct_id":434,"ct_parent":433,"selector":"div_block-434-555","original":{"padding-bottom":"20","position":"relative"},"nicename":"woo4-container","classes":["woo4-container"]},"depth":7,"children":[{"id":435,"name":"ct_div_block","options":{"ct_id":435,"ct_parent":434,"selector":"div_block-435-555","original":{"width":"100","width-unit":"%","max-height-unit":"%","height":"100","height-unit":"%","overflow":"hidden"},"nicename":"Div Imagen"},"depth":8,"children":[{"id":436,"name":"ct_div_block","options":{"ct_id":436,"ct_parent":435,"selector":"div_block-436-555","original":{"background-image":"[oxygen ct_sign_sha256='edb5b3d8272dea5067ab4354be942b486e8d478c795de1750b02157f1cbd6bde' data='featured_image' ]","background-imagedynamic":true,"background-size":"contain","background-repeat":"no-repeat","background-position-left-unit":" ","background-position-left":"center","background-position-top-unit":" ","background-position-top":"center"},"nicename":"woo4-background","classes":["woo4-background"],"activeselector":false},"depth":9}]},{"id":437,"name":"ct_div_block","options":{"ct_id":437,"ct_parent":434,"selector":"div_block-437-555","original":{"flex-direction":"column","display":"flex","text-align":"left","align-items":"center","gap":"5","justify-content":"space-between","width":"100","width-unit":"%","height":"100","height-unit":"%"},"nicename":"Div (#160)"},"depth":8,"children":[{"id":438,"name":"ct_div_block","options":{"ct_id":438,"ct_parent":437,"selector":"div_block-438-555","original":{"text-align":"left","align-items":"center"},"nicename":"Div (#284)","activeselector":""},"depth":9,"children":[{"id":439,"name":"ct_headline","options":{"ct_id":439,"ct_parent":438,"selector":"headline-439-555","original":{"tag":"h4","font-size":"16","text-align":"center","width":"100","width-unit":"%","padding-left":"5","padding-right":"5","color":"rgba(0,0,0,0.51)"},"nicename":"Heading (#32)","ct_content":"<span id=\"ct-placeholder-440\"></span>"},"depth":10,"children":[{"id":440,"name":"ct_span","options":{"ct_id":440,"ct_parent":439,"selector":"span-440-555","original":[],"nicename":"Span (#39)","ct_content":"[oxygen ct_sign_sha256='e7b83ec3eefe48eb981b34e53e9b27a331e55e04bb3b90b7165f98478e10a2eb' data='title' ]"},"depth":11}]},{"id":441,"name":"ct_code_block","options":{"ct_id":441,"ct_parent":438,"selector":"code_block-441-555","original":{"unwrap":"false","code-php":"<?php\n $cates = wp_get_post_terms( get_the_ID(), 'product_cat' ); // Obtén las categorías del producto\n $link_cates = array();\n foreach ( $cates as $cate ) {\n $enlace = get_term_link( $cate );\n $link_cates[] = '<a class=\"woo4-link_cate\" href=\"' . $enlace . '\">' . $cate->name . '</a>';\n }\n echo '<div class=\"woo4-div-cates\">' .implode( ', ', $link_cates ).'</div>'; \n?>"},"nicename":"Categorias"},"depth":10},{"id":442,"name":"ct_text_block","options":{"ct_id":442,"ct_parent":438,"selector":"text_block-442-555","original":{"tag":"p","custom-css":"","width":"80","width-unit":"%"},"nicename":"Text (#286)","ct_content":"<span id=\"ct-placeholder-443\"></span>"},"depth":10,"children":[{"id":443,"name":"ct_span","options":{"ct_id":443,"ct_parent":442,"selector":"span-443-555","original":{"custom-css":" display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical; \n overflow: hidden;"},"nicename":"Span (#292)","ct_content":"[oxygen ct_sign_sha256='7e49c0bbe33d521f367719cf51635e5d880cad0f8dd0ff08fabfd782f554e45e' data='excerpt' ]"},"depth":11}]}]},{"id":444,"name":"ct_div_block","options":{"ct_id":444,"ct_parent":437,"selector":"div_block-444-555","original":{"width":"100","width-unit":"%","flex-direction":"column","display":"flex","align-items":"center","gap":"20"},"nicename":"Div (#298)"},"depth":9,"children":[{"id":445,"name":"ct_code_block","options":{"ct_id":445,"ct_parent":444,"selector":"code_block-445-555","original":{"code-php":"<?php\n$laId = get_the_ID();\n\n$precNormal = get_post_meta( $laId, '_regular_price', true ); \n$precOferta = get_post_meta( $laId, '_sale_price', true ); \n$precio = get_post_meta( $laId, '_price', true ); \n$sale_start_date = get_post_meta( $laId, '_sale_price_dates_from', true ); \n$sale_end_date = get_post_meta( $laId, '_sale_price_dates_to', true ); \n$moneda = get_woocommerce_currency_symbol();\n\n$imGids = get_post_meta( $laId, '_product_image_gallery', true );\n$nombre = get_the_title($laId);\n\nif ( $imGids ) {\n $imgId = explode( ',', $imGids )[0];\n $imgId = wp_get_attachment_image_url( $imgId);\n}else{\n $imagen_destacada_src = wp_get_attachment_image_src(get_post_thumbnail_id($laId), 'full');\n $imgId = $imagen_destacada_src[0];\n}\n?>\n<div class=\"woo4-container_precios\">\n\n<?php \n if( $precOferta > 0) {\n $porcent = '-'.ceil(($precNormal - $precOferta) / $precOferta * 100) .'%';\n echo '<div class=\"woo4-descuento\">'.$porcent.'</div>';\n echo '<div class=\"woo4-precio_normal\">'. $precNormal .'<span class=\"woo4-span_moneda\">'.$moneda. '</span></div>'; \n }\n \n?>\n <div class=\"woo4-precio_desc\" data-imgs=\"<?php echo $imgId; ?> \">\n <?php echo $precio .'<span class=\"woo4-span_moneda\">'.$moneda. '</span>'; ?>\n </div> \n\n</div> <!---- Final precios -->\n","width-unit":"%","padding-top":"0"},"nicename":"Oferta"},"depth":10},{"id":446,"name":"ct_link_text","options":{"ct_id":446,"ct_parent":444,"selector":"link_text-446-555","original":{"url":"[oxygen ct_sign_sha256='ffa65a501b96d267bece4ca43bc8d0135243cce91f395563019f55f46d41b78b' data='permalink' ]","font-family":"Roboto","color":"#ffffff","hover_color":"#f97639","font-size":"20","background-color":"#f97639","width-unit":"%","width":"80","text-align":"center","border-radius":"5","transition-duration":".5","border-top-color":"#f97639","border-right-color":"#f97639","border-bottom-color":"#f97639","border-left-color":"#f97639","border-all-color":"#f97639","border-top-width":"1","border-right-width":"1","border-bottom-width":"1","border-left-width":"1","border-all-width":"1","border-top-style":"solid","border-right-style":"solid","border-bottom-style":"solid","border-left-style":"solid","border-all-style":"solid"},"nicename":"Text Link (#271)","ct_content":"Ver Producto","classes":[],"hover":{"color":"#f97639","border-top-color":"#f97639","border-right-color":"#f97639","border-bottom-color":"#f97639","border-left-color":"#f97639","border-all-color":"#f97639","background-color":"#ffffff","transition-duration":".5"}},"depth":10}]}]}]}]}]}]},"classes":{"woo4-container":{"key":"woo4-container","original":{"width-unit":"%","overflow":"hidden","flex-direction":"column","display":"flex","align-items":"center","border-top-color":"rgba(0,0,0,0.26)","border-right-color":"rgba(0,0,0,0.26)","border-bottom-color":"rgba(0,0,0,0.26)","border-left-color":"rgba(0,0,0,0.26)","border-all-color":"rgba(0,0,0,0.26)","border-top-width":"1","border-right-width":"1","border-bottom-width":"1","border-left-width":"1","border-all-width":"1","border-top-style":"solid","border-right-style":"solid","border-bottom-style":"solid","border-left-style":"solid","border-all-style":"solid","border-top-left-radius":"5","border-top-right-radius":"5","width":"100","justify-content":"space-between","height":"560"},"hover":{"box-shadow-color":"rgba(0,0,0,0.2)","box-shadow-horizontal-offset":"0","box-shadow-vertical-offset":"0","box-shadow-blur":"3","box-shadow-spread":"2"}},"woo4-background":{"key":"woo4-background","original":{"width-unit":"%","background-position-left-unit":" ","background-position-top-unit":" ","background-imagedynamic":"1","width":"100","height":"300","transition-duration":".5","padding-top":"0","padding-right":"0","padding-bottom":"0","padding-left":"0","margin-top":"0","margin-right":"0","margin-bottom":"0","margin-left":"0","background-image":"[oxygen data='featured_image']"},"activeselector":{}}}}