Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

190
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!