add_filter( 'woocommerce_package_rates', 'gestion_exclusiva_envio_baterias', 1000000, 2 ); function gestion_exclusiva_envio_baterias( $rates, $package ) { $clase_objetivo = 'productos-pesados'; $hay_pesados = false; // 1. Detectar si hay productos pesados foreach ( $package['contents'] as $item ) { if ( $item['data']->get_shipping_class() === $clase_objetivo ) { $hay_pesados = true; break; } } $nuevas_tarifas = array(); if ( $hay_pesados ) { // CASO A: Hay productos pesados -> Solo dejamos el de baterías foreach ( $rates as $rate_id => $rate ) { if ( stripos( $rate->label, 'baterías' ) !== false ) { $nuevas_tarifas[$rate_id] = $rate; } } } else { // CASO B: NO hay productos pesados -> Quitamos el de baterías y dejamos el resto (GLS, MRW...) foreach ( $rates as $rate_id => $rate ) { if ( stripos( $rate->label, 'baterías' ) === false ) { $nuevas_tarifas[$rate_id] = $rate; } } } // Si hemos filtrado algo, devolvemos la nueva lista. Si no, devolvemos lo original. return ! empty( $nuevas_tarifas ) ? $nuevas_tarifas : $rates; }
This month's best. Exclusive gifts on select products.
Showing 1–16 of 27 resultsOrdenado por los últimos
¡Double your productivity anywhere! This 16-inch portable monitor offers a screen FHD+ (1920×1200) in format 16:10, providing more workspace for a more comfortable and efficient experience.
Light (1.27 kg), with durable aluminum housing and Versatile connectivity via USB-C and Mini HDMI, It's perfect for working, studying, or playing wherever you want.
Protect your Blackview Active series device with the C03 genuine leather case, resistant to shocks and rough outdoor use.
The AceBook 10 laptop combines a robust design with multiple connectivity options, including HDMI 2.0, three USB 3.2 Gen 1 ports, a TF card slot, and a 3.5 mm audio jack. Its 60.8 Wh battery with 45W fast charging allows for extended work sessions, while the 2 MP front-facing camera facilitates clear video calls. Equipped with Windows 11 Pro and Dual BOX speakers, it's an efficient solution for both personal and professional use.
Oscal BP2400 Pro (Battery Pack)
Blackview COLOR 6 | 24GB RAM 128GB/256GB ROM
104,99 € – 119,99 €Rango de precios: desde 104,99 € hasta 119,99 €
OSCAL PowerMax 6000
Blackview Wave 9C | Simple and affordable mobile phone
OSCAL BP3600 (Battery Pack)