Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

199
Vistas
How can i Toogle between 2 icons without reloading page in wordpress

i'm working in wordpress website,and i want to toogle between 2 icons carts one whene the cart is empty and the seconde display whene add items to the cart, i add this code:

<span class="wd-tools-icon <?php echo esc_attr( $icon_classes ); ?>">
            
    <?php if ( ! WC()->cart->is_empty() ) { ?>
        <img id="https:/.../images/cart.svg" class="wd-custom-icon" alt="" height="20.738" width="17.626">      
                            
    <?php } else{ ?>        
        <img decoding="async" src="https:/.../images/empty-cart.svg.svg" class="wd-custom-icon" alt="" height="20.738" width="17.626">      

   <?php } ?>                   

   <?php if ( '2' == $params['style'] || '5' == $params['style'] ) : ?>
        <?php woodmart_cart_count(); ?>
   <?php endif; ?>
</span>

but i need to refresh the page for displaying the cart; i'm looking for a way make me toogle between the 2 icons without reloading the page,a will be thankful for any suggestion

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda