• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Pruebas Online
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

119
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

almost 3 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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda