/** * Caja de precios dinamica - Link Computer Pereira * - Categoria COMPUTADORES (pc-de-mesa, portatiles, todo-en-uno, pc-gamer): * Contado = costo + $150.000 | Credito = costo x 1.25 * - Resto de categorias: * Contado = precio actual x 0.75 | Credito = precio actual */add_action( 'wp', function() { remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 ); });add_action( 'woocommerce_single_product_summary', 'lc_caja_precios_personalizada', 10 ); function lc_caja_precios_personalizada() { global $product; if ( ! $product ) return;$precio_regular = $product->get_regular_price(); if ( ! $precio_regular ) return;$categorias_computadores = array( 'pc-de-mesa', 'portatiles-pereira-linkcomputer', 'todo-en-uno-computadores-pereira-linkcomputer', 'pc-gamer-pereira-colombia', );$es_computador = has_term( $categorias_computadores, 'product_cat', $product->get_id() );if ( $es_computador ) { $costo = $precio_regular / 1.25; $precio_contado = $costo + 150000; $precio_credito = $precio_regular; } else { $precio_credito = $precio_regular; $precio_contado = $precio_regular * 0.75; }$fmt_credito = number_format( (float) $precio_credito, 0, ',', '.' ); $fmt_contado = number_format( (float) $precio_contado, 0, ',', '.' );$wa_texto = rawurlencode( 'Hola, quiero comprar: ' . get_the_title() ); $url_addi = 'https://linkcomputer.com.co/wp-content/uploads/2026/07/ADDI-LOGO-.png'; $url_brilla = 'https://linkcomputer.com.co/wp-content/uploads/2026/07/logo-brilla-scaled.png';$html = '
'; $html .= '
'; $html .= 'Precio Total'; $html .= '$' . esc_html( $fmt_credito ) . ''; $html .= '
'; $html .= '
'; $html .= 'Precio exclusivo transferencia y efectivo'; $html .= '$' . esc_html( $fmt_contado ) . ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= 'Precio $' . esc_html( $fmt_credito ) . ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= 'Precio $' . esc_html( $fmt_credito ) . ''; $html .= '
'; $html .= '
'; $html .= 'COMPRAR AHORA'; $html .= '
';echo $html; }add_action( 'wp_head', function() { if ( ! is_product() ) return;$css = '';echo $css; });
DESCUENTO CONTADO Los precios incluyen pago con tarjeta. Paga de contado y obtén un precio especial. Consultar por WhatsApp